diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/index.html b/apps/ios/EdgeEver/Resources/EditorBundle/index.html index 2577e788..d8351352 100644 --- a/apps/ios/EdgeEver/Resources/EditorBundle/index.html +++ b/apps/ios/EdgeEver/Resources/EditorBundle/index.html @@ -7,14 +7,14 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> EdgeEver Editor - - +`},"getStyles"),LT,au=(LT=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,s,a,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${s?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},w(LT,"PathBuilder"),LT),IT,Zxr=(IT=class{constructor(e,r=uie()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s).attr("rx",10).attr("ry",10),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,s=0,a=0;for(const u of n)i+=u.dimensions.width,s=Math.max(s,u.dimensions.up),a=Math.max(a,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,s=0;for(const f of n)i=Math.max(i,f.dimensions.width),s+=f.dimensions.height;s+=(n.length-1)*this.config.verticalSeparation;const a=this.config.arcRadius,o=a*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=s/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=a*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new au,x=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(a,a,0,!1,x,a,d+(x?a:-a)).lineTo(a,g-(x?a:-a)).arcTo(a,a,0,!1,!x,a*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new au,T=m+f.dimensions.width,C=l-a*2;g===d?b.moveTo(T,g).lineTo(l,d):b.moveTo(T,g).lineTo(C,g).arcTo(a,a,0,!1,!x,l-a,g+(x?-a:a)).lineTo(l-a,d+(x?a:-a)).arcTo(a,a,0,!1,x,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:s,up:d,down:s-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,s=i*2,a=n.dimensions.width+i*4,o=n.dimensions.height+s,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=s;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new au().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new au().moveTo(u+n.dimensions.width,f).lineTo(a,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new au().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(a-i*2,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,f-i).arcTo(i,i,0,!1,!1,a,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:a,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),s=this.config.arcRadius,a=s*2,o=i.dimensions.width+s*4,l=n===0,u=i.dimensions.height+a+(l?a:0),h=e.append("g").attr("class","railroad-repetition"),d=s*2,f=l?a:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new au().moveTo(0,g).lineTo(s*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new au().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+s,y=new au().moveTo(d+i.dimensions.width,g).arcTo(s,s,0,!1,!0,d+i.dimensions.width+s,g+s).lineTo(d+i.dimensions.width+s,m).arcTo(s,s,0,!1,!0,d+i.dimensions.width,m+s).lineTo(s*2,m+s).arcTo(s,s,0,!1,!0,s,m).lineTo(s,g+s).arcTo(s,s,0,!1,!0,s*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new au().moveTo(0,g).arcTo(s,s,0,!1,!1,s,g-s).lineTo(s,s).arcTo(s,s,0,!1,!0,s*2,0).lineTo(o-s*2,0).arcTo(s,s,0,!1,!0,o-s,s).lineTo(o-s,g-s).arcTo(s,s,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text("? "+r+" ?"),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",s=this.measureText(i).width+20,a=s+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${a}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",s).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new au().moveTo(s+this.config.markerRadius,u).lineTo(a,u).build()),n.append("path").attr("class","railroad-line").attr("d",new au().moveTo(a+l.dimensions.width,u).lineTo(a+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const s=this.renderRule(i,r);r+=s.height+this.config.verticalSeparation,n=Math.max(n,s.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},w(IT,"RailroadRenderer"),IT),jye=w((t,e,r)=>{Fs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),Qxr=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram +`+t);try{const n=Xo(e);n.attr("class","railroad-diagram");const i=br().railroad,s=(i==null?void 0:i.useMaxWidth)??!0,a=Qi.getRules();if(de.debug(`[Railroad] Rendering ${a.length} rules`),a.length===0){de.warn("[Railroad] No rules to render"),jye(n,{height:100,width:200},s);return}const l=new Zxr(n,uie()).renderDiagram(a);jye(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),VP={draw:Qxr},Jxr=one().Railroad.parser.LangiumParser,Y2=w(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Y2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Y2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Y2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Y2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Y2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),e4r=w(t=>({name:t.name,definition:Y2(t.definition)}),"transformRule"),t4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(e4r(e)))},"populateDb"),r4r={parse:w(t=>{Qi.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=Jxr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[Railroad Parser] Parsed rules:",r.rules.length),t4r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Qi}},n4r={parser:r4r,db:Qi,renderer:VP,styles:zP};const i4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:n4r},Symbol.toStringTag,{value:"Module"}));var s4r=lne().RailroadEbnf.parser.LangiumParser,JR=w(t=>{const e=t.alternatives.map(a4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),a4r=w(t=>{const e=t.elements.map(l4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),vje=w(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return JR(t.element);case"EbnfOptional":return{type:"optional",element:JR(t.element)};case"EbnfRepetition":return{type:"repetition",element:JR(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),o4r=w((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},vje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),l4r=w(t=>t.postfixes.reduce((e,r)=>o4r(e,r),vje(t.base)),"transformTerm"),c4r=w(t=>({name:t.name,definition:JR(t.definition)}),"transformRule"),u4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(c4r(e)))},"populateDb"),h4r={parse:w(t=>{Qi.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=s4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[EBNF Parser] Parsed rules:",r.rules.length),u4r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},d4r={parser:h4r,db:Qi,renderer:VP,styles:zP};const f4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:d4r},Symbol.toStringTag,{value:"Module"}));var p4r=cne().RailroadAbnf.parser.LangiumParser,Qj=w(t=>{const e=t.alternatives.map(g4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),g4r=w(t=>{const e=t.elements.map(y4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),m4r=w(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,s=n?parseInt(n,10):1/0;return{min:i,max:s}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),y4r=w(t=>{const e=v4r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=m4r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),v4r=w(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return Qj(t.element);case"AbnfOptionalGroup":return{type:"optional",element:Qj(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),b4r=w(t=>({name:t.name,definition:Qj(t.definition)}),"transformRule"),x4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(b4r(e)))},"populateDb"),w4r={parse:w(t=>{Qi.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=p4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[ABNF Parser] Parsed rules:",r.rules.length),x4r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},T4r={parser:w4r,db:Qi,renderer:VP,styles:zP};const C4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:T4r},Symbol.toStringTag,{value:"Module"}));var k4r=une().RailroadPeg.parser.LangiumParser,bje=w(t=>{const e=t.alternatives.map(S4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),S4r=w(t=>{const e=t.elements.map(E4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),E4r=w(t=>{const e=A4r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Xye(e)}`:`!${Xye(e)}`}:e},"transformPrefix"),Xye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),A4r=w(t=>{const e=M4r(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),M4r=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return bje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),R4r=w(t=>({name:t.name,definition:bje(t.definition)}),"transformRule"),_4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(R4r(e)))},"populateDb"),L4r={parse:w(t=>{Qi.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=k4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[PEG Parser] Parsed rules:",r.rules.length),_4r(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Qi}},I4r={parser:L4r,db:Qi,renderer:VP,styles:zP};const N4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:I4r},Symbol.toStringTag,{value:"Module"}));var D4r=1;function hie(){if(!(typeof globalThis>"u"))return globalThis}w(hie,"getCaptureGlobal");function xje(){var t;return!!((t=hie())!=null&&t.mermaidCaptureSizes)}w(xje,"shouldCaptureSizes");function wje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(wje,"capturedFromLocation");function Tje(t,e){const r=hie();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,s=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const a={svgId:s,sizes:t};r.mermaidCapturedSizes.push(a),r.mermaidLastCapturedSizes=a}w(Tje,"emitCapturedSizes");function Cje(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&Tje({metadata:{captureVersion:D4r,capturedAt:new Date().toISOString(),capturedFrom:wje()},nodes:r},t)}w(Cje,"captureNodeSizes");const O4r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Cje,shouldCaptureSizes:xje},Symbol.toStringTag,{value:"Module"})),P4r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:$Ge,createInfoServices:BGe},Symbol.toStringTag,{value:"Module"})),$4r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:FGe,createPacketServices:zGe},Symbol.toStringTag,{value:"Module"})),B4r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:VGe,createPieServices:HGe},Symbol.toStringTag,{value:"Module"})),F4r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:GGe,createTreeViewServices:WGe},Symbol.toStringTag,{value:"Module"})),z4r=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:qGe,createArchitectureServices:UGe},Symbol.toStringTag,{value:"Module"})),V4r=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:OGe,createGitGraphServices:PGe},Symbol.toStringTag,{value:"Module"})),H4r=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:jGe,createEventModelingServices:XGe},Symbol.toStringTag,{value:"Module"})),G4r=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:TGe,createRadarServices:CGe},Symbol.toStringTag,{value:"Module"})),W4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:kGe,createRailroadServices:one},Symbol.toStringTag,{value:"Module"})),q4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:SGe,createRailroadEbnfServices:lne},Symbol.toStringTag,{value:"Module"})),U4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:EGe,createRailroadAbnfServices:cne},Symbol.toStringTag,{value:"Module"})),Y4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:AGe,createRailroadPegServices:une},Symbol.toStringTag,{value:"Module"})),j4r=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:RGe,createTreemapServices:_Ge},Symbol.toStringTag,{value:"Module"})),X4r=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:LGe,createWardleyServices:IGe},Symbol.toStringTag,{value:"Module"})),K4r=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:NGe,createCynefinServices:DGe},Symbol.toStringTag,{value:"Module"})); + "),typeof $t!="string"&&!gs($t)&&($t=_gt($t),typeof $t!="string"))throw wm("dirty is not a string, aborting");if(!e.isSupported)return $t;ne?(te=j,$e=J):Ur(Pe),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(te=Sc(te)),G.uponSanitizeAttribute.length>0&&($e=Sc($e)),e.removed=[];const ln=qe&&typeof $t!="string"&&gs($t);if(ln){pt($t);const Wl=E($t);if(typeof Wl=="string"){const ql=xt(Wl);if(!te[ql]||he[ql])throw Br($t),wm("root node is forbidden and cannot be sanitized in-place")}if(un($t))throw Br($t),wm("root node is clobbered and cannot be sanitized in-place");try{ep($t)}catch(ql){throw Br($t),ql}}else if(gs($t))nt=ar("\x3C!---->"),_t=nt.ownerDocument.importNode($t,!0),_t.nodeType===wc.element&&_t.nodeName==="BODY"||_t.nodeName==="HTML"?nt=_t:nt.appendChild(_t),ep(_t);else{if(!X&&!le&&!Ce&&$t.indexOf("<")===-1)return A&&ee?I($t):$t;if(nt=ar($t),!nt)return X?null:ee?R:""}nt&&ue&&vt(nt.firstChild);const _i=ln?$t:nt;try{const Wl=Ie(_i);for(;jt=Wl.nextNode();)pm(jt,_i),Js(jt),En(jt.content)&&xc(jt.content)}catch(Wl){throw ln&&(Br($t),Hm(e.removed,ql=>{ql.element&&bt(ql.element)})),Wl}if(ln)return Hm(e.removed,Wl=>{Wl.element&&bt(Wl.element)}),le&&Be($t),$t;if(X){if(le&&Be(nt),fe)for(Ar=V.call(nt.ownerDocument);nt.firstChild;)Ar.appendChild(nt.firstChild);else Ar=nt;return($e.shadowroot||$e.shadowrootmode)&&(Ar=H.call(n,Ar,!0)),Ar}let ms=Ce?nt.outerHTML:nt.innerHTML;return Ce&&te["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&&No(Vgt,nt.ownerDocument.doctype.name)&&(ms=" -`+ms),le&&(ms=si(ms)),A&&ee?I(ms):ms},e.setConfig=function(){let $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ur($t),ne=!0,j=te,J=$e},e.clearConfig=function(){nr=null,ne=!1,j=null,J=null,A=_,R=""},e.isValidAttribute=function($t,Pe,nt){nr||Ur({});const _t=xt($t),jt=xt(Pe);return gm(_t,jt,nt)},e.addHook=function($t,Pe){typeof Pe=="function"&&Kl(G,$t)&&H3(G[$t],Pe)},e.removeHook=function($t,Pe){if(Kl(G,$t)){if(Pe!==void 0){const nt=Cgt(G[$t],Pe);return nt===-1?void 0:kgt(G[$t],nt,1)[0]}return $oe(G[$t])}},e.removeHooks=function($t){Kl(G,$t)&&(G[$t]=[])},e.removeAllHooks=function(){G=Xoe()},e}var o0=Kwe(),IH=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>IH(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([s,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(t,s)||Object.defineProperty(t,s,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[s]===void 0&&(i[s]=Array.isArray(a)?[]:{}),typeof i[s]=="object"&&(i[s]=IH(i[s],a,{depth:r-1}))}else typeof i[s]!="object"&&(Object.hasOwn(t,s)?i[s]=a:Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),sa=IH,Bd="#ffffff",Fd="#f2f2f2",rn=w((t,e)=>e?ye(t,{s:-40,l:10}):ye(t,{s:-40,l:-10}),"mkBorder"),jb,Xgt=(jb=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me,te;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(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||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||ut(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ut(this.mainBkg,10)):(this.rowOdd=this.rowOdd||ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||ct(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.darkMode)for(let _e=0;_e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(jb,"Theme"),jb),Kgt=w(t=>{const e=new Xgt;return e.calculate(t),e},"getThemeVariables"),Xb,Zgt=(Xb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=dh(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=ut("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ut(this.sectionBkgColor,10),this.taskBorderColor=dh(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=dh(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||ct(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ut(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.secondBkg=ct(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=ct(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=ct(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=rt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ye(this.primaryColor,{h:64}),this.fillType3=ye(this.secondaryColor,{h:64}),this.fillType4=ye(this.primaryColor,{h:-64}),this.fillType5=ye(this.secondaryColor,{h:-64}),this.fillType6=ye(this.primaryColor,{h:128}),this.fillType7=ye(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330});for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Xb,"Theme"),Xb),Qgt=w(t=>{const e=new Zgt;return e.calculate(t),e},"getThemeVariables"),Kb,Jgt=(Kb=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ye(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=dh(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ut(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ut(this.tertiaryColor,40);for(let te=0;te{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Kb,"Theme"),Kb),$0=w(t=>{const e=new Jgt;return e.calculate(t),e},"getThemeVariables"),Zb,emt=(Zb=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=ct("#cde498",10),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.primaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.actorBorder=ut(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ut(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ut(this.tertiaryColor,40);for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Zb,"Theme"),Zb),tmt=w(t=>{const e=new emt;return e.calculate(t),e},"getThemeVariables"),Qb,rmt=(Qb=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ct(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.secondBkg=ct(this.contrast,55),this.border2=this.contrast,this.actorBorder=ct(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Qb,"Theme"),Qb),nmt=w(t=>{const e=new rmt;return e.calculate(t),e},"getThemeVariables"),Jb,imt=(Jb=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||ye(e,{h:30}),this.cScale4=this.cScale4||ye(e,{h:60}),this.cScale5=this.cScale5||ye(e,{h:90}),this.cScale6=this.cScale6||ye(e,{h:120}),this.cScale7=this.cScale7||ye(e,{h:150}),this.cScale8=this.cScale8||ye(e,{h:210,l:150}),this.cScale9=this.cScale9||ye(e,{h:270}),this.cScale10=this.cScale10||ye(e,{h:300}),this.cScale11=this.cScale11||ye(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Jb,"Theme"),Jb),smt=w(t=>{const e=new imt;return e.calculate(t),e},"getThemeVariables"),ex,amt=(ex=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.border1="#ccc",this.border2=dh(255,255,255,.25),this.arrowheadColor=rt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(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||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(ex,"Theme"),ex),omt=w(t=>{const e=new amt;return e.calculate(t),e},"getThemeVariables"),tx,lmt=(tx=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=rn("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(tx,"Theme"),tx),cmt=w(t=>{const e=new lmt;return e.calculate(t),e},"getThemeVariables"),rx,umt=(rx=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.border1="#ccc",this.border2=dh(255,255,255,.25),this.arrowheadColor=rt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ut(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(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||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(rx,"Theme"),rx),hmt=w(t=>{const e=new umt;return e.calculate(t),e},"getThemeVariables"),nx,dmt=(nx=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(nx,"Theme"),nx),fmt=w(t=>{const e=new dmt;return e.calculate(t),e},"getThemeVariables"),ix,pmt=(ix=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.border1="#ccc",this.border2=dh(255,255,255,.25),this.arrowheadColor=rt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ut(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(ix,"Theme"),ix),gmt=w(t=>{const e=new pmt;return e.calculate(t),e},"getThemeVariables"),Qf={base:{getThemeVariables:Kgt},dark:{getThemeVariables:Qgt},default:{getThemeVariables:$0},forest:{getThemeVariables:tmt},neutral:{getThemeVariables:nmt},neo:{getThemeVariables:smt},"neo-dark":{getThemeVariables:omt},redux:{getThemeVariables:cmt},"redux-dark":{getThemeVariables:hmt},"redux-color":{getThemeVariables:fmt},"redux-dark-color":{getThemeVariables:gmt}},oo={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Zwe={...oo,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Qf.default.getThemeVariables(),sequence:{...oo.sequence,messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:w(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:w(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...oo.gantt,tickInterval:void 0,useWidth:void 0},c4:{...oo.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...oo.flowchart,inheritDir:!1},external_personFont:w(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:w(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:w(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:w(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:w(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:w(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:w(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:w(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:w(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:w(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:w(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:w(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:w(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:w(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:w(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:w(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:w(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:w(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:w(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:w(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...oo.pie,useWidth:984},xyChart:{...oo.xyChart,useWidth:void 0},requirement:{...oo.requirement,useWidth:void 0},packet:{...oo.packet},eventmodeling:{...oo.eventmodeling},treeView:{...oo.treeView,useWidth:void 0},radar:{...oo.radar},railroad:{...oo.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...oo.ishikawa},sankey:{...oo.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...oo.venn},cynefin:{...oo.cynefin}},Qwe=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Qwe(t[n],"")]:[...r,e+n],[]),"keyify"),mmt=new Set(Qwe(Zwe,"")),Sn=Zwe,ymt={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},vmt=w((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(de.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),k9=w(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>k9(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!mmt.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=ymt[e];n?vmt(t[e],n):(de.debug("sanitizing object",e),k9(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=Jwe(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}de.debug("After sanitization",t)}},"sanitizeDirective"),Jwe=w(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),tc=sa({},JT),S9,gy=[],Wk=sa({},JT),UE=w((t,e)=>{let r=sa({},t),n={};for(const i of e)rTe(i),n=sa(n,i);if(r=sa(r,n),n.theme&&n.theme in Qf){const i=sa({},S9),s=sa(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Qf&&(r.themeVariables=Qf[r.theme].getThemeVariables(s))}return Wk=r,kmt(Wk),Wk},"updateCurrentConfig"),bmt=w(t=>(tc=sa({},JT),tc=sa(tc,t),t.theme&&Qf[t.theme]&&(tc.themeVariables=Qf[t.theme].getThemeVariables(t.themeVariables)),UE(tc,gy),tc),"setSiteConfig"),xmt=w(t=>{S9=sa({},t)},"saveConfigFromInitialize"),wmt=w(t=>(tc=sa(tc,t),UE(tc,gy),tc),"updateSiteConfig"),eTe=w(()=>sa({},tc),"getSiteConfig"),tTe=w(t=>(UE(Wk,[t]),vr()),"setConfig"),vr=w(()=>sa({},Wk),"getConfig"),rTe=w(t=>{t&&(["secure",...tc.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(de.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&rTe(t[e])}))},"sanitize"),Tmt=w(t=>{var e;k9(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),gy.push(t),UE(tc,gy)},"addDirective"),E9=w((t=tc)=>{gy=[],UE(t,gy)},"reset"),Cmt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Koe={},nTe=w(t=>{Koe[t]||(de.warn(Cmt[t]),Koe[t]=!0)},"issueWarning"),kmt=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&nTe("LAZY_LOAD_DEPRECATED")},"checkConfig"),iTe=w(()=>{let t={};S9&&(t=sa(t,S9));for(const e of gy)t=sa(t,e);return t},"getUserDefinedConfig"),ui=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&nTe("FLOWCHART_HTML_LABELS_DEPRECATED"),zd(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),sTe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,qk=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Smt=/\s*%%.*\n/gm,sx,aTe=(sx=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(sx,"UnknownDiagramError"),sx),my={},bK=w(function(t,e){t=t.replace(sTe,"").replace(qk,"").replace(Smt,` -`);for(const[r,{detector:n}]of Object.entries(my))if(n(t,e))return r;throw new aTe(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),NH=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)oTe(e,r,n)},"registerLazyLoadedDiagrams"),oTe=w((t,e,r)=>{my[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),my[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Emt=w(t=>my[t].loader,"getDiagramLoader"),r3=//gi,Amt=w(t=>t?uTe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Mmt=(()=>{let t=!1;return()=>{t||(lTe(),t=!0)}})();function lTe(){const t="data-temp-href-target";o0.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),o0.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}w(lTe,"setupDompurifyHooks");var cTe=w(t=>(Mmt(),o0.sanitize(t)),"removeScript"),Zoe=w((t,e)=>{if(ui(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=cTe(t):r!=="loose"&&(t=uTe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=Imt(t))}return t},"sanitizeMore"),Ln=w((t,e)=>t&&(e.dompurifyConfig?t=o0.sanitize(Zoe(t,e),e.dompurifyConfig).toString():t=o0.sanitize(Zoe(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),Rmt=w((t,e)=>typeof t=="string"?Ln(t,e):t.flat().map(r=>Ln(r,e)),"sanitizeTextOrArray"),_mt=w(t=>r3.test(t),"hasBreaks"),Lmt=w(t=>t.split(r3),"splitBreaks"),Imt=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),uTe=w(t=>t.replace(r3,"#br#"),"breakToPlaceholder"),$N=w(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),Nmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Dmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),xp=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Omt=w((t,e)=>{const r=DH(t,"~"),n=DH(e,"~");return r===1&&n===1},"shouldCombineSets"),Pmt=w(t=>{const e=DH(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),s=n.lastIndexOf("~");for(;i!==-1&&s!==-1&&i!==s;)n[i]="<",n[s]=">",i=n.indexOf("~"),s=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),Qoe=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),OH=/\$\$(.*?)\$\$/g,Ks=w(t=>{var e;return(((e=t.match(OH))==null?void 0:e.length)??0)>0},"hasKatex"),YE=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await BN(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),$mt=w(async(t,e)=>{if(!Ks(t))return t;if(!(Qoe()||e.legacyMathML||e.forceLegacyMathML))return t.replace(OH,"MathML is unsupported in this environment.");{const{default:r}=await Rr(async()=>{const{default:i}=await Promise.resolve().then(()=>gzt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!Qoe()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(r3).map(i=>Ks(i)?`
${i}
`:`
${i}
`).join("").replace(OH,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),BN=w(async(t,e)=>Ln(await $mt(t,e),e),"renderKatexSanitized"),Vt={getRows:Amt,sanitizeText:Ln,sanitizeTextOrArray:Rmt,hasBreaks:_mt,splitBreaks:Lmt,lineBreakRegex:r3,removeScript:cTe,getUrl:$N,evaluate:zd,getMax:Nmt,getMin:Dmt},Bmt=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),Fmt=w(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Fs=w(function(t,e,r,n){const i=Fmt(e,r,n);Bmt(t,i)},"configureSvgSize"),n3=w(function(t,e,r,n){const i=e.node().getBBox(),s=i.width,a=i.height;de.info(`SVG bounds: ${s}x${a}`,i);let o=0,l=0;de.info(`Graph bounds: ${o}x${l}`,t),o=s+r*2,l=a+r*2,de.info(`Calculated bounds: ${o}x${l}`),Fs(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),wM={};function PH(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}w(PH,"cssStyleSheetToString");var zmt=w((t,e,r,n)=>{let i="";return t in wM&&wM[t]?i=wM[t]({...r,svgId:n}):de.warn(`No theme found for ${t}`),`& { +`);return!s||!a?!1:t.chain().command(({tr:o})=>(o.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type||n.parentOffset!==0)return!1;const s=n.before();return s>0?!1:t.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:s}=r;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const a=i.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:o})=>(o.setSelection(Xr.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[IH({find:agt,type:this.type,getAttributes:t=>({language:t[1]})}),IH({find:ogt,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ki({key:new us("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!r||!s)return!1;const{tr:a,schema:o}=t.state,l=o.text(r.replace(/\r\n?/g,` +`));return a.replaceSelectionWith(this.type.create({language:s},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(wr.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}});var lgt=Kwe;const cgt="modulepreload",ugt=function(t,e){return new URL(t,e).href},Poe={},Rr=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let a=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=a(r.map(h=>{if(h=ugt(h,n),h in Poe)return;Poe[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===h&&(!d||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":cgt,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,y)=>{g.addEventListener("load",m),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};var Zwe=Object.defineProperty,w=(t,e)=>Zwe(t,"name",{value:e,configurable:!0}),BN=(t,e)=>{for(var r in e)Zwe(t,r,{get:e[r],enumerable:!0})},CM={exports:{}},hgt=CM.exports,$oe;function dgt(){return $oe||($oe=1,(function(t,e){(function(r,n){t.exports=n()})(hgt,(function(){var r=1e3,n=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={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(L){var I=["th","st","nd","rd"],$=L%100;return"["+L+(I[($-20)%10]||I[$]||I[0])+"]"}},b=function(L,I,$){var O=String(L);return!O||O.length>=I?L:""+Array(I+1-O.length).join($)+L},T={s:b,z:function(L){var I=-L.utcOffset(),$=Math.abs(I),O=Math.floor($/60),D=$%60;return(I<=0?"+":"-")+b(O,2,"0")+":"+b(D,2,"0")},m:function L(I,$){if(I.date()<$.date())return-L($,I);var O=12*($.year()-I.year())+($.month()-I.month()),D=I.clone().add(O,d),F=$-D<0,z=I.clone().add(O+(F?-1:1),d);return+(-(O+($-D)/(F?D-z:z-D))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s:a,ms:s,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},C="en",S={};S[C]=x;var k="$isDayjsObject",E=function(L){return L instanceof P||!(!L||!L[k])},A=function L(I,$,O){var D;if(!I)return C;if(typeof I=="string"){var F=I.toLowerCase();S[F]&&(D=F),$&&(S[F]=$,D=F);var z=I.split("-");if(!D&&z.length>1)return L(z[0])}else{var V=I.name;S[V]=I,D=V}return!O&&D&&(C=D),D||!O&&C},R=function(L,I){if(E(L))return L.clone();var $=typeof I=="object"?I:{};return $.date=L,$.args=arguments,new P($)},_=T;_.l=A,_.i=E,_.w=function(L,I){return R(L,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var P=(function(){function L($){this.$L=A($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var I=L.prototype;return I.parse=function($){this.$d=(function(O){var D=O.date,F=O.utc;if(D===null)return new Date(NaN);if(_.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var z=D.match(y);if(z){var V=z[2]-1||0,B=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)):new Date(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)}}return new Date(D)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return _},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function($,O){var D=R($);return this.startOf(O)<=D&&D<=this.endOf(O)},I.isAfter=function($,O){return R($){},"trace"),debug:w((...t)=>{},"debug"),info:w((...t)=>{},"info"),warn:w((...t)=>{},"warn"),error:w((...t)=>{},"error"),fatal:w((...t)=>{},"fatal")},xK=w(function(t="fatal"){let e=lf.fatal;typeof t=="string"?t.toLowerCase()in lf&&(e=lf[t]):typeof t=="number"&&(e=t),de.trace=()=>{},de.debug=()=>{},de.info=()=>{},de.warn=()=>{},de.error=()=>{},de.fatal=()=>{},e<=lf.fatal&&(de.fatal=console.error?console.error.bind(console,ru("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ru("FATAL"))),e<=lf.error&&(de.error=console.error?console.error.bind(console,ru("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ru("ERROR"))),e<=lf.warn&&(de.warn=console.warn?console.warn.bind(console,ru("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ru("WARN"))),e<=lf.info&&(de.info=console.info?console.info.bind(console,ru("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ru("INFO"))),e<=lf.debug&&(de.debug=console.debug?console.debug.bind(console,ru("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ru("DEBUG"))),e<=lf.trace&&(de.trace=console.debug?console.debug.bind(console,ru("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ru("TRACE")))},"setLogLevel"),ru=w(t=>`%c${Wa().format("ss.SSS")} : ${t} : `,"format");const kM={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,s=2*r-i;switch(n){case"r":return kM.hue2rgb(s,i,t+1/3)*255;case"g":return kM.hue2rgb(s,i,t)*255;case"b":return kM.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),s=Math.min(t,e,r),a=(i+s)/2;if(n==="l")return a*100;if(i===s)return 0;const o=i-s,l=a>.5?o/(2-i-s):o/(i+s);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},ggt={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},on={channel:kM,lang:pgt,unit:ggt},wp={};for(let t=0;t<=255;t++)wp[t]=on.unit.dec2hex(t);const Do={ALL:0,RGB:1,HSL:2};let mgt=class{constructor(){this.type=Do.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Do.ALL}is(e){return this.type===e}};class ygt{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new mgt}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Do.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=on.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=on.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=on.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=on.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=on.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=on.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Do.HSL)&&r!==void 0?r:(this._ensureHSL(),on.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Do.HSL)&&r!==void 0?r:(this._ensureHSL(),on.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Do.HSL)&&r!==void 0?r:(this._ensureHSL(),on.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Do.RGB)&&r!==void 0?r:(this._ensureRGB(),on.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Do.RGB)&&r!==void 0?r:(this._ensureRGB(),on.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Do.RGB)&&r!==void 0?r:(this._ensureRGB(),on.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Do.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Do.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Do.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Do.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Do.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Do.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const FN=new ygt({r:0,g:0,b:0,a:0},"transparent"),Eb={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Eb.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,s=i%4===0,a=i>4,o=a?1:17,l=a?8:4,u=s?0:-1,h=a?255:15;return FN.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:s?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${wp[Math.round(e)]}${wp[Math.round(r)]}${wp[Math.round(n)]}${wp[Math.round(i*255)]}`:`#${wp[Math.round(e)]}${wp[Math.round(r)]}${wp[Math.round(n)]}`}},N1={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(N1.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return on.channel.clamp.h(parseFloat(r)*.9);case"rad":return on.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return on.channel.clamp.h(parseFloat(r)*360)}}return on.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(N1.re);if(!r)return;const[,n,i,s,a,o]=r;return FN.set({h:N1._hue2deg(n),s:on.channel.clamp.s(parseFloat(i)),l:on.channel.clamp.l(parseFloat(s)),a:a?on.channel.clamp.a(o?parseFloat(a)/100:parseFloat(a)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${on.lang.round(e)}, ${on.lang.round(r)}%, ${on.lang.round(n)}%, ${i})`:`hsl(${on.lang.round(e)}, ${on.lang.round(r)}%, ${on.lang.round(n)}%)`}},Uk={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Uk.colors[t];if(e)return Eb.parse(e)},stringify:t=>{const e=Eb.stringify(t);for(const r in Uk.colors)if(Uk.colors[r]===e)return r}},GC={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(GC.re);if(!r)return;const[,n,i,s,a,o,l,u,h]=r;return FN.set({r:on.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:on.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:on.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?on.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${on.lang.round(e)}, ${on.lang.round(r)}, ${on.lang.round(n)}, ${on.lang.round(i)})`:`rgb(${on.lang.round(e)}, ${on.lang.round(r)}, ${on.lang.round(n)})`}},Ah={format:{keyword:Uk,hex:Eb,rgb:GC,rgba:GC,hsl:N1,hsla:N1},parse:t=>{if(typeof t!="string")return t;const e=Eb.parse(t)||GC.parse(t)||N1.parse(t)||Uk.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Do.HSL)||t.data.r===void 0?N1.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?GC.stringify(t):Eb.stringify(t)},Qwe=(t,e)=>{const r=Ah.parse(t);for(const n in e)r[n]=on.channel.clamp[n](e[n]);return Ah.stringify(r)},gh=(t,e,r=0,n=1)=>{if(typeof t!="number")return Qwe(t,{a:e});const i=FN.set({r:on.channel.clamp.r(t),g:on.channel.clamp.g(e),b:on.channel.clamp.b(r),a:on.channel.clamp.a(n)});return Ah.stringify(i)},wK=(t,e)=>on.lang.round(Ah.parse(t)[e]),vgt=t=>{const{r:e,g:r,b:n}=Ah.parse(t),i=.2126*on.channel.toLinear(e)+.7152*on.channel.toLinear(r)+.0722*on.channel.toLinear(n);return on.lang.round(i)},bgt=t=>vgt(t)>=.5,$l=t=>!bgt(t),TK=(t,e,r)=>{const n=Ah.parse(t),i=n[e],s=on.channel.clamp[e](i+r);return i!==s&&(n[e]=s),Ah.stringify(n)},ct=(t,e)=>TK(t,"l",e),ut=(t,e)=>TK(t,"l",-e),Boe=(t,e)=>TK(t,"a",-e),ye=(t,e)=>{const r=Ah.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Qwe(t,n)},xgt=(t,e,r=50)=>{const{r:n,g:i,b:s,a}=Ah.parse(t),{r:o,g:l,b:u,a:h}=Ah.parse(e),d=r/100,f=d*2-1,p=a-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,x=i*m+l*y,b=s*m+u*y,T=a*d+h*(1-d);return gh(v,x,b,T)},rt=(t,e=100)=>{const r=Ah.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,xgt(r,t,e)};/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function Foe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),s=2;s1?r-1:0),i=1;i"u"?null:da(BigInt.prototype.toString),qoe=typeof Symbol>"u"?null:da(Symbol.prototype.toString),Ql=da(Object.prototype.hasOwnProperty),Y3=da(Object.prototype.toString),No=da(RegExp.prototype.test),km=Dgt(TypeError);function da(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:WC;if(zoe&&zoe(t,null),!Ab(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const s=r(i);s!==i&&(Egt(e)||(e[n]=s),i=s)}t[i]=!0}return t}function Ogt(t){for(let e=0;e/g),Hgt=Qa(/\${[\w\W]*/g),Ggt=Qa(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wgt=Qa(/^aria-[\-\w]+$/),Koe=Qa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qgt=Qa(/^(?:\w+script|data):/i),Ugt=Qa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ygt=Qa(/^html$/i),jgt=Qa(/^[a-z][.\w]*(-[.\w]+)+$/i),Zoe=Qa(/<[/\w!]/g),Qoe=Qa(/<[/\w]/g),Xgt=Qa(/<\/no(script|embed|frames)/i),Kgt=Qa(/\/>/i),kc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},tTe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Zgt=Sa(Gn({},tTe)),Qgt=(function(){const t={};return qm(tTe,e=>{t[e]=Qa(new RegExp("])","i"))}),Sa(t)})(),Jgt=function(){return typeof window>"u"?null:window},emt=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Joe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lp=function(e,r,n,i){return Ql(e,r)&&Ab(e[r])?Gn(i.base?Mc(i.base):{},e[r],i.transform):n},D$=function(e,r,n){const i=Ql(e,r)?e[r]:void 0;return i&&typeof i=="object"?Mc(i):n()};function rTe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jgt();const e=$t=>rTe($t);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==kc.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,a=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=qu(f,"cloneNode"),g=qu(f,"remove"),m=qu(f,"nextSibling"),y=qu(f,"childNodes"),v=qu(f,"parentNode"),x=qu(f,"shadowRoot"),b=qu(f,"attributes"),T=a&&a.prototype?qu(a.prototype,"nodeType"):null,C=a&&a.prototype?qu(a.prototype,"nodeName"):null,S=a&&a.prototype?qu(a.prototype,"ownerDocument"):null,k=function(Pe){return T?T(Pe):Pe.nodeType},E=function(Pe){return C?C(Pe):Pe.nodeName};if(typeof s=="function"){const $t=r.createElement("template");$t.content&&$t.content.ownerDocument&&(r=$t.content.ownerDocument)}let A,R="",_,P=!1,N=0;const L=function(){if(N>0)throw km('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},I=function(Pe){L(),N++;try{return A.createHTML(Pe)}finally{N--}},$=function(Pe){L(),N++;try{return A.createScriptURL(Pe)}finally{N--}},O=function(){return P||(_=emt(d,i),P=!0),_},D=r,F=D.implementation,z=D.createNodeIterator,V=D.createDocumentFragment,B=D.getElementsByTagName,H=n.importNode;let G=Joe();e.isSupported=typeof Jwe=="function"&&typeof v=="function"&&F&&F.createHTMLDocument!==void 0;const W=zgt,K=Vgt,q=Hgt,oe=Ggt,Q=Wgt,Z=qgt,re=Ugt,ie=jgt;let me=Koe,te=null;const _e=Gn({},[...Uoe,..._$,...L$,...I$,...Yoe]);let $e=null;const Fe=Gn({},[...joe,...N$,...Xoe,...SA]);let ce=Object.seal(w2(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,Te=null;const ge=Object.seal(w2(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let He=!0,we=!0,Me=!1,je=!0,le=!1,pe=!0,Ce=!1,ne=!1,j=null,J=null,ue=!1,X=!1,fe=!1,ee=!1,Ae=!0,Re=!1;const Xe="user-content-";let Ne=!0,qe=!1,De={},Ke=null;const ze=Gn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let st=null;const Oe=Gn({},["audio","video","img","source","image","track"]);let mt=null;const Le=Gn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",At="http://www.w3.org/2000/svg",lt="http://www.w3.org/1999/xhtml";let zt=lt,It=!1,ft=null;const xe=Gn({},[St,At,lt],R$),Nt=Sa(["mi","mo","mn","ms","mtext"]);let Tt=Gn({},Nt);const yt=Sa(["annotation-xml"]);let Rt=Gn({},yt);const Or=Gn({},["title","style","font","a","script"]);let Ee=null;const it=["application/xhtml+xml","text/html"],gt="text/html";let xt=null,nr=null;const $r=r.createElement("form"),kr=function(Pe){return Pe instanceof RegExp||Pe instanceof Function},Ur=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nr&&nr===Pe)return;(!Pe||typeof Pe!="object")&&(Pe={}),Pe=Mc(Pe),Ee=it.indexOf(Pe.PARSER_MEDIA_TYPE)===-1?gt:Pe.PARSER_MEDIA_TYPE,xt=Ee==="application/xhtml+xml"?R$:WC,te=lp(Pe,"ALLOWED_TAGS",_e,{transform:xt}),$e=lp(Pe,"ALLOWED_ATTR",Fe,{transform:xt}),ft=lp(Pe,"ALLOWED_NAMESPACES",xe,{transform:R$}),mt=lp(Pe,"ADD_URI_SAFE_ATTR",Le,{transform:xt,base:Le}),st=lp(Pe,"ADD_DATA_URI_TAGS",Oe,{transform:xt,base:Oe}),Ke=lp(Pe,"FORBID_CONTENTS",ze,{transform:xt}),he=lp(Pe,"FORBID_TAGS",Mc({}),{transform:xt}),Te=lp(Pe,"FORBID_ATTR",Mc({}),{transform:xt}),De=Ql(Pe,"USE_PROFILES")?Pe.USE_PROFILES&&typeof Pe.USE_PROFILES=="object"?Mc(Pe.USE_PROFILES):Pe.USE_PROFILES:!1,He=Pe.ALLOW_ARIA_ATTR!==!1,we=Pe.ALLOW_DATA_ATTR!==!1,Me=Pe.ALLOW_UNKNOWN_PROTOCOLS||!1,je=Pe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=Pe.SAFE_FOR_TEMPLATES||!1,pe=Pe.SAFE_FOR_XML!==!1,Ce=Pe.WHOLE_DOCUMENT||!1,X=Pe.RETURN_DOM||!1,fe=Pe.RETURN_DOM_FRAGMENT||!1,ee=Pe.RETURN_TRUSTED_TYPE||!1,ue=Pe.FORCE_BODY||!1,Ae=Pe.SANITIZE_DOM!==!1,Re=Pe.SANITIZE_NAMED_PROPS||!1,Ne=Pe.KEEP_CONTENT!==!1,qe=Pe.IN_PLACE||!1,me=$gt(Pe.ALLOWED_URI_REGEXP)?Pe.ALLOWED_URI_REGEXP:Koe,zt=typeof Pe.NAMESPACE=="string"?Pe.NAMESPACE:lt,Tt=D$(Pe,"MATHML_TEXT_INTEGRATION_POINTS",()=>Gn({},Nt)),Rt=D$(Pe,"HTML_INTEGRATION_POINTS",()=>Gn({},yt));const nt=D$(Pe,"CUSTOM_ELEMENT_HANDLING",()=>w2(null));if(ce=w2(null),Ql(nt,"tagNameCheck")&&kr(nt.tagNameCheck)&&(ce.tagNameCheck=nt.tagNameCheck),Ql(nt,"attributeNameCheck")&&kr(nt.attributeNameCheck)&&(ce.attributeNameCheck=nt.attributeNameCheck),Ql(nt,"allowCustomizedBuiltInElements")&&typeof nt.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=nt.allowCustomizedBuiltInElements),Qa(ce),le&&(we=!1),fe&&(X=!0),De&&(te=Gn({},Yoe),$e=w2(null),De.html===!0&&(Gn(te,Uoe),Gn($e,joe)),De.svg===!0&&(Gn(te,_$),Gn($e,N$),Gn($e,SA)),De.svgFilters===!0&&(Gn(te,L$),Gn($e,N$),Gn($e,SA)),De.mathMl===!0&&(Gn(te,I$),Gn($e,Xoe),Gn($e,SA))),ge.tagCheck=null,ge.attributeCheck=null,Ql(Pe,"ADD_TAGS")&&(typeof Pe.ADD_TAGS=="function"?ge.tagCheck=Pe.ADD_TAGS:Ab(Pe.ADD_TAGS)&&(te===_e&&(te=Mc(te)),Gn(te,Pe.ADD_TAGS,xt))),Ql(Pe,"ADD_ATTR")&&(typeof Pe.ADD_ATTR=="function"?ge.attributeCheck=Pe.ADD_ATTR:Ab(Pe.ADD_ATTR)&&($e===Fe&&($e=Mc($e)),Gn($e,Pe.ADD_ATTR,xt))),Ql(Pe,"ADD_FORBID_CONTENTS")&&Ab(Pe.ADD_FORBID_CONTENTS)&&(Ke===ze&&(Ke=Mc(Ke)),Gn(Ke,Pe.ADD_FORBID_CONTENTS,xt)),Ne&&(te["#text"]=!0),Ce&&Gn(te,["html","head","body"]),te.table&&(Gn(te,["tbody"]),delete he.tbody),Pe.TRUSTED_TYPES_POLICY){if(typeof Pe.TRUSTED_TYPES_POLICY.createHTML!="function")throw km('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Pe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw km('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const _t=A;A=Pe.TRUSTED_TYPES_POLICY;try{R=I("")}catch(jt){throw A=_t,jt}}else Pe.TRUSTED_TYPES_POLICY===null?(A=void 0,R=""):(A===void 0&&(A=O()),A&&typeof R=="string"&&(R=I("")));Sa&&Sa(Pe),nr=Pe},Er=Gn({},[..._$,...L$,...Bgt]),nn=Gn({},[...I$,...Fgt]),Cr=function(Pe,nt,_t){return nt.namespaceURI===lt?Pe==="svg":nt.namespaceURI===St?Pe==="svg"&&(_t==="annotation-xml"||Tt[_t]):!!Er[Pe]},Yr=function(Pe,nt,_t){return nt.namespaceURI===lt?Pe==="math":nt.namespaceURI===At?Pe==="math"&&Rt[_t]:!!nn[Pe]},wn=function(Pe,nt,_t){return nt.namespaceURI===At&&!Rt[_t]||nt.namespaceURI===St&&!Tt[_t]?!1:!nn[Pe]&&(Or[Pe]||!Er[Pe])},ht=function(Pe){let nt=v(Pe);(!nt||!nt.tagName)&&(nt={namespaceURI:zt,tagName:"template"});const _t=WC(Pe.tagName),jt=WC(nt.tagName);return ft[Pe.namespaceURI]?Pe.namespaceURI===At?Cr(_t,nt,jt):Pe.namespaceURI===St?Yr(_t,nt,jt):Pe.namespaceURI===lt?wn(_t,nt,jt):!!(Ee==="application/xhtml+xml"&&ft[Pe.namespaceURI]):!1},vt=function(Pe){q3(e.removed,{element:Pe});try{v(Pe).removeChild(Pe)}catch{if(g(Pe),!v(Pe))throw km("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Kt=function(Pe,nt,_t){try{Pe.removeAttributeNode(nt)}catch{try{Pe.removeAttribute(_t)}catch{}}},Br=function(Pe){bt(Pe);const nt=y(Pe);if(nt){const jt=[];qm(nt,Ar=>{q3(jt,Ar)}),qm(jt,Ar=>{try{g(Ar)}catch{}})}const _t=b(Pe);if(_t)for(let jt=_t.length-1;jt>=0;--jt){const Ar=_t[jt],ln=Ar&&Ar.name;typeof ln=="string"&&Kt(Pe,Ar,ln)}},cn=function(Pe,nt,_t){if(!_t)try{_t=nt.getAttributeNode(Pe)}catch{_t=null}q3(e.removed,{attribute:_t||null,from:nt});try{_t?nt.removeAttributeNode(_t):nt.removeAttribute(Pe)}catch{try{nt.removeAttribute(Pe)}catch{}}if(Pe==="is")if(X||fe)try{vt(nt)}catch{}else try{nt.setAttribute(Pe,"")}catch{}},kt=function(Pe){const nt=b(Pe);if(nt)for(let _t=nt.length-1;_t>=0;--_t){const jt=nt[_t],Ar=jt&&jt.name;typeof Ar!="string"||$e[xt(Ar)]||Kt(Pe,jt,Ar)}},bt=function(Pe){const nt=[Pe];for(;nt.length>0;){const _t=nt.pop();k(_t)===kc.element&&kt(_t);const Ar=y(_t);if(Ar)for(let ln=Ar.length-1;ln>=0;--ln)nt.push(Ar[ln])}},Pt=function(Pe,nt){return pe?Pe==="patchsrc"?!0:Pe==="for"&&nt!=="label"&&nt!=="output":!1},pt=function(Pe){if(!pe)return;const nt=[Pe];for(;nt.length>0;){const _t=nt.pop(),jt=k(_t);if(jt===kc.processingInstruction||jt===kc.comment&&No(Qoe,_t.data)){try{g(_t)}catch{}continue}if(jt===kc.element){const ln=_t,_i=xt(E(_t));try{ln.hasAttribute&&ln.hasAttribute("patchsrc")&&ln.removeAttribute("patchsrc"),ln.hasAttribute&&ln.hasAttribute("for")&&Pt("for",_i)&&ln.removeAttribute("for")}catch{}}const Ar=y(_t);if(Ar)for(let ln=Ar.length-1;ln>=0;--ln)nt.push(Ar[ln])}},ar=function(Pe){let nt=null,_t=null;if(ue)Pe=""+Pe;else{const ln=Hoe(Pe,/^[\r\n\t ]+/);_t=ln&&ln[0]}Ee==="application/xhtml+xml"&&zt===lt&&(Pe=''+Pe+"");const jt=A?I(Pe):Pe;if(zt===lt)try{nt=new h().parseFromString(jt,Ee)}catch{}if(!nt||!nt.documentElement){nt=F.createDocument(zt,"template",null);try{nt.documentElement.innerHTML=It?R:jt}catch{}}const Ar=nt.body||nt.documentElement;return Pe&&_t&&Ar.insertBefore(r.createTextNode(_t),Ar.childNodes[0]||null),zt===lt?B.call(nt,Ce?"html":"body")[0]:Ce?nt.documentElement:Ar},Ie=function(Pe){const nt=S?S(Pe):Pe.ownerDocument;return z.call(nt||Pe,Pe,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ai=function(Pe){return Pe=U3(Pe,W," "),Pe=U3(Pe,K," "),Pe=U3(Pe,q," "),Pe},Be=function(Pe){var nt;Pe.normalize();const _t=S?S(Pe):Pe.ownerDocument,jt=z.call(_t||Pe,Pe,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Ar=jt.nextNode();for(;Ar;)Ar.data=ai(Ar.data),Ar=jt.nextNode();const ln=(nt=Pe.querySelectorAll)===null||nt===void 0?void 0:nt.call(Pe,"template");ln&&qm(ln,_i=>{En(_i.content)&&Be(_i.content)})},un=function(Pe){const nt=C?C(Pe):null;return typeof nt!="string"||xt(nt)!=="form"?!1:typeof Pe.nodeName!="string"||typeof Pe.textContent!="string"||typeof Pe.removeChild!="function"||Pe.attributes!==b(Pe)||typeof Pe.removeAttribute!="function"||typeof Pe.setAttribute!="function"||typeof Pe.namespaceURI!="string"||typeof Pe.insertBefore!="function"||typeof Pe.hasChildNodes!="function"||Pe.nodeType!==T(Pe)||Pe.childNodes!==y(Pe)},En=function(Pe){if(!T||typeof Pe!="object"||Pe===null)return!1;try{return T(Pe)===kc.documentFragment}catch{return!1}},gs=function(Pe){if(!T||typeof Pe!="object"||Pe===null)return!1;try{return typeof T(Pe)=="number"}catch{return!1}};function mn($t,Pe,nt){$t.length!==0&&qm($t,_t=>{_t.call(e,Pe,nt,nr)})}const mi=function(Pe,nt){return!!(pe&&Pe.hasChildNodes()&&!gs(Pe.firstElementChild)&&No(Zoe,Pe.textContent)&&No(Zoe,Pe.innerHTML)||pe&&Pe.namespaceURI===lt&&Zgt[nt]&&(gs(Pe.firstElementChild)||typeof Pe.textContent=="string"&&No(Qgt[nt],Pe.textContent))||Pe.nodeType===kc.processingInstruction||pe&&Pe.nodeType===kc.comment&&No(Qoe,Pe.data))},An=function(Pe,nt){if(Pe instanceof RegExp)return No(Pe,nt);if(Pe instanceof Function){for(var _t=arguments.length,jt=new Array(_t>2?_t-2:0),Ar=2;Ar<_t;Ar++)jt[Ar-2]=arguments[Ar];return!!Pe(nt,...jt)}return!1},Lo=function(Pe,nt,_t){if(!he[nt]&&ga(nt)&&An(ce.tagNameCheck,nt))return!1;if(Ne&&!Ke[nt]){const jt=v(Pe),Ar=y(Pe);if(Ar&&jt){const ln=Ar.length;for(let _i=ln-1;_i>=0;--_i){const ms=Pe===_t?p(Ar[_i],!0):Ar[_i];jt.insertBefore(ms,m(Pe))}}}return vt(Pe),!0},Vu=function(Pe,nt,_t,jt){return Pe.length===0?nt:nt===_t||nt===jt?Mc(nt):nt},Fh=function(Pe,nt){return Pe===nt||v(Pe)!==null?!1:(qe&&bt(Pe),!0)},ym=function(Pe,nt){if(mn(G.beforeSanitizeElements,Pe,null),Fh(Pe,nt))return!0;if(un(Pe))return vt(Pe),!0;const _t=xt(E(Pe));if(te=Vu(G.uponSanitizeElement,te,_e,j),mn(G.uponSanitizeElement,Pe,{tagName:_t,allowedTags:te}),Fh(Pe,nt))return!0;if(mi(Pe,_t))return vt(Pe),!0;if(he[_t]||!(ge.tagCheck instanceof Function&&ge.tagCheck(_t))&&!te[_t]){const Ar=Lo(Pe,_t,nt);return Ar===!1&&mn(G.afterSanitizeElements,Pe,null),Ar}if(k(Pe)===kc.element&&!ht(Pe)||(_t==="noscript"||_t==="noembed"||_t==="noframes")&&No(Xgt,Pe.innerHTML))return vt(Pe),!0;if(le&&Pe.nodeType===kc.text){const Ar=ai(Pe.textContent);Pe.textContent!==Ar&&(q3(e.removed,{element:Pe.cloneNode()}),Pe.textContent=Ar)}return mn(G.afterSanitizeElements,Pe,null),!1},vm=function(Pe,nt,_t){if(Te[nt]||Pt(nt,Pe)||Ae&&(nt==="id"||nt==="name")&&(_t in r||_t in $r))return!1;const jt=$e[nt]||ge.attributeCheck instanceof Function&&ge.attributeCheck(nt,Pe);return we&&No(oe,nt)||He&&No(Q,nt)?!0:jt?mt[nt]||No(me,U3(_t,re,""))||(nt==="src"||nt==="xlink:href"||nt==="href")&&Pe!=="script"&&Goe(_t,"data:")===0&&st[Pe]||Me&&!No(Z,U3(_t,re,""))?!0:!_t:ga(Pe)&&An(ce.tagNameCheck,Pe)&&An(ce.attributeNameCheck,nt,Pe)||nt==="is"&&ce.allowCustomizedBuiltInElements&&An(ce.tagNameCheck,_t)},bm=Gn({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ga=function(Pe){return!bm[WC(Pe)]&&No(ie,Pe)},ql=function(Pe,nt,_t,jt){if(A&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!_t)switch(d.getAttributeType(Pe,nt)){case"TrustedHTML":return I(jt);case"TrustedScriptURL":return $(jt)}return jt},ao=function(Pe,nt,_t,jt){try{_t?Pe.setAttributeNS(_t,nt,jt):Pe.setAttribute(nt,jt),un(Pe)?vt(Pe):Voe(e.removed)}catch{cn(nt,Pe)}},Js=function(Pe){mn(G.beforeSanitizeAttributes,Pe,null);const nt=Pe.attributes;if(!nt||un(Pe))return;$e=Vu(G.uponSanitizeAttribute,$e,Fe,J);const _t={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let jt=nt.length;const Ar=xt(Pe.nodeName);for(;jt--;){const ln=nt[jt],_i=ln.name,ms=ln.namespaceURI,Ul=ln.value,Yl=xt(_i),HP=Ul;let el=_i==="value"?HP:Lgt(HP);if(_t.attrName=Yl,_t.attrValue=el,_t.keepAttr=!0,_t.forceKeepAttr=void 0,mn(G.uponSanitizeAttribute,Pe,_t),el=_t.attrValue,Re&&(Yl==="id"||Yl==="name")&&Goe(el,Xe)!==0&&(cn(_i,Pe,ln),el=Xe+el),pe&&No(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,el)){cn(_i,Pe,ln);continue}if(Yl==="attributename"&&Hoe(el,"href")){cn(_i,Pe,ln);continue}if(!_t.forceKeepAttr){if(!_t.keepAttr){cn(_i,Pe,ln);continue}if(!je&&No(Kgt,el)){cn(_i,Pe,ln);continue}if(le&&(el=ai(el)),!vm(Ar,Yl,el)){cn(_i,Pe,ln);continue}el=ql(Ar,Yl,ms,el),el!==HP&&ao(Pe,_i,ms,el)}}mn(G.afterSanitizeAttributes,Pe,null)},Cc=function(Pe){let nt=null;const _t=Ie(Pe);for(mn(G.beforeSanitizeShadowDOM,Pe,null);nt=_t.nextNode();)if(mn(G.uponSanitizeShadowNode,nt,null),ym(nt,Pe),Js(nt),En(nt.content)&&Cc(nt.content),k(nt)===kc.element){const jt=x(nt);En(jt)&&(ip(jt),Cc(jt))}mn(G.afterSanitizeShadowDOM,Pe,null)},ip=function(Pe){const nt=[{node:Pe,shadow:null}];for(;nt.length>0;){const _t=nt.pop();if(_t.shadow){Cc(_t.shadow);continue}const jt=_t.node,ln=k(jt)===kc.element,_i=y(jt);if(_i)for(let ms=_i.length-1;ms>=0;--ms)nt.push({node:_i[ms],shadow:null});if(ln){const ms=C?C(jt):null;if(typeof ms=="string"&&xt(ms)==="template"){const Ul=jt.content;En(Ul)&&nt.push({node:Ul,shadow:null})}}if(ln){const ms=x(jt);En(ms)&&nt.push({node:null,shadow:ms},{node:ms,shadow:null})}}};return e.sanitize=function($t){let Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt=null,_t=null,jt=null,Ar=null;if(It=!$t,It&&($t="\x3C!-->"),typeof $t!="string"&&!gs($t)&&($t=Pgt($t),typeof $t!="string"))throw km("dirty is not a string, aborting");if(!e.isSupported)return $t;ne?(te=j,$e=J):Ur(Pe),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(te=Mc(te)),G.uponSanitizeAttribute.length>0&&($e=Mc($e)),e.removed=[];const ln=qe&&typeof $t!="string"&&gs($t);if(ln){pt($t);const Ul=E($t);if(typeof Ul=="string"){const Yl=xt(Ul);if(!te[Yl]||he[Yl])throw Br($t),km("root node is forbidden and cannot be sanitized in-place")}if(un($t))throw Br($t),km("root node is clobbered and cannot be sanitized in-place");try{ip($t)}catch(Yl){throw Br($t),Yl}}else if(gs($t))nt=ar("\x3C!---->"),_t=nt.ownerDocument.importNode($t,!0),_t.nodeType===kc.element&&_t.nodeName==="BODY"||_t.nodeName==="HTML"?nt=_t:nt.appendChild(_t),ip(_t);else{if(!X&&!le&&!Ce&&$t.indexOf("<")===-1)return A&&ee?I($t):$t;if(nt=ar($t),!nt)return X?null:ee?R:""}nt&&ue&&vt(nt.firstChild);const _i=ln?$t:nt;try{const Ul=Ie(_i);for(;jt=Ul.nextNode();)ym(jt,_i),Js(jt),En(jt.content)&&Cc(jt.content)}catch(Ul){throw ln&&(Br($t),qm(e.removed,Yl=>{Yl.element&&bt(Yl.element)})),Ul}if(ln)return qm(e.removed,Ul=>{Ul.element&&bt(Ul.element)}),le&&Be($t),$t;if(X){if(le&&Be(nt),fe)for(Ar=V.call(nt.ownerDocument);nt.firstChild;)Ar.appendChild(nt.firstChild);else Ar=nt;return($e.shadowroot||$e.shadowrootmode)&&(Ar=H.call(n,Ar,!0)),Ar}let ms=Ce?nt.outerHTML:nt.innerHTML;return Ce&&te["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&&No(Ygt,nt.ownerDocument.doctype.name)&&(ms=" +`+ms),le&&(ms=ai(ms)),A&&ee?I(ms):ms},e.setConfig=function(){let $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ur($t),ne=!0,j=te,J=$e},e.clearConfig=function(){nr=null,ne=!1,j=null,J=null,A=_,R=""},e.isValidAttribute=function($t,Pe,nt){nr||Ur({});const _t=xt($t),jt=xt(Pe);return vm(_t,jt,nt)},e.addHook=function($t,Pe){typeof Pe=="function"&&Ql(G,$t)&&q3(G[$t],Pe)},e.removeHook=function($t,Pe){if(Ql(G,$t)){if(Pe!==void 0){const nt=Rgt(G[$t],Pe);return nt===-1?void 0:_gt(G[$t],nt,1)[0]}return Voe(G[$t])}},e.removeHooks=function($t){Ql(G,$t)&&(G[$t]=[])},e.removeAllHooks=function(){G=Joe()},e}var h0=rTe(),PH=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>PH(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([s,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(t,s)||Object.defineProperty(t,s,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[s]===void 0&&(i[s]=Array.isArray(a)?[]:{}),typeof i[s]=="object"&&(i[s]=PH(i[s],a,{depth:r-1}))}else typeof i[s]!="object"&&(Object.hasOwn(t,s)?i[s]=a:Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),sa=PH,Vd="#ffffff",Hd="#f2f2f2",rn=w((t,e)=>e?ye(t,{s:-40,l:10}):ye(t,{s:-40,l:-10}),"mkBorder"),Kb,tmt=(Kb=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me,te;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(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||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||ut(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ut(this.mainBkg,10)):(this.rowOdd=this.rowOdd||ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||ct(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.darkMode)for(let _e=0;_e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Kb,"Theme"),Kb),rmt=w(t=>{const e=new tmt;return e.calculate(t),e},"getThemeVariables"),Zb,nmt=(Zb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=gh(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=ut("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ut(this.sectionBkgColor,10),this.taskBorderColor=gh(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=gh(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||ct(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ut(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.secondBkg=ct(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=ct(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=ct(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=rt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ye(this.primaryColor,{h:64}),this.fillType3=ye(this.secondaryColor,{h:64}),this.fillType4=ye(this.primaryColor,{h:-64}),this.fillType5=ye(this.secondaryColor,{h:-64}),this.fillType6=ye(this.primaryColor,{h:128}),this.fillType7=ye(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330});for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Zb,"Theme"),Zb),imt=w(t=>{const e=new nmt;return e.calculate(t),e},"getThemeVariables"),Qb,smt=(Qb=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ye(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=gh(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ut(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ut(this.tertiaryColor,40);for(let te=0;te{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Qb,"Theme"),Qb),V0=w(t=>{const e=new smt;return e.calculate(t),e},"getThemeVariables"),Jb,amt=(Jb=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=ct("#cde498",10),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.primaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.actorBorder=ut(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ut(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ut(this.tertiaryColor,40);for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Jb,"Theme"),Jb),omt=w(t=>{const e=new amt;return e.calculate(t),e},"getThemeVariables"),ex,lmt=(ex=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ct(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T,C,S,k,E,A,R,_,P,N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me;this.secondBkg=ct(this.contrast,55),this.border2=this.contrast,this.actorBorder=ct(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(ex,"Theme"),ex),cmt=w(t=>{const e=new lmt;return e.calculate(t),e},"getThemeVariables"),tx,umt=(tx=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||ye(e,{h:30}),this.cScale4=this.cScale4||ye(e,{h:60}),this.cScale5=this.cScale5||ye(e,{h:90}),this.cScale6=this.cScale6||ye(e,{h:120}),this.cScale7=this.cScale7||ye(e,{h:150}),this.cScale8=this.cScale8||ye(e,{h:210,l:150}),this.cScale9=this.cScale9||ye(e,{h:270}),this.cScale10=this.cScale10||ye(e,{h:300}),this.cScale11=this.cScale11||ye(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(tx,"Theme"),tx),hmt=w(t=>{const e=new umt;return e.calculate(t),e},"getThemeVariables"),rx,dmt=(rx=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.border1="#ccc",this.border2=gh(255,255,255,.25),this.arrowheadColor=rt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(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||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(rx,"Theme"),rx),fmt=w(t=>{const e=new dmt;return e.calculate(t),e},"getThemeVariables"),nx,pmt=(nx=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=rn("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(nx,"Theme"),nx),gmt=w(t=>{const e=new pmt;return e.calculate(t),e},"getThemeVariables"),ix,mmt=(ix=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.border1="#ccc",this.border2=gh(255,255,255,.25),this.arrowheadColor=rt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ut(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(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||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(ix,"Theme"),ix),ymt=w(t=>{const e=new mmt;return e.calculate(t),e},"getThemeVariables"),sx,vmt=(sx=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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?ut(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||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(sx,"Theme"),sx),bmt=w(t=>{const e=new vmt;return e.calculate(t),e},"getThemeVariables"),ax,xmt=(ax=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ct(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ct(rt("#323D47"),10),this.border1="#ccc",this.border2=gh(255,255,255,.25),this.arrowheadColor=rt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,s,a,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?ut(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ct(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(ax,"Theme"),ax),wmt=w(t=>{const e=new xmt;return e.calculate(t),e},"getThemeVariables"),r0={base:{getThemeVariables:rmt},dark:{getThemeVariables:imt},default:{getThemeVariables:V0},forest:{getThemeVariables:omt},neutral:{getThemeVariables:cmt},neo:{getThemeVariables:hmt},"neo-dark":{getThemeVariables:fmt},redux:{getThemeVariables:gmt},"redux-dark":{getThemeVariables:ymt},"redux-color":{getThemeVariables:bmt},"redux-dark-color":{getThemeVariables:wmt}},oo={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},nTe={...oo,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:r0.default.getThemeVariables(),sequence:{...oo.sequence,messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:w(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:w(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...oo.gantt,tickInterval:void 0,useWidth:void 0},c4:{...oo.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...oo.flowchart,inheritDir:!1},external_personFont:w(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:w(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:w(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:w(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:w(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:w(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:w(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:w(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:w(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:w(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:w(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:w(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:w(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:w(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:w(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:w(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:w(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:w(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:w(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:w(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...oo.pie,useWidth:984},xyChart:{...oo.xyChart,useWidth:void 0},requirement:{...oo.requirement,useWidth:void 0},packet:{...oo.packet},eventmodeling:{...oo.eventmodeling},treeView:{...oo.treeView,useWidth:void 0},radar:{...oo.radar},railroad:{...oo.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...oo.ishikawa},sankey:{...oo.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...oo.venn},cynefin:{...oo.cynefin}},iTe=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...iTe(t[n],"")]:[...r,e+n],[]),"keyify"),Tmt=new Set(iTe(nTe,"")),Sn=nTe,Cmt={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},kmt=w((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(de.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),M9=w(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>M9(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Tmt.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Cmt[e];n?kmt(t[e],n):(de.debug("sanitizing object",e),M9(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=sTe(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}de.debug("After sanitization",t)}},"sanitizeDirective"),sTe=w(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ic=sa({},t5),R9,yy=[],Yk=sa({},t5),XE=w((t,e)=>{let r=sa({},t),n={};for(const i of e)lTe(i),n=sa(n,i);if(r=sa(r,n),n.theme&&n.theme in r0){const i=sa({},R9),s=sa(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in r0&&(r.themeVariables=r0[r.theme].getThemeVariables(s))}return Yk=r,_mt(Yk),Yk},"updateCurrentConfig"),Smt=w(t=>(ic=sa({},t5),ic=sa(ic,t),t.theme&&r0[t.theme]&&(ic.themeVariables=r0[t.theme].getThemeVariables(t.themeVariables)),XE(ic,yy),ic),"setSiteConfig"),Emt=w(t=>{R9=sa({},t)},"saveConfigFromInitialize"),Amt=w(t=>(ic=sa(ic,t),XE(ic,yy),ic),"updateSiteConfig"),aTe=w(()=>sa({},ic),"getSiteConfig"),oTe=w(t=>(XE(Yk,[t]),br()),"setConfig"),br=w(()=>sa({},Yk),"getConfig"),lTe=w(t=>{t&&(["secure",...ic.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(de.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&lTe(t[e])}))},"sanitize"),Mmt=w(t=>{var e;M9(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),yy.push(t),XE(ic,yy)},"addDirective"),_9=w((t=ic)=>{yy=[],XE(t,yy)},"reset"),Rmt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},ele={},cTe=w(t=>{ele[t]||(de.warn(Rmt[t]),ele[t]=!0)},"issueWarning"),_mt=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&cTe("LAZY_LOAD_DEPRECATED")},"checkConfig"),uTe=w(()=>{let t={};R9&&(t=sa(t,R9));for(const e of yy)t=sa(t,e);return t},"getUserDefinedConfig"),hi=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&cTe("FLOWCHART_HTML_LABELS_DEPRECATED"),Gd(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),hTe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,jk=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Lmt=/\s*%%.*\n/gm,ox,dTe=(ox=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(ox,"UnknownDiagramError"),ox),vy={},CK=w(function(t,e){t=t.replace(hTe,"").replace(jk,"").replace(Lmt,` +`);for(const[r,{detector:n}]of Object.entries(vy))if(n(t,e))return r;throw new dTe(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),$H=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)fTe(e,r,n)},"registerLazyLoadedDiagrams"),fTe=w((t,e,r)=>{vy[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),vy[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Imt=w(t=>vy[t].loader,"getDiagramLoader"),s3=//gi,Nmt=w(t=>t?mTe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Dmt=(()=>{let t=!1;return()=>{t||(pTe(),t=!0)}})();function pTe(){const t="data-temp-href-target";h0.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),h0.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}w(pTe,"setupDompurifyHooks");var gTe=w(t=>(Dmt(),h0.sanitize(t)),"removeScript"),tle=w((t,e)=>{if(hi(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=gTe(t):r!=="loose"&&(t=mTe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=Bmt(t))}return t},"sanitizeMore"),Ln=w((t,e)=>t&&(e.dompurifyConfig?t=h0.sanitize(tle(t,e),e.dompurifyConfig).toString():t=h0.sanitize(tle(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),Omt=w((t,e)=>typeof t=="string"?Ln(t,e):t.flat().map(r=>Ln(r,e)),"sanitizeTextOrArray"),Pmt=w(t=>s3.test(t),"hasBreaks"),$mt=w(t=>t.split(s3),"splitBreaks"),Bmt=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),mTe=w(t=>t.replace(s3,"#br#"),"breakToPlaceholder"),zN=w(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),Fmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),zmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),kp=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Vmt=w((t,e)=>{const r=BH(t,"~"),n=BH(e,"~");return r===1&&n===1},"shouldCombineSets"),Hmt=w(t=>{const e=BH(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),s=n.lastIndexOf("~");for(;i!==-1&&s!==-1&&i!==s;)n[i]="<",n[s]=">",i=n.indexOf("~"),s=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),rle=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),FH=/\$\$(.*?)\$\$/g,Ks=w(t=>{var e;return(((e=t.match(FH))==null?void 0:e.length)??0)>0},"hasKatex"),KE=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await VN(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),Gmt=w(async(t,e)=>{if(!Ks(t))return t;if(!(rle()||e.legacyMathML||e.forceLegacyMathML))return t.replace(FH,"MathML is unsupported in this environment.");{const{default:r}=await Rr(async()=>{const{default:i}=await Promise.resolve().then(()=>Lzt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!rle()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(s3).map(i=>Ks(i)?`
${i}
`:`
${i}
`).join("").replace(FH,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),VN=w(async(t,e)=>Ln(await Gmt(t,e),e),"renderKatexSanitized"),Vt={getRows:Nmt,sanitizeText:Ln,sanitizeTextOrArray:Omt,hasBreaks:Pmt,splitBreaks:$mt,lineBreakRegex:s3,removeScript:gTe,getUrl:zN,evaluate:Gd,getMax:Fmt,getMin:zmt},Wmt=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),qmt=w(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Fs=w(function(t,e,r,n){const i=qmt(e,r,n);Wmt(t,i)},"configureSvgSize"),a3=w(function(t,e,r,n){const i=e.node().getBBox(),s=i.width,a=i.height;de.info(`SVG bounds: ${s}x${a}`,i);let o=0,l=0;de.info(`Graph bounds: ${o}x${l}`,t),o=s+r*2,l=a+r*2,de.info(`Calculated bounds: ${o}x${l}`),Fs(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),SM={};function zH(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}w(zH,"cssStyleSheetToString");var Umt=w((t,e,r,n)=>{let i="";return t in SM&&SM[t]?i=SM[t]({...r,svgId:n}):de.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -1058,49 +1058,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),Vmt=w((t,e)=>{e!==void 0&&(wM[t]=e)},"addStylesForDiagram"),Hmt=zmt,xK={};ON(xK,{clear:()=>Ri,getAccDescription:()=>ns,getAccTitle:()=>ts,getDiagramTitle:()=>qi,setAccDescription:()=>rs,setAccTitle:()=>Hi,setDiagramTitle:()=>Ji});var wK="",TK="",CK="",kK=w(t=>Ln(t,vr()),"sanitizeText"),Ri=w(()=>{wK="",CK="",TK=""},"clear"),Hi=w(t=>{wK=kK(t).replace(/^\s+/g,"")},"setAccTitle"),ts=w(()=>wK,"getAccTitle"),rs=w(t=>{CK=kK(t).replace(/\n\s+/g,` -`)},"setAccDescription"),ns=w(()=>CK,"getAccDescription"),Ji=w(t=>{TK=kK(t)},"setDiagramTitle"),qi=w(()=>TK,"getDiagramTitle"),Joe=de,Gmt=mK,Ve=vr,$H=tTe,hTe=JT,SK=w(t=>Ln(t,Ve()),"sanitizeText"),EK=n3,Wmt=w(()=>xK,"getCommonDb"),A9={},M9=w((t,e,r)=>{var n;A9[t]&&Joe.warn(`Diagram with id ${t} already registered. Overwriting.`),A9[t]=e,r&&oTe(t,r),Vmt(t,e.styles),(n=e.injectUtils)==null||n.call(e,Joe,Gmt,Ve,SK,EK,Wmt(),()=>{})},"registerDiagram"),BH=w(t=>{if(t in A9)return A9[t];throw new qmt(t)},"getDiagram"),ax,qmt=(ax=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(ax,"DiagramNotFoundError"),ax);function TM(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Umt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function AK(t){let e,r,n;t.length!==2?(e=TM,r=(o,l)=>TM(t(o),l),n=(o,l)=>t(o)-l):(e=t===TM||t===Umt?t:Ymt,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Ymt(){return 0}function jmt(t){return t===null?NaN:+t}const Xmt=AK(TM),Kmt=Xmt.right;AK(jmt).center;class ele extends Map{constructor(e,r=Jmt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(tle(this,e))}has(e){return super.has(tle(this,e))}set(e,r){return super.set(Zmt(this,e),r)}delete(e){return super.delete(Qmt(this,e))}}function tle({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Zmt({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Qmt({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(r),t.delete(n)),r}function Jmt(t){return t!==null&&typeof t=="object"?t.valueOf():t}const e1t=Math.sqrt(50),t1t=Math.sqrt(10),r1t=Math.sqrt(2);function R9(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),a=s>=e1t?10:s>=t1t?5:s>=r1t?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=s-i+1,l=new Array(o);if(n)if(a<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function s1t(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function a1t(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,s=new Array(i);++n+t(e)}function h1t(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function d1t(){return!this.__axis}function dTe(t,e){var r=[],n=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===CM||t===CA?-1:1,h=t===CA||t===I$?"x":"y",d=t===CM||t===VH?l1t:c1t;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):o1t),y=Math.max(s,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,T=(e.bandwidth?h1t:u1t)(e.copy(),l),C=p.selection?p.selection():p,S=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),E=k.exit(),A=k.enter().append("g").attr("class","tick"),R=k.select("line"),_=k.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(h+"2",u*s)),_=_.merge(A.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===CM?"0em":t===VH?"0.71em":"0.32em")),p!==C&&(S=S.transition(p),k=k.transition(p),R=R.transition(p),_=_.transition(p),E=E.transition(p).attr("opacity",rle).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",rle).attr("transform",function(P){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(P))?N:T(P))+l)})),E.remove(),S.attr("d",t===CA||t===I$?a?"M"+u*a+","+x+"H"+l+"V"+b+"H"+u*a:"M"+l+","+x+"V"+b:a?"M"+x+","+u*a+"V"+l+"H"+b+"V"+u*a:"M"+x+","+l+"H"+b),k.attr("opacity",1).attr("transform",function(P){return d(T(P)+l)}),R.attr(h+"2",u*s),_.attr(h,u*y).text(m),C.filter(d1t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===I$?"start":t===CA?"end":"middle"),C.each(function(){this.__axis=T})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(s=a=+p,f):s},f.tickSizeInner=function(p){return arguments.length?(s=+p,f):s},f.tickSizeOuter=function(p){return arguments.length?(a=+p,f):a},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function f1t(t){return dTe(CM,t)}function p1t(t){return dTe(VH,t)}var g1t={value:()=>{}};function fTe(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}kM.prototype=fTe.prototype={constructor:kM,on:function(t,e){var r=this._,n=m1t(t+"",r),i,s=-1,a=n.length;if(arguments.length<2){for(;++s0)for(var r=new Array(i),n=0,i,s;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),ile.hasOwnProperty(e)?{space:ile[e],local:t}:t}function v1t(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===HH&&e.documentElement.namespaceURI===HH?e.createElement(t):e.createElementNS(r,t)}}function b1t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pTe(t){var e=FN(t);return(e.local?b1t:v1t)(e)}function x1t(){}function MK(t){return t==null?x1t:function(){return this.querySelector(t)}}function w1t(t){typeof t!="function"&&(t=MK(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(C=y[b])&&++b=0;)(a=n[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function U1t(t){t||(t=Y1t);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),s=0;se?1:t>=e?0:NaN}function j1t(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function X1t(){return Array.from(this)}function K1t(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?oyt:typeof e=="function"?cyt:lyt)(t,e,r??"")):e5(this.node(),t)}function e5(t,e){return t.style.getPropertyValue(e)||bTe(t).getComputedStyle(t,null).getPropertyValue(e)}function hyt(t){return function(){delete this[t]}}function dyt(t,e){return function(){this[t]=e}}function fyt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function pyt(t,e){return arguments.length>1?this.each((e==null?hyt:typeof e=="function"?fyt:dyt)(t,e)):this.node()[t]}function xTe(t){return t.trim().split(/^|\s+/)}function RK(t){return t.classList||new wTe(t)}function wTe(t){this._node=t,this._names=xTe(t.getAttribute("class")||"")}wTe.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function TTe(t,e){for(var r=RK(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Hyt(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,s;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?kA(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?kA(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Zyt.exec(t))?new zo(e[1],e[2],e[3],1):(e=Qyt.exec(t))?new zo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Jyt.exec(t))?kA(e[1],e[2],e[3],e[4]):(e=evt.exec(t))?kA(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tvt.exec(t))?hle(e[1],e[2]/100,e[3]/100,1):(e=rvt.exec(t))?hle(e[1],e[2]/100,e[3]/100,e[4]):sle.hasOwnProperty(t)?lle(sle[t]):t==="transparent"?new zo(NaN,NaN,NaN,0):null}function lle(t){return new zo(t>>16&255,t>>8&255,t&255,1)}function kA(t,e,r,n){return n<=0&&(t=e=r=NaN),new zo(t,e,r,n)}function ETe(t){return t instanceof Uy||(t=yy(t)),t?(t=t.rgb(),new zo(t.r,t.g,t.b,t.opacity)):new zo}function GH(t,e,r,n){return arguments.length===1?ETe(t):new zo(t,e,r,n??1)}function zo(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}XE(zo,GH,zN(Uy,{brighter(t){return t=t==null?L9:Math.pow(L9,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?o6:Math.pow(o6,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zo(Z1(this.r),Z1(this.g),Z1(this.b),I9(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cle,formatHex:cle,formatHex8:svt,formatRgb:ule,toString:ule}));function cle(){return`#${I1(this.r)}${I1(this.g)}${I1(this.b)}`}function svt(){return`#${I1(this.r)}${I1(this.g)}${I1(this.b)}${I1((isNaN(this.opacity)?1:this.opacity)*255)}`}function ule(){const t=I9(this.opacity);return`${t===1?"rgb(":"rgba("}${Z1(this.r)}, ${Z1(this.g)}, ${Z1(this.b)}${t===1?")":`, ${t})`}`}function I9(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Z1(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function I1(t){return t=Z1(t),(t<16?"0":"")+t.toString(16)}function hle(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new ih(t,e,r,n)}function ATe(t){if(t instanceof ih)return new ih(t.h,t.s,t.l,t.opacity);if(t instanceof Uy||(t=yy(t)),!t)return new ih;if(t instanceof ih)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),s=Math.max(e,r,n),a=NaN,o=s-i,l=(s+i)/2;return o?(e===s?a=(r-n)/o+(r0&&l<1?0:a,new ih(a,o,l,t.opacity)}function avt(t,e,r,n){return arguments.length===1?ATe(t):new ih(t,e,r,n??1)}function ih(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}XE(ih,avt,zN(Uy,{brighter(t){return t=t==null?L9:Math.pow(L9,t),new ih(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?o6:Math.pow(o6,t),new ih(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new zo(N$(t>=240?t-240:t+120,i,n),N$(t,i,n),N$(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new ih(dle(this.h),SA(this.s),SA(this.l),I9(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=I9(this.opacity);return`${t===1?"hsl(":"hsla("}${dle(this.h)}, ${SA(this.s)*100}%, ${SA(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dle(t){return t=(t||0)%360,t<0?t+360:t}function SA(t){return Math.max(0,Math.min(1,t||0))}function N$(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const ovt=Math.PI/180,lvt=180/Math.PI,N9=18,MTe=.96422,RTe=1,_Te=.82521,LTe=4/29,Ab=6/29,ITe=3*Ab*Ab,cvt=Ab*Ab*Ab;function NTe(t){if(t instanceof Td)return new Td(t.l,t.a,t.b,t.opacity);if(t instanceof $f)return DTe(t);t instanceof zo||(t=ETe(t));var e=$$(t.r),r=$$(t.g),n=$$(t.b),i=D$((.2225045*e+.7168786*r+.0606169*n)/RTe),s,a;return e===r&&r===n?s=a=i:(s=D$((.4360747*e+.3850649*r+.1430804*n)/MTe),a=D$((.0139322*e+.0971045*r+.7141733*n)/_Te)),new Td(116*i-16,500*(s-i),200*(i-a),t.opacity)}function uvt(t,e,r,n){return arguments.length===1?NTe(t):new Td(t,e,r,n??1)}function Td(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}XE(Td,uvt,zN(Uy,{brighter(t){return new Td(this.l+N9*(t??1),this.a,this.b,this.opacity)},darker(t){return new Td(this.l-N9*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=MTe*O$(e),t=RTe*O$(t),r=_Te*O$(r),new zo(P$(3.1338561*e-1.6168667*t-.4906146*r),P$(-.9787684*e+1.9161415*t+.033454*r),P$(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function D$(t){return t>cvt?Math.pow(t,1/3):t/ITe+LTe}function O$(t){return t>Ab?t*t*t:ITe*(t-LTe)}function P$(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $$(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hvt(t){if(t instanceof $f)return new $f(t.h,t.c,t.l,t.opacity);if(t instanceof Td||(t=NTe(t)),t.a===0&&t.b===0)return new $f(NaN,0()=>t;function OTe(t,e){return function(r){return t+r*e}}function dvt(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function fvt(t,e){var r=e-t;return r?OTe(t,r>180||r<-180?r-360*Math.round(r/360):r):VN(isNaN(t)?e:t)}function pvt(t){return(t=+t)==1?Uk:function(e,r){return r-e?dvt(e,r,t):VN(isNaN(e)?r:e)}}function Uk(t,e){var r=e-t;return r?OTe(t,r):VN(isNaN(t)?e:t)}const D9=(function t(e){var r=pvt(e);function n(i,s){var a=r((i=GH(i)).r,(s=GH(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),u=Uk(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function gvt(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(s){for(i=0;ir&&(s=e.slice(r,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Zu(n,i)})),r=B$.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Zu(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Zu(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Zu(u,d)},{i:m-2,x:Zu(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),s(u.translateX,u.translateY,h.translateX,h.translateY,d,f),a(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--t5}function ple(){vy=(P9=c6.now())+HN,t5=HC=0;try{_vt()}finally{t5=0,Ivt(),vy=0}}function Lvt(){var t=c6.now(),e=t-P9;e>FTe&&(HN-=e,P9=t)}function Ivt(){for(var t,e=O9,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:O9=r);GC=t,YH(n)}function YH(t){if(!t5){HC&&(HC=clearTimeout(HC));var e=t-vy;e>24?(t<1/0&&(HC=setTimeout(ple,t-c6.now()-HN)),q3&&(q3=clearInterval(q3))):(q3||(P9=c6.now(),q3=setInterval(Lvt,FTe)),t5=1,zTe(ple))}}function gle(t,e,r){var n=new $9;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Nvt=fTe("start","end","cancel","interrupt"),Dvt=[],HTe=0,mle=1,jH=2,SM=3,yle=4,XH=5,EM=6;function GN(t,e,r,n,i,s){var a=t.__transition;if(!a)t.__transition={};else if(r in a)return;Ovt(t,r,{name:e,index:n,group:i,on:Nvt,tween:Dvt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:HTe})}function IK(t,e){var r=Ih(t,e);if(r.state>HTe)throw new Error("too late; already scheduled");return r}function Vd(t,e){var r=Ih(t,e);if(r.state>SM)throw new Error("too late; already running");return r}function Ih(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Ovt(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=VTe(s,0,r.time);function s(u){r.state=mle,r.timer.restart(a,r.delay,r.time),r.delay<=u&&a(u-r.delay)}function a(u){var h,d,f,p;if(r.state!==mle)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===SM)return gle(a);p.state===yle?(p.state=EM,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hjH&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function d2t(t,e,r){var n,i,s=h2t(e)?IK:Vd;return function(){var a=s(this,t),o=a.on;o!==n&&(i=(n=o).copy()).on(e,r),a.on=i}}function f2t(t,e){var r=this._id;return arguments.length<2?Ih(this.node(),r).on.on(t):this.each(d2t(r,t,e))}function p2t(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function g2t(){return this.on("end.remove",p2t(this._id))}function m2t(t){var e=this._name,r=this._id;typeof t!="function"&&(t=MK(t));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a=0))throw new Error(`invalid digits: ${t}`);if(e>15)return UTe;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;iGm)if(!(Math.abs(d*l-u*h)>Gm)||!s)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-a,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),x=Math.sqrt(f),b=s*Math.tan((KH-Math.acos((m+f-y)/(2*v*x)))/2),T=b/x,C=b/v;Math.abs(T-1)>Gm&&this._append`L${e+T*h},${r+T*d}`,this._append`A${s},${s},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,s,a){if(e=+e,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Gm||Math.abs(this._y1-h)>Gm)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%ZH+ZH),f>V2t?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Gm&&this._append`A${n},${n},0,${+(f>=KH)},${d},${this._x1=e+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function W2t(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function B9(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r5(t){return t=B9(Math.abs(t)),t?t[1]:NaN}function q2t(t,e){return function(r,n){for(var i=r.length,s=[],a=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[a=(a+1)%t.length];return s.reverse().join(e)}}function U2t(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var Y2t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function F9(t){if(!(e=Y2t.exec(t)))throw new Error("invalid format: "+t);var e;return new DK({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}F9.prototype=DK.prototype;function DK(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}DK.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 j2t(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var z9;function X2t(t,e){var r=B9(t,e);if(!r)return z9=void 0,t.toPrecision(e);var n=r[0],i=r[1],s=i-(z9=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+B9(t,Math.max(0,e+s-1))[0]}function vle(t,e){var r=B9(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const ble={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:W2t,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>vle(t*100,e),r:vle,s:X2t,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function xle(t){return t}var wle=Array.prototype.map,Tle=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function K2t(t){var e=t.grouping===void 0||t.thousands===void 0?xle:q2t(wle.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?xle:U2t(wle.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=F9(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,T=d.precision,C=d.trim,S=d.type;S==="n"?(b=!0,S="g"):ble[S]||(T===void 0&&(T=12),C=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(S)?a:"")+(f&&f.suffix!==void 0?f.suffix:""),A=ble[S],R=/[defgprs%]/.test(S);T=T===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function _(P){var N=k,L=E,I,$,O;if(S==="c")L=A(P)+L,P="";else{P=+P;var D=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),T),C&&(P=j2t(P)),D&&+P==0&&m!=="+"&&(D=!1),N=(D?m==="("?m:o:m==="-"||m==="("?"":m)+N,L=(S==="s"&&!isNaN(P)&&z9!==void 0?Tle[8+z9/3]:"")+L+(D&&m==="("?")":""),R){for(I=-1,$=P.length;++I<$;)if(O=P.charCodeAt(I),48>O||O>57){L=(O===46?i+P.slice(I+1):P.slice(I))+L,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=N.length+P.length+L.length,z=F>1)+N+P+L+z.slice(F);break;default:P=z+N+P+L;break}return s(P)}return _.toString=function(){return d+""},_}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(r5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=F9(d),d.type="f",d),{suffix:Tle[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var AA,a1,YTe;Z2t({thousands:",",grouping:[3],currency:["$",""]});function Z2t(t){return AA=K2t(t),a1=AA.format,YTe=AA.formatPrefix,AA}function Q2t(t){return Math.max(0,-r5(Math.abs(t)))}function J2t(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(r5(e)/3)))*3-r5(Math.abs(t)))}function ebt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r5(e)-r5(t))+1}function tbt(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function rbt(){return this.eachAfter(tbt)}function nbt(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function ibt(t,e){for(var r=this,n=[r],i,s,a=-1;r=n.pop();)if(t.call(e,r,++a,this),i=r.children)for(s=i.length-1;s>=0;--s)n.push(i[s]);return this}function sbt(t,e){for(var r=this,n=[r],i=[],s,a,o,l=-1;r=n.pop();)if(i.push(r),s=r.children)for(a=0,o=s.length;a=0;)r+=n[i].value;e.value=r})}function lbt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function cbt(t){for(var e=this,r=ubt(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function ubt(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function hbt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function dbt(){return Array.from(this)}function fbt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function pbt(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*gbt(){var t=this,e,r=[t],n,i,s;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,s=n.length;i=0;--o)i.push(s=a[o]=new V9(a[o])),s.parent=n,s.depth=n.depth+1;return r.eachBefore(xbt)}function mbt(){return OK(this).eachBefore(bbt)}function ybt(t){return t.children}function vbt(t){return Array.isArray(t)?t[1]:null}function bbt(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function xbt(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function V9(t){this.data=t,this.depth=this.height=0,this.parent=null}V9.prototype=OK.prototype={constructor:V9,count:rbt,each:nbt,eachAfter:sbt,eachBefore:ibt,find:abt,sum:obt,sort:lbt,path:cbt,ancestors:hbt,descendants:dbt,leaves:fbt,links:pbt,copy:mbt,[Symbol.iterator]:gbt};function wbt(t){if(typeof t!="function")throw new Error;return t}function U3(){return 0}function Y3(t){return function(){return t}}function Tbt(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 Cbt(t,e,r,n,i){for(var s=t.children,a,o=-1,l=s.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),S=y*y*C,b=Math.max(x/S,S/v),b>T){y-=u;break}T=b}a.push(l={value:y,dice:p1?n:1)},r})(Sbt);function Mbt(){var t=Abt,e=!1,r=1,n=1,i=[0],s=U3,a=U3,o=U3,l=U3,u=U3;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(Tbt),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function Ibt(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i2?Nbt:Ibt,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?s:(l||(l=o(t.map(n),e,r)))(n(a(f)))}return d.invert=function(f){return a(i((u||(u=o(e,t.map(n),Zu)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,_bt),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=Tvt,h()},d.clamp=function(f){return arguments.length?(a=f?!0:X2,h()):a!==X2},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,p){return n=f,i=p,h()}}function XTe(){return Dbt()(X2,X2)}function Obt(t,e,r,n){var i=zH(t,e,r),s;switch(n=F9(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=J2t(i,a))&&(n.precision=s),YTe(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=ebt(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=Q2t(i))&&(n.precision=s-(n.type==="%")*2);break}}return a1(n)}function Pbt(t){var e=t.domain;return t.ticks=function(r){var n=e();return n1t(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return Obt(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,s=n.length-1,a=n[i],o=n[s],l,u,h=10;for(o0;){if(u=FH(a,o,r),u===l)return n[i]=a,n[s]=o,e(n);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function n5(){var t=XTe();return t.copy=function(){return jTe(t,n5())},WN.apply(t,arguments),Pbt(t)}function $bt(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],s=t[n],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s0))return l;let u;do l.push(u=new Date(+s)),e(s,o),t(s);while(uIa(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;e(a,-1),!s(a););else for(;--o>=0;)for(;e(a,1),!s(a););}),r&&(i.count=(s,a)=>(F$.setTime(+s),z$.setTime(+a),t(F$),t(z$),Math.floor(r(F$,z$))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?a=>n(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const i5=Ia(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);i5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ia(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):i5);i5.range;const Bf=1e3,gu=Bf*60,Ff=gu*60,c0=Ff*24,PK=c0*7,Sle=c0*30,V$=c0*365,Pp=Ia(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Bf)},(t,e)=>(e-t)/Bf,t=>t.getUTCSeconds());Pp.range;const u6=Ia(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Bf)},(t,e)=>{t.setTime(+t+e*gu)},(t,e)=>(e-t)/gu,t=>t.getMinutes());u6.range;const Bbt=Ia(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*gu)},(t,e)=>(e-t)/gu,t=>t.getUTCMinutes());Bbt.range;const h6=Ia(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Bf-t.getMinutes()*gu)},(t,e)=>{t.setTime(+t+e*Ff)},(t,e)=>(e-t)/Ff,t=>t.getHours());h6.range;const Fbt=Ia(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ff)},(t,e)=>(e-t)/Ff,t=>t.getUTCHours());Fbt.range;const by=Ia(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*gu)/c0,t=>t.getDate()-1);by.range;const $K=Ia(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/c0,t=>t.getUTCDate()-1);$K.range;const zbt=Ia(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/c0,t=>Math.floor(t/c0));zbt.range;function Yy(t){return Ia(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*gu)/PK)}const KE=Yy(0),d6=Yy(1),KTe=Yy(2),ZTe=Yy(3),xy=Yy(4),QTe=Yy(5),JTe=Yy(6);KE.range;d6.range;KTe.range;ZTe.range;xy.range;QTe.range;JTe.range;function jy(t){return Ia(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/PK)}const e5e=jy(0),H9=jy(1),Vbt=jy(2),Hbt=jy(3),s5=jy(4),Gbt=jy(5),Wbt=jy(6);e5e.range;H9.range;Vbt.range;Hbt.range;s5.range;Gbt.range;Wbt.range;const f6=Ia(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());f6.range;const qbt=Ia(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());qbt.range;const u0=Ia(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());u0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ia(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});u0.range;const wy=Ia(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wy.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ia(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});wy.range;function Ubt(t,e,r,n,i,s){const a=[[Pp,1,Bf],[Pp,5,5*Bf],[Pp,15,15*Bf],[Pp,30,30*Bf],[s,1,gu],[s,5,5*gu],[s,15,15*gu],[s,30,30*gu],[i,1,Ff],[i,3,3*Ff],[i,6,6*Ff],[i,12,12*Ff],[n,1,c0],[n,2,2*c0],[r,1,PK],[e,1,Sle],[e,3,3*Sle],[t,1,V$]];function o(u,h,d){const f=hy).right(a,f);if(p===a.length)return t.every(zH(u/V$,h/V$,d));if(p===0)return i5.every(Math.max(zH(u,h,d),1));const[g,m]=a[f/a[p-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(te=G$(j3(ie.y,0,1)),_e=te.getUTCDay(),te=_e>4||_e===0?H9.ceil(te):H9(te),te=$K.offset(te,(ie.V-1)*7),ie.y=te.getUTCFullYear(),ie.m=te.getUTCMonth(),ie.d=te.getUTCDate()+(ie.w+6)%7):(te=H$(j3(ie.y,0,1)),_e=te.getDay(),te=_e>4||_e===0?d6.ceil(te):d6(te),te=by.offset(te,(ie.V-1)*7),ie.y=te.getFullYear(),ie.m=te.getMonth(),ie.d=te.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),_e="Z"in ie?G$(j3(ie.y,0,1)).getUTCDay():H$(j3(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(_e+5)%7:ie.w+ie.U*7-(_e+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,G$(ie)):H$(ie)}}function E(Q,Z,re,ie){for(var me=0,te=Z.length,_e=re.length,$e,Fe;me=_e)return-1;if($e=Z.charCodeAt(me++),$e===37){if($e=Z.charAt(me++),Fe=C[$e in Ele?Z.charAt(me++):$e],!Fe||(ie=Fe(Q,re,ie))<0)return-1}else if($e!=re.charCodeAt(ie++))return-1}return ie}function A(Q,Z,re){var ie=u.exec(Z.slice(re));return ie?(Q.p=h.get(ie[0].toLowerCase()),re+ie[0].length):-1}function R(Q,Z,re){var ie=p.exec(Z.slice(re));return ie?(Q.w=g.get(ie[0].toLowerCase()),re+ie[0].length):-1}function _(Q,Z,re){var ie=d.exec(Z.slice(re));return ie?(Q.w=f.get(ie[0].toLowerCase()),re+ie[0].length):-1}function P(Q,Z,re){var ie=v.exec(Z.slice(re));return ie?(Q.m=x.get(ie[0].toLowerCase()),re+ie[0].length):-1}function N(Q,Z,re){var ie=m.exec(Z.slice(re));return ie?(Q.m=y.get(ie[0].toLowerCase()),re+ie[0].length):-1}function L(Q,Z,re){return E(Q,e,Z,re)}function I(Q,Z,re){return E(Q,r,Z,re)}function $(Q,Z,re){return E(Q,n,Z,re)}function O(Q){return a[Q.getDay()]}function D(Q){return s[Q.getDay()]}function F(Q){return l[Q.getMonth()]}function z(Q){return o[Q.getMonth()]}function V(Q){return i[+(Q.getHours()>=12)]}function B(Q){return 1+~~(Q.getMonth()/3)}function H(Q){return a[Q.getUTCDay()]}function G(Q){return s[Q.getUTCDay()]}function W(Q){return l[Q.getUTCMonth()]}function K(Q){return o[Q.getUTCMonth()]}function q(Q){return i[+(Q.getUTCHours()>=12)]}function oe(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var Z=S(Q+="",b);return Z.toString=function(){return Q},Z},parse:function(Q){var Z=k(Q+="",!1);return Z.toString=function(){return Q},Z},utcFormat:function(Q){var Z=S(Q+="",T);return Z.toString=function(){return Q},Z},utcParse:function(Q){var Z=k(Q+="",!0);return Z.toString=function(){return Q},Z}}}var Ele={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,Kbt=/^%/,Zbt=/[\\^$*+?|[\]().{}]/g;function ni(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s[e.toLowerCase(),r]))}function Jbt(t,e,r){var n=eo.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function ext(t,e,r){var n=eo.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function txt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function rxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function nxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Ale(t,e,r){var n=eo.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Mle(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ixt(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function sxt(t,e,r){var n=eo.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function axt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Rle(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function oxt(t,e,r){var n=eo.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function _le(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function lxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function cxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function uxt(t,e,r){var n=eo.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function hxt(t,e,r){var n=eo.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function dxt(t,e,r){var n=Kbt.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function fxt(t,e,r){var n=eo.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function pxt(t,e,r){var n=eo.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Lle(t,e){return ni(t.getDate(),e,2)}function gxt(t,e){return ni(t.getHours(),e,2)}function mxt(t,e){return ni(t.getHours()%12||12,e,2)}function yxt(t,e){return ni(1+by.count(u0(t),t),e,3)}function t5e(t,e){return ni(t.getMilliseconds(),e,3)}function vxt(t,e){return t5e(t,e)+"000"}function bxt(t,e){return ni(t.getMonth()+1,e,2)}function xxt(t,e){return ni(t.getMinutes(),e,2)}function wxt(t,e){return ni(t.getSeconds(),e,2)}function Txt(t){var e=t.getDay();return e===0?7:e}function Cxt(t,e){return ni(KE.count(u0(t)-1,t),e,2)}function r5e(t){var e=t.getDay();return e>=4||e===0?xy(t):xy.ceil(t)}function kxt(t,e){return t=r5e(t),ni(xy.count(u0(t),t)+(u0(t).getDay()===4),e,2)}function Sxt(t){return t.getDay()}function Ext(t,e){return ni(d6.count(u0(t)-1,t),e,2)}function Axt(t,e){return ni(t.getFullYear()%100,e,2)}function Mxt(t,e){return t=r5e(t),ni(t.getFullYear()%100,e,2)}function Rxt(t,e){return ni(t.getFullYear()%1e4,e,4)}function _xt(t,e){var r=t.getDay();return t=r>=4||r===0?xy(t):xy.ceil(t),ni(t.getFullYear()%1e4,e,4)}function Lxt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ni(e/60|0,"0",2)+ni(e%60,"0",2)}function Ile(t,e){return ni(t.getUTCDate(),e,2)}function Ixt(t,e){return ni(t.getUTCHours(),e,2)}function Nxt(t,e){return ni(t.getUTCHours()%12||12,e,2)}function Dxt(t,e){return ni(1+$K.count(wy(t),t),e,3)}function n5e(t,e){return ni(t.getUTCMilliseconds(),e,3)}function Oxt(t,e){return n5e(t,e)+"000"}function Pxt(t,e){return ni(t.getUTCMonth()+1,e,2)}function $xt(t,e){return ni(t.getUTCMinutes(),e,2)}function Bxt(t,e){return ni(t.getUTCSeconds(),e,2)}function Fxt(t){var e=t.getUTCDay();return e===0?7:e}function zxt(t,e){return ni(e5e.count(wy(t)-1,t),e,2)}function i5e(t){var e=t.getUTCDay();return e>=4||e===0?s5(t):s5.ceil(t)}function Vxt(t,e){return t=i5e(t),ni(s5.count(wy(t),t)+(wy(t).getUTCDay()===4),e,2)}function Hxt(t){return t.getUTCDay()}function Gxt(t,e){return ni(H9.count(wy(t)-1,t),e,2)}function Wxt(t,e){return ni(t.getUTCFullYear()%100,e,2)}function qxt(t,e){return t=i5e(t),ni(t.getUTCFullYear()%100,e,2)}function Uxt(t,e){return ni(t.getUTCFullYear()%1e4,e,4)}function Yxt(t,e){var r=t.getUTCDay();return t=r>=4||r===0?s5(t):s5.ceil(t),ni(t.getUTCFullYear()%1e4,e,4)}function jxt(){return"+0000"}function Nle(){return"%"}function Dle(t){return+t}function Ole(t){return Math.floor(+t/1e3)}var $v,G9;Xxt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Xxt(t){return $v=Xbt(t),G9=$v.format,$v.parse,$v.utcFormat,$v.utcParse,$v}function Kxt(t){return new Date(t)}function Zxt(t){return t instanceof Date?+t:+new Date(+t)}function s5e(t,e,r,n,i,s,a,o,l,u){var h=XTe(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),T=u("%Y");function C(S){return(l(S)1?0:t<-1?p6:Math.acos(t)}function $le(t){return t>=1?W9:t<=-1?-W9:Math.asin(t)}function a5e(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new G2t(e)}function n4t(t){return t.innerRadius}function i4t(t){return t.outerRadius}function s4t(t){return t.startAngle}function a4t(t){return t.endAngle}function o4t(t){return t&&t.padAngle}function l4t(t,e,r,n,i,s,a,o){var l=r-t,u=n-e,h=a-i,d=o-s,f=d*l-h*u;if(!(f*fL*L+I*I&&(E=R,A=_),{cx:E,cy:A,x01:-h,y01:-d,x11:E*(i/C-1),y11:A*(i/C-1)}}function a5(){var t=n4t,e=i4t,r=Gs(0),n=null,i=s4t,s=a4t,a=o4t,o=null,l=a5e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-W9,m=s.apply(this,arguments)-W9,y=Ple(m-g),v=m>g;if(o||(o=h=l()),pOo))o.moveTo(0,0);else if(y>AM-Oo)o.moveTo(p*Tm(g),p*$h(g)),o.arc(0,0,p,g,m,!v),f>Oo&&(o.moveTo(f*Tm(m),f*$h(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,T=g,C=m,S=y,k=y,E=a.apply(this,arguments)/2,A=E>Oo&&(n?+n.apply(this,arguments):K2(f*f+p*p)),R=W$(Ple(p-f)/2,+r.apply(this,arguments)),_=R,P=R,N,L;if(A>Oo){var I=$le(A/f*$h(E)),$=$le(A/p*$h(E));(S-=I*2)>Oo?(I*=v?1:-1,T+=I,C-=I):(S=0,T=C=(g+m)/2),(k-=$*2)>Oo?($*=v?1:-1,x+=$,b-=$):(k=0,x=b=(g+m)/2)}var O=p*Tm(x),D=p*$h(x),F=f*Tm(C),z=f*$h(C);if(R>Oo){var V=p*Tm(b),B=p*$h(b),H=f*Tm(T),G=f*$h(T),W;if(yOo?P>Oo?(N=MA(H,G,O,D,p,P,v),L=MA(V,B,F,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),POo)||!(S>Oo)?o.lineTo(F,z):_>Oo?(N=MA(F,z,V,B,f,-_,v),L=MA(O,D,H,G,f,-_,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),_t?1:e>=t?0:NaN}function d4t(t){return t}function f4t(){var t=d4t,e=h4t,r=null,n=Gs(0),i=Gs(AM),s=Gs(0);function a(o){var l,u=(o=o5e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(AM,Math.max(-AM,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,s.apply(this,arguments)),b=x*(y<0?-1:1),T;for(l=0;l0&&(f+=T);for(e!=null?p.sort(function(C,S){return e(g[C],g[S])}):r!=null&&p.sort(function(C,S){return r(o[C],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?T*d:0)+b,g[h]={data:o[h],index:l,value:T,startAngle:m,endAngle:v,padAngle:x};return g}return a.value=function(o){return arguments.length?(t=typeof o=="function"?o:Gs(+o),a):t},a.sortValues=function(o){return arguments.length?(e=o,r=null,a):e},a.sort=function(o){return arguments.length?(r=o,e=null,a):r},a.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Gs(+o),a):n},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Gs(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Gs(+o),a):s},a}class c5e{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function u5e(t){return new c5e(t,!0)}function h5e(t){return new c5e(t,!1)}function fg(){}function q9(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function qN(t){this._context=t}qN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:q9(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:q9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function m6(t){return new qN(t)}function d5e(t){this._context=t}d5e.prototype={areaStart:fg,areaEnd:fg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:q9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function p4t(t){return new d5e(t)}function f5e(t){this._context=t}f5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:q9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function g4t(t){return new f5e(t)}function p5e(t,e){this._basis=new qN(t),this._beta=e}p5e.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],s=t[r]-n,a=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*s),this._beta*e[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const m4t=(function t(e){function r(n){return e===1?new qN(n):new p5e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function U9(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function BK(t,e){this._context=t,this._k=(1-e)/6}BK.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:U9(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:U9(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const g5e=(function t(e){function r(n){return new BK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function FK(t,e){this._context=t,this._k=(1-e)/6}FK.prototype={areaStart:fg,areaEnd:fg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:U9(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const y4t=(function t(e){function r(n){return new FK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function zK(t,e){this._context=t,this._k=(1-e)/6}zK.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:U9(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const v4t=(function t(e){function r(n){return new zK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function VK(t,e,r){var n=t._x1,i=t._y1,s=t._x2,a=t._y2;if(t._l01_a>Oo){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Oo){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*u+t._x1*t._l23_2a-e*t._l12_2a)/h,a=(a*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,s,a,t._x2,t._y2)}function m5e(t,e){this._context=t,this._alpha=e}m5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:VK(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const y5e=(function t(e){function r(n){return e?new m5e(n,e):new BK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function v5e(t,e){this._context=t,this._alpha=e}v5e.prototype={areaStart:fg,areaEnd:fg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:VK(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const b4t=(function t(e){function r(n){return e?new v5e(n,e):new FK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function b5e(t,e){this._context=t,this._alpha=e}b5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:VK(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const x4t=(function t(e){function r(n){return e?new b5e(n,e):new zK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function x5e(t){this._context=t}x5e.prototype={areaStart:fg,areaEnd:fg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function w4t(t){return new x5e(t)}function Ble(t){return t<0?-1:1}function Fle(t,e,r){var n=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(n||i<0&&-0),a=(r-t._y1)/(i||n<0&&-0),o=(s*i+a*n)/(n+i);return(Ble(s)+Ble(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function zle(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function q$(t,e,r){var n=t._x0,i=t._y0,s=t._x1,a=t._y1,o=(s-n)/3;t._context.bezierCurveTo(n+o,i+o*e,s-o,a-o*r,s,a)}function Y9(t){this._context=t}Y9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:q$(this,this._t0,zle(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,q$(this,zle(this,r=Fle(this,t,e)),r);break;default:q$(this,this._t0,r=Fle(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function w5e(t){this._context=new T5e(t)}(w5e.prototype=Object.create(Y9.prototype)).point=function(t,e){Y9.prototype.point.call(this,e,t)};function T5e(t){this._context=t}T5e.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,s){this._context.bezierCurveTo(e,t,n,r,s,i)}};function C5e(t){return new Y9(t)}function k5e(t){return new w5e(t)}function S5e(t){this._context=t}S5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=Vle(t),i=Vle(e),s=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/s[e];for(s[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function A5e(t){return new UN(t,.5)}function M5e(t){return new UN(t,0)}function R5e(t){return new UN(t,1)}function WC(t,e,r){this.k=t,this.x=e,this.y=r}WC.prototype={constructor:WC,scale:function(t){return t===1?this:new WC(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new WC(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};WC.prototype;var Xo=w(t=>{var i;const{securityLevel:e}=Ve();let r=wt("body");if(e==="sandbox"){const a=((i=wt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=wt(a.body)}return r.select(`#${t}`)},"selectSvgElement");function HK(t){return typeof t>"u"||t===null}w(HK,"isNothing");function _5e(t){return typeof t=="object"&&t!==null}w(_5e,"isObject");function L5e(t){return Array.isArray(t)?t:HK(t)?[]:[t]}w(L5e,"toArray");function I5e(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r{e!==void 0&&(SM[t]=e)},"addStylesForDiagram"),jmt=Umt,kK={};BN(kK,{clear:()=>Ri,getAccDescription:()=>ns,getAccTitle:()=>ts,getDiagramTitle:()=>qi,setAccDescription:()=>rs,setAccTitle:()=>Hi,setDiagramTitle:()=>Ji});var SK="",EK="",AK="",MK=w(t=>Ln(t,br()),"sanitizeText"),Ri=w(()=>{SK="",AK="",EK=""},"clear"),Hi=w(t=>{SK=MK(t).replace(/^\s+/g,"")},"setAccTitle"),ts=w(()=>SK,"getAccTitle"),rs=w(t=>{AK=MK(t).replace(/\n\s+/g,` +`)},"setAccDescription"),ns=w(()=>AK,"getAccDescription"),Ji=w(t=>{EK=MK(t)},"setDiagramTitle"),qi=w(()=>EK,"getDiagramTitle"),nle=de,Xmt=xK,Ve=br,VH=oTe,yTe=t5,RK=w(t=>Ln(t,Ve()),"sanitizeText"),_K=a3,Kmt=w(()=>kK,"getCommonDb"),L9={},I9=w((t,e,r)=>{var n;L9[t]&&nle.warn(`Diagram with id ${t} already registered. Overwriting.`),L9[t]=e,r&&fTe(t,r),Ymt(t,e.styles),(n=e.injectUtils)==null||n.call(e,nle,Xmt,Ve,RK,_K,Kmt(),()=>{})},"registerDiagram"),HH=w(t=>{if(t in L9)return L9[t];throw new Zmt(t)},"getDiagram"),lx,Zmt=(lx=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(lx,"DiagramNotFoundError"),lx);function EM(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Qmt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function LK(t){let e,r,n;t.length!==2?(e=EM,r=(o,l)=>EM(t(o),l),n=(o,l)=>t(o)-l):(e=t===EM||t===Qmt?t:Jmt,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Jmt(){return 0}function e1t(t){return t===null?NaN:+t}const t1t=LK(EM),r1t=t1t.right;LK(e1t).center;class ile extends Map{constructor(e,r=s1t){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(sle(this,e))}has(e){return super.has(sle(this,e))}set(e,r){return super.set(n1t(this,e),r)}delete(e){return super.delete(i1t(this,e))}}function sle({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function n1t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function i1t({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(r),t.delete(n)),r}function s1t(t){return t!==null&&typeof t=="object"?t.valueOf():t}const a1t=Math.sqrt(50),o1t=Math.sqrt(10),l1t=Math.sqrt(2);function N9(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),a=s>=a1t?10:s>=o1t?5:s>=l1t?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=s-i+1,l=new Array(o);if(n)if(a<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function h1t(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function d1t(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,s=new Array(i);++n+t(e)}function y1t(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function v1t(){return!this.__axis}function vTe(t,e){var r=[],n=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===AM||t===EA?-1:1,h=t===EA||t===O$?"x":"y",d=t===AM||t===qH?p1t:g1t;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):f1t),y=Math.max(s,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,T=(e.bandwidth?y1t:m1t)(e.copy(),l),C=p.selection?p.selection():p,S=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),E=k.exit(),A=k.enter().append("g").attr("class","tick"),R=k.select("line"),_=k.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(h+"2",u*s)),_=_.merge(A.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===AM?"0em":t===qH?"0.71em":"0.32em")),p!==C&&(S=S.transition(p),k=k.transition(p),R=R.transition(p),_=_.transition(p),E=E.transition(p).attr("opacity",ale).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",ale).attr("transform",function(P){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(P))?N:T(P))+l)})),E.remove(),S.attr("d",t===EA||t===O$?a?"M"+u*a+","+x+"H"+l+"V"+b+"H"+u*a:"M"+l+","+x+"V"+b:a?"M"+x+","+u*a+"V"+l+"H"+b+"V"+u*a:"M"+x+","+l+"H"+b),k.attr("opacity",1).attr("transform",function(P){return d(T(P)+l)}),R.attr(h+"2",u*s),_.attr(h,u*y).text(m),C.filter(v1t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===O$?"start":t===EA?"end":"middle"),C.each(function(){this.__axis=T})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(s=a=+p,f):s},f.tickSizeInner=function(p){return arguments.length?(s=+p,f):s},f.tickSizeOuter=function(p){return arguments.length?(a=+p,f):a},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function b1t(t){return vTe(AM,t)}function x1t(t){return vTe(qH,t)}var w1t={value:()=>{}};function bTe(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}MM.prototype=bTe.prototype={constructor:MM,on:function(t,e){var r=this._,n=T1t(t+"",r),i,s=-1,a=n.length;if(arguments.length<2){for(;++s0)for(var r=new Array(i),n=0,i,s;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),lle.hasOwnProperty(e)?{space:lle[e],local:t}:t}function k1t(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===UH&&e.documentElement.namespaceURI===UH?e.createElement(t):e.createElementNS(r,t)}}function S1t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function xTe(t){var e=HN(t);return(e.local?S1t:k1t)(e)}function E1t(){}function IK(t){return t==null?E1t:function(){return this.querySelector(t)}}function A1t(t){typeof t!="function"&&(t=IK(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(C=y[b])&&++b=0;)(a=n[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Q1t(t){t||(t=J1t);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),s=0;se?1:t>=e?0:NaN}function eyt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function tyt(){return Array.from(this)}function ryt(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?fyt:typeof e=="function"?gyt:pyt)(t,e,r??"")):r5(this.node(),t)}function r5(t,e){return t.style.getPropertyValue(e)||STe(t).getComputedStyle(t,null).getPropertyValue(e)}function yyt(t){return function(){delete this[t]}}function vyt(t,e){return function(){this[t]=e}}function byt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function xyt(t,e){return arguments.length>1?this.each((e==null?yyt:typeof e=="function"?byt:vyt)(t,e)):this.node()[t]}function ETe(t){return t.trim().split(/^|\s+/)}function NK(t){return t.classList||new ATe(t)}function ATe(t){this._node=t,this._names=ETe(t.getAttribute("class")||"")}ATe.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function MTe(t,e){for(var r=NK(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function jyt(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,s;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?AA(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?AA(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=nvt.exec(t))?new zo(e[1],e[2],e[3],1):(e=ivt.exec(t))?new zo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=svt.exec(t))?AA(e[1],e[2],e[3],e[4]):(e=avt.exec(t))?AA(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ovt.exec(t))?gle(e[1],e[2]/100,e[3]/100,1):(e=lvt.exec(t))?gle(e[1],e[2]/100,e[3]/100,e[4]):cle.hasOwnProperty(t)?dle(cle[t]):t==="transparent"?new zo(NaN,NaN,NaN,0):null}function dle(t){return new zo(t>>16&255,t>>8&255,t&255,1)}function AA(t,e,r,n){return n<=0&&(t=e=r=NaN),new zo(t,e,r,n)}function ITe(t){return t instanceof jy||(t=by(t)),t?(t=t.rgb(),new zo(t.r,t.g,t.b,t.opacity)):new zo}function YH(t,e,r,n){return arguments.length===1?ITe(t):new zo(t,e,r,n??1)}function zo(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}QE(zo,YH,GN(jy,{brighter(t){return t=t==null?O9:Math.pow(O9,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?u6:Math.pow(u6,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zo(J1(this.r),J1(this.g),J1(this.b),P9(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fle,formatHex:fle,formatHex8:hvt,formatRgb:ple,toString:ple}));function fle(){return`#${D1(this.r)}${D1(this.g)}${D1(this.b)}`}function hvt(){return`#${D1(this.r)}${D1(this.g)}${D1(this.b)}${D1((isNaN(this.opacity)?1:this.opacity)*255)}`}function ple(){const t=P9(this.opacity);return`${t===1?"rgb(":"rgba("}${J1(this.r)}, ${J1(this.g)}, ${J1(this.b)}${t===1?")":`, ${t})`}`}function P9(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function J1(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function D1(t){return t=J1(t),(t<16?"0":"")+t.toString(16)}function gle(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new oh(t,e,r,n)}function NTe(t){if(t instanceof oh)return new oh(t.h,t.s,t.l,t.opacity);if(t instanceof jy||(t=by(t)),!t)return new oh;if(t instanceof oh)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),s=Math.max(e,r,n),a=NaN,o=s-i,l=(s+i)/2;return o?(e===s?a=(r-n)/o+(r0&&l<1?0:a,new oh(a,o,l,t.opacity)}function dvt(t,e,r,n){return arguments.length===1?NTe(t):new oh(t,e,r,n??1)}function oh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}QE(oh,dvt,GN(jy,{brighter(t){return t=t==null?O9:Math.pow(O9,t),new oh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?u6:Math.pow(u6,t),new oh(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new zo(P$(t>=240?t-240:t+120,i,n),P$(t,i,n),P$(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new oh(mle(this.h),MA(this.s),MA(this.l),P9(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=P9(this.opacity);return`${t===1?"hsl(":"hsla("}${mle(this.h)}, ${MA(this.s)*100}%, ${MA(this.l)*100}%${t===1?")":`, ${t})`}`}}));function mle(t){return t=(t||0)%360,t<0?t+360:t}function MA(t){return Math.max(0,Math.min(1,t||0))}function P$(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const fvt=Math.PI/180,pvt=180/Math.PI,$9=18,DTe=.96422,OTe=1,PTe=.82521,$Te=4/29,Rb=6/29,BTe=3*Rb*Rb,gvt=Rb*Rb*Rb;function FTe(t){if(t instanceof Sd)return new Sd(t.l,t.a,t.b,t.opacity);if(t instanceof Vf)return zTe(t);t instanceof zo||(t=ITe(t));var e=z$(t.r),r=z$(t.g),n=z$(t.b),i=$$((.2225045*e+.7168786*r+.0606169*n)/OTe),s,a;return e===r&&r===n?s=a=i:(s=$$((.4360747*e+.3850649*r+.1430804*n)/DTe),a=$$((.0139322*e+.0971045*r+.7141733*n)/PTe)),new Sd(116*i-16,500*(s-i),200*(i-a),t.opacity)}function mvt(t,e,r,n){return arguments.length===1?FTe(t):new Sd(t,e,r,n??1)}function Sd(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}QE(Sd,mvt,GN(jy,{brighter(t){return new Sd(this.l+$9*(t??1),this.a,this.b,this.opacity)},darker(t){return new Sd(this.l-$9*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=DTe*B$(e),t=OTe*B$(t),r=PTe*B$(r),new zo(F$(3.1338561*e-1.6168667*t-.4906146*r),F$(-.9787684*e+1.9161415*t+.033454*r),F$(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function $$(t){return t>gvt?Math.pow(t,1/3):t/BTe+$Te}function B$(t){return t>Rb?t*t*t:BTe*(t-$Te)}function F$(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function z$(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yvt(t){if(t instanceof Vf)return new Vf(t.h,t.c,t.l,t.opacity);if(t instanceof Sd||(t=FTe(t)),t.a===0&&t.b===0)return new Vf(NaN,0()=>t;function VTe(t,e){return function(r){return t+r*e}}function vvt(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function bvt(t,e){var r=e-t;return r?VTe(t,r>180||r<-180?r-360*Math.round(r/360):r):WN(isNaN(t)?e:t)}function xvt(t){return(t=+t)==1?Xk:function(e,r){return r-e?vvt(e,r,t):WN(isNaN(e)?r:e)}}function Xk(t,e){var r=e-t;return r?VTe(t,r):WN(isNaN(t)?e:t)}const B9=(function t(e){var r=xvt(e);function n(i,s){var a=r((i=YH(i)).r,(s=YH(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),u=Xk(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function wvt(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(s){for(i=0;ir&&(s=e.slice(r,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:eh(n,i)})),r=V$.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:eh(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:eh(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:eh(u,d)},{i:m-2,x:eh(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),s(u.translateX,u.translateY,h.translateX,h.translateY,d,f),a(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g=0&&t._call.call(void 0,e),t=t._next;--n5}function vle(){xy=(z9=d6.now())+qN,n5=qC=0;try{Pvt()}finally{n5=0,Bvt(),xy=0}}function $vt(){var t=d6.now(),e=t-z9;e>qTe&&(qN-=e,z9=t)}function Bvt(){for(var t,e=F9,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:F9=r);UC=t,ZH(n)}function ZH(t){if(!n5){qC&&(qC=clearTimeout(qC));var e=t-xy;e>24?(t<1/0&&(qC=setTimeout(vle,t-d6.now()-qN)),j3&&(j3=clearInterval(j3))):(j3||(z9=d6.now(),j3=setInterval($vt,qTe)),n5=1,UTe(vle))}}function ble(t,e,r){var n=new V9;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Fvt=bTe("start","end","cancel","interrupt"),zvt=[],jTe=0,xle=1,QH=2,RM=3,wle=4,JH=5,_M=6;function UN(t,e,r,n,i,s){var a=t.__transition;if(!a)t.__transition={};else if(r in a)return;Vvt(t,r,{name:e,index:n,group:i,on:Fvt,tween:zvt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:jTe})}function PK(t,e){var r=Oh(t,e);if(r.state>jTe)throw new Error("too late; already scheduled");return r}function Wd(t,e){var r=Oh(t,e);if(r.state>RM)throw new Error("too late; already running");return r}function Oh(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Vvt(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=YTe(s,0,r.time);function s(u){r.state=xle,r.timer.restart(a,r.delay,r.time),r.delay<=u&&a(u-r.delay)}function a(u){var h,d,f,p;if(r.state!==xle)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===RM)return ble(a);p.state===wle?(p.state=_M,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hQH&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function v2t(t,e,r){var n,i,s=y2t(e)?PK:Wd;return function(){var a=s(this,t),o=a.on;o!==n&&(i=(n=o).copy()).on(e,r),a.on=i}}function b2t(t,e){var r=this._id;return arguments.length<2?Oh(this.node(),r).on.on(t):this.each(v2t(r,t,e))}function x2t(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function w2t(){return this.on("end.remove",x2t(this._id))}function T2t(t){var e=this._name,r=this._id;typeof t!="function"&&(t=IK(t));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a=0))throw new Error(`invalid digits: ${t}`);if(e>15)return QTe;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;iUm)if(!(Math.abs(d*l-u*h)>Um)||!s)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-a,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),x=Math.sqrt(f),b=s*Math.tan((eG-Math.acos((m+f-y)/(2*v*x)))/2),T=b/x,C=b/v;Math.abs(T-1)>Um&&this._append`L${e+T*h},${r+T*d}`,this._append`A${s},${s},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,s,a){if(e=+e,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Um||Math.abs(this._y1-h)>Um)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%tG+tG),f>Y2t?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>Um&&this._append`A${n},${n},0,${+(f>=eG)},${d},${this._x1=e+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function K2t(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function H9(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function i5(t){return t=H9(Math.abs(t)),t?t[1]:NaN}function Z2t(t,e){return function(r,n){for(var i=r.length,s=[],a=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[a=(a+1)%t.length];return s.reverse().join(e)}}function Q2t(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var J2t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function G9(t){if(!(e=J2t.exec(t)))throw new Error("invalid format: "+t);var e;return new BK({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}G9.prototype=BK.prototype;function BK(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}BK.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 ebt(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var W9;function tbt(t,e){var r=H9(t,e);if(!r)return W9=void 0,t.toPrecision(e);var n=r[0],i=r[1],s=i-(W9=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+H9(t,Math.max(0,e+s-1))[0]}function Tle(t,e){var r=H9(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Cle={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:K2t,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Tle(t*100,e),r:Tle,s:tbt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function kle(t){return t}var Sle=Array.prototype.map,Ele=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function rbt(t){var e=t.grouping===void 0||t.thousands===void 0?kle:Z2t(Sle.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?kle:Q2t(Sle.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=G9(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,T=d.precision,C=d.trim,S=d.type;S==="n"?(b=!0,S="g"):Cle[S]||(T===void 0&&(T=12),C=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(S)?a:"")+(f&&f.suffix!==void 0?f.suffix:""),A=Cle[S],R=/[defgprs%]/.test(S);T=T===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function _(P){var N=k,L=E,I,$,O;if(S==="c")L=A(P)+L,P="";else{P=+P;var D=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),T),C&&(P=ebt(P)),D&&+P==0&&m!=="+"&&(D=!1),N=(D?m==="("?m:o:m==="-"||m==="("?"":m)+N,L=(S==="s"&&!isNaN(P)&&W9!==void 0?Ele[8+W9/3]:"")+L+(D&&m==="("?")":""),R){for(I=-1,$=P.length;++I<$;)if(O=P.charCodeAt(I),48>O||O>57){L=(O===46?i+P.slice(I+1):P.slice(I))+L,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=N.length+P.length+L.length,z=F>1)+N+P+L+z.slice(F);break;default:P=z+N+P+L;break}return s(P)}return _.toString=function(){return d+""},_}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(i5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=G9(d),d.type="f",d),{suffix:Ele[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var _A,c1,JTe;nbt({thousands:",",grouping:[3],currency:["$",""]});function nbt(t){return _A=rbt(t),c1=_A.format,JTe=_A.formatPrefix,_A}function ibt(t){return Math.max(0,-i5(Math.abs(t)))}function sbt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(i5(e)/3)))*3-i5(Math.abs(t)))}function abt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,i5(e)-i5(t))+1}function obt(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function lbt(){return this.eachAfter(obt)}function cbt(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function ubt(t,e){for(var r=this,n=[r],i,s,a=-1;r=n.pop();)if(t.call(e,r,++a,this),i=r.children)for(s=i.length-1;s>=0;--s)n.push(i[s]);return this}function hbt(t,e){for(var r=this,n=[r],i=[],s,a,o,l=-1;r=n.pop();)if(i.push(r),s=r.children)for(a=0,o=s.length;a=0;)r+=n[i].value;e.value=r})}function pbt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function gbt(t){for(var e=this,r=mbt(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function mbt(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function ybt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function vbt(){return Array.from(this)}function bbt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function xbt(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*wbt(){var t=this,e,r=[t],n,i,s;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,s=n.length;i=0;--o)i.push(s=a[o]=new q9(a[o])),s.parent=n,s.depth=n.depth+1;return r.eachBefore(Ebt)}function Tbt(){return FK(this).eachBefore(Sbt)}function Cbt(t){return t.children}function kbt(t){return Array.isArray(t)?t[1]:null}function Sbt(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ebt(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function q9(t){this.data=t,this.depth=this.height=0,this.parent=null}q9.prototype=FK.prototype={constructor:q9,count:lbt,each:cbt,eachAfter:hbt,eachBefore:ubt,find:dbt,sum:fbt,sort:pbt,path:gbt,ancestors:ybt,descendants:vbt,leaves:bbt,links:xbt,copy:Tbt,[Symbol.iterator]:wbt};function Abt(t){if(typeof t!="function")throw new Error;return t}function X3(){return 0}function K3(t){return function(){return t}}function Mbt(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 Rbt(t,e,r,n,i){for(var s=t.children,a,o=-1,l=s.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),S=y*y*C,b=Math.max(x/S,S/v),b>T){y-=u;break}T=b}a.push(l={value:y,dice:p1?n:1)},r})(Lbt);function Dbt(){var t=Nbt,e=!1,r=1,n=1,i=[0],s=X3,a=X3,o=X3,l=X3,u=X3;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(Mbt),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;ye&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function Bbt(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i2?Fbt:Bbt,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?s:(l||(l=o(t.map(n),e,r)))(n(a(f)))}return d.invert=function(f){return a(i((u||(u=o(e,t.map(n),eh)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,Pbt),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=Mvt,h()},d.clamp=function(f){return arguments.length?(a=f?!0:Z2,h()):a!==Z2},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,p){return n=f,i=p,h()}}function t5e(){return zbt()(Z2,Z2)}function Vbt(t,e,r,n){var i=WH(t,e,r),s;switch(n=G9(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=sbt(i,a))&&(n.precision=s),JTe(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=abt(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=ibt(i))&&(n.precision=s-(n.type==="%")*2);break}}return c1(n)}function Hbt(t){var e=t.domain;return t.ticks=function(r){var n=e();return c1t(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return Vbt(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,s=n.length-1,a=n[i],o=n[s],l,u,h=10;for(o0;){if(u=GH(a,o,r),u===l)return n[i]=a,n[s]=o,e(n);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function s5(){var t=t5e();return t.copy=function(){return e5e(t,s5())},YN.apply(t,arguments),Hbt(t)}function Gbt(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],s=t[n],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s0))return l;let u;do l.push(u=new Date(+s)),e(s,o),t(s);while(uIa(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;e(a,-1),!s(a););else for(;--o>=0;)for(;e(a,1),!s(a););}),r&&(i.count=(s,a)=>(H$.setTime(+s),G$.setTime(+a),t(H$),t(G$),Math.floor(r(H$,G$))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?a=>n(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const a5=Ia(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);a5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ia(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):a5);a5.range;const Hf=1e3,vu=Hf*60,Gf=vu*60,f0=Gf*24,zK=f0*7,Rle=f0*30,W$=f0*365,zp=Ia(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hf)},(t,e)=>(e-t)/Hf,t=>t.getUTCSeconds());zp.range;const f6=Ia(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hf)},(t,e)=>{t.setTime(+t+e*vu)},(t,e)=>(e-t)/vu,t=>t.getMinutes());f6.range;const Wbt=Ia(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*vu)},(t,e)=>(e-t)/vu,t=>t.getUTCMinutes());Wbt.range;const p6=Ia(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hf-t.getMinutes()*vu)},(t,e)=>{t.setTime(+t+e*Gf)},(t,e)=>(e-t)/Gf,t=>t.getHours());p6.range;const qbt=Ia(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Gf)},(t,e)=>(e-t)/Gf,t=>t.getUTCHours());qbt.range;const wy=Ia(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*vu)/f0,t=>t.getDate()-1);wy.range;const VK=Ia(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/f0,t=>t.getUTCDate()-1);VK.range;const Ubt=Ia(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/f0,t=>Math.floor(t/f0));Ubt.range;function Xy(t){return Ia(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*vu)/zK)}const JE=Xy(0),g6=Xy(1),r5e=Xy(2),n5e=Xy(3),Ty=Xy(4),i5e=Xy(5),s5e=Xy(6);JE.range;g6.range;r5e.range;n5e.range;Ty.range;i5e.range;s5e.range;function Ky(t){return Ia(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/zK)}const a5e=Ky(0),U9=Ky(1),Ybt=Ky(2),jbt=Ky(3),o5=Ky(4),Xbt=Ky(5),Kbt=Ky(6);a5e.range;U9.range;Ybt.range;jbt.range;o5.range;Xbt.range;Kbt.range;const m6=Ia(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());m6.range;const Zbt=Ia(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Zbt.range;const p0=Ia(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());p0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ia(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});p0.range;const Cy=Ia(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Cy.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ia(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});Cy.range;function Qbt(t,e,r,n,i,s){const a=[[zp,1,Hf],[zp,5,5*Hf],[zp,15,15*Hf],[zp,30,30*Hf],[s,1,vu],[s,5,5*vu],[s,15,15*vu],[s,30,30*vu],[i,1,Gf],[i,3,3*Gf],[i,6,6*Gf],[i,12,12*Gf],[n,1,f0],[n,2,2*f0],[r,1,zK],[e,1,Rle],[e,3,3*Rle],[t,1,W$]];function o(u,h,d){const f=hy).right(a,f);if(p===a.length)return t.every(WH(u/W$,h/W$,d));if(p===0)return a5.every(Math.max(WH(u,h,d),1));const[g,m]=a[f/a[p-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(te=U$(Z3(ie.y,0,1)),_e=te.getUTCDay(),te=_e>4||_e===0?U9.ceil(te):U9(te),te=VK.offset(te,(ie.V-1)*7),ie.y=te.getUTCFullYear(),ie.m=te.getUTCMonth(),ie.d=te.getUTCDate()+(ie.w+6)%7):(te=q$(Z3(ie.y,0,1)),_e=te.getDay(),te=_e>4||_e===0?g6.ceil(te):g6(te),te=wy.offset(te,(ie.V-1)*7),ie.y=te.getFullYear(),ie.m=te.getMonth(),ie.d=te.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),_e="Z"in ie?U$(Z3(ie.y,0,1)).getUTCDay():q$(Z3(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(_e+5)%7:ie.w+ie.U*7-(_e+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,U$(ie)):q$(ie)}}function E(Q,Z,re,ie){for(var me=0,te=Z.length,_e=re.length,$e,Fe;me=_e)return-1;if($e=Z.charCodeAt(me++),$e===37){if($e=Z.charAt(me++),Fe=C[$e in _le?Z.charAt(me++):$e],!Fe||(ie=Fe(Q,re,ie))<0)return-1}else if($e!=re.charCodeAt(ie++))return-1}return ie}function A(Q,Z,re){var ie=u.exec(Z.slice(re));return ie?(Q.p=h.get(ie[0].toLowerCase()),re+ie[0].length):-1}function R(Q,Z,re){var ie=p.exec(Z.slice(re));return ie?(Q.w=g.get(ie[0].toLowerCase()),re+ie[0].length):-1}function _(Q,Z,re){var ie=d.exec(Z.slice(re));return ie?(Q.w=f.get(ie[0].toLowerCase()),re+ie[0].length):-1}function P(Q,Z,re){var ie=v.exec(Z.slice(re));return ie?(Q.m=x.get(ie[0].toLowerCase()),re+ie[0].length):-1}function N(Q,Z,re){var ie=m.exec(Z.slice(re));return ie?(Q.m=y.get(ie[0].toLowerCase()),re+ie[0].length):-1}function L(Q,Z,re){return E(Q,e,Z,re)}function I(Q,Z,re){return E(Q,r,Z,re)}function $(Q,Z,re){return E(Q,n,Z,re)}function O(Q){return a[Q.getDay()]}function D(Q){return s[Q.getDay()]}function F(Q){return l[Q.getMonth()]}function z(Q){return o[Q.getMonth()]}function V(Q){return i[+(Q.getHours()>=12)]}function B(Q){return 1+~~(Q.getMonth()/3)}function H(Q){return a[Q.getUTCDay()]}function G(Q){return s[Q.getUTCDay()]}function W(Q){return l[Q.getUTCMonth()]}function K(Q){return o[Q.getUTCMonth()]}function q(Q){return i[+(Q.getUTCHours()>=12)]}function oe(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var Z=S(Q+="",b);return Z.toString=function(){return Q},Z},parse:function(Q){var Z=k(Q+="",!1);return Z.toString=function(){return Q},Z},utcFormat:function(Q){var Z=S(Q+="",T);return Z.toString=function(){return Q},Z},utcParse:function(Q){var Z=k(Q+="",!0);return Z.toString=function(){return Q},Z}}}var _le={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,rxt=/^%/,nxt=/[\\^$*+?|[\]().{}]/g;function ii(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s[e.toLowerCase(),r]))}function sxt(t,e,r){var n=eo.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function axt(t,e,r){var n=eo.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function oxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function lxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function cxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Lle(t,e,r){var n=eo.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ile(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function uxt(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function hxt(t,e,r){var n=eo.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function dxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Nle(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function fxt(t,e,r){var n=eo.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Dle(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function pxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function gxt(t,e,r){var n=eo.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function mxt(t,e,r){var n=eo.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function yxt(t,e,r){var n=eo.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function vxt(t,e,r){var n=rxt.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function bxt(t,e,r){var n=eo.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function xxt(t,e,r){var n=eo.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Ole(t,e){return ii(t.getDate(),e,2)}function wxt(t,e){return ii(t.getHours(),e,2)}function Txt(t,e){return ii(t.getHours()%12||12,e,2)}function Cxt(t,e){return ii(1+wy.count(p0(t),t),e,3)}function o5e(t,e){return ii(t.getMilliseconds(),e,3)}function kxt(t,e){return o5e(t,e)+"000"}function Sxt(t,e){return ii(t.getMonth()+1,e,2)}function Ext(t,e){return ii(t.getMinutes(),e,2)}function Axt(t,e){return ii(t.getSeconds(),e,2)}function Mxt(t){var e=t.getDay();return e===0?7:e}function Rxt(t,e){return ii(JE.count(p0(t)-1,t),e,2)}function l5e(t){var e=t.getDay();return e>=4||e===0?Ty(t):Ty.ceil(t)}function _xt(t,e){return t=l5e(t),ii(Ty.count(p0(t),t)+(p0(t).getDay()===4),e,2)}function Lxt(t){return t.getDay()}function Ixt(t,e){return ii(g6.count(p0(t)-1,t),e,2)}function Nxt(t,e){return ii(t.getFullYear()%100,e,2)}function Dxt(t,e){return t=l5e(t),ii(t.getFullYear()%100,e,2)}function Oxt(t,e){return ii(t.getFullYear()%1e4,e,4)}function Pxt(t,e){var r=t.getDay();return t=r>=4||r===0?Ty(t):Ty.ceil(t),ii(t.getFullYear()%1e4,e,4)}function $xt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ii(e/60|0,"0",2)+ii(e%60,"0",2)}function Ple(t,e){return ii(t.getUTCDate(),e,2)}function Bxt(t,e){return ii(t.getUTCHours(),e,2)}function Fxt(t,e){return ii(t.getUTCHours()%12||12,e,2)}function zxt(t,e){return ii(1+VK.count(Cy(t),t),e,3)}function c5e(t,e){return ii(t.getUTCMilliseconds(),e,3)}function Vxt(t,e){return c5e(t,e)+"000"}function Hxt(t,e){return ii(t.getUTCMonth()+1,e,2)}function Gxt(t,e){return ii(t.getUTCMinutes(),e,2)}function Wxt(t,e){return ii(t.getUTCSeconds(),e,2)}function qxt(t){var e=t.getUTCDay();return e===0?7:e}function Uxt(t,e){return ii(a5e.count(Cy(t)-1,t),e,2)}function u5e(t){var e=t.getUTCDay();return e>=4||e===0?o5(t):o5.ceil(t)}function Yxt(t,e){return t=u5e(t),ii(o5.count(Cy(t),t)+(Cy(t).getUTCDay()===4),e,2)}function jxt(t){return t.getUTCDay()}function Xxt(t,e){return ii(U9.count(Cy(t)-1,t),e,2)}function Kxt(t,e){return ii(t.getUTCFullYear()%100,e,2)}function Zxt(t,e){return t=u5e(t),ii(t.getUTCFullYear()%100,e,2)}function Qxt(t,e){return ii(t.getUTCFullYear()%1e4,e,4)}function Jxt(t,e){var r=t.getUTCDay();return t=r>=4||r===0?o5(t):o5.ceil(t),ii(t.getUTCFullYear()%1e4,e,4)}function e4t(){return"+0000"}function $le(){return"%"}function Ble(t){return+t}function Fle(t){return Math.floor(+t/1e3)}var Fv,Y9;t4t({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function t4t(t){return Fv=txt(t),Y9=Fv.format,Fv.parse,Fv.utcFormat,Fv.utcParse,Fv}function r4t(t){return new Date(t)}function n4t(t){return t instanceof Date?+t:+new Date(+t)}function h5e(t,e,r,n,i,s,a,o,l,u){var h=t5e(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),T=u("%Y");function C(S){return(l(S)1?0:t<-1?y6:Math.acos(t)}function Vle(t){return t>=1?j9:t<=-1?-j9:Math.asin(t)}function d5e(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new X2t(e)}function c4t(t){return t.innerRadius}function u4t(t){return t.outerRadius}function h4t(t){return t.startAngle}function d4t(t){return t.endAngle}function f4t(t){return t&&t.padAngle}function p4t(t,e,r,n,i,s,a,o){var l=r-t,u=n-e,h=a-i,d=o-s,f=d*l-h*u;if(!(f*fL*L+I*I&&(E=R,A=_),{cx:E,cy:A,x01:-h,y01:-d,x11:E*(i/C-1),y11:A*(i/C-1)}}function l5(){var t=c4t,e=u4t,r=Gs(0),n=null,i=h4t,s=d4t,a=f4t,o=null,l=d5e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-j9,m=s.apply(this,arguments)-j9,y=zle(m-g),v=m>g;if(o||(o=h=l()),pOo))o.moveTo(0,0);else if(y>LM-Oo)o.moveTo(p*Sm(g),p*zh(g)),o.arc(0,0,p,g,m,!v),f>Oo&&(o.moveTo(f*Sm(m),f*zh(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,T=g,C=m,S=y,k=y,E=a.apply(this,arguments)/2,A=E>Oo&&(n?+n.apply(this,arguments):Q2(f*f+p*p)),R=Y$(zle(p-f)/2,+r.apply(this,arguments)),_=R,P=R,N,L;if(A>Oo){var I=Vle(A/f*zh(E)),$=Vle(A/p*zh(E));(S-=I*2)>Oo?(I*=v?1:-1,T+=I,C-=I):(S=0,T=C=(g+m)/2),(k-=$*2)>Oo?($*=v?1:-1,x+=$,b-=$):(k=0,x=b=(g+m)/2)}var O=p*Sm(x),D=p*zh(x),F=f*Sm(C),z=f*zh(C);if(R>Oo){var V=p*Sm(b),B=p*zh(b),H=f*Sm(T),G=f*zh(T),W;if(yOo?P>Oo?(N=LA(H,G,O,D,p,P,v),L=LA(V,B,F,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),POo)||!(S>Oo)?o.lineTo(F,z):_>Oo?(N=LA(F,z,V,B,f,-_,v),L=LA(O,D,H,G,f,-_,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),_t?1:e>=t?0:NaN}function v4t(t){return t}function b4t(){var t=v4t,e=y4t,r=null,n=Gs(0),i=Gs(LM),s=Gs(0);function a(o){var l,u=(o=f5e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(LM,Math.max(-LM,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,s.apply(this,arguments)),b=x*(y<0?-1:1),T;for(l=0;l0&&(f+=T);for(e!=null?p.sort(function(C,S){return e(g[C],g[S])}):r!=null&&p.sort(function(C,S){return r(o[C],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?T*d:0)+b,g[h]={data:o[h],index:l,value:T,startAngle:m,endAngle:v,padAngle:x};return g}return a.value=function(o){return arguments.length?(t=typeof o=="function"?o:Gs(+o),a):t},a.sortValues=function(o){return arguments.length?(e=o,r=null,a):e},a.sort=function(o){return arguments.length?(r=o,e=null,a):r},a.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Gs(+o),a):n},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Gs(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Gs(+o),a):s},a}class g5e{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function m5e(t){return new g5e(t,!0)}function y5e(t){return new g5e(t,!1)}function mg(){}function X9(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function jN(t){this._context=t}jN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:X9(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:X9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function b6(t){return new jN(t)}function v5e(t){this._context=t}v5e.prototype={areaStart:mg,areaEnd:mg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:X9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function x4t(t){return new v5e(t)}function b5e(t){this._context=t}b5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:X9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function w4t(t){return new b5e(t)}function x5e(t,e){this._basis=new jN(t),this._beta=e}x5e.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],s=t[r]-n,a=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*s),this._beta*e[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const T4t=(function t(e){function r(n){return e===1?new jN(n):new x5e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function K9(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function HK(t,e){this._context=t,this._k=(1-e)/6}HK.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:K9(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:K9(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const w5e=(function t(e){function r(n){return new HK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function GK(t,e){this._context=t,this._k=(1-e)/6}GK.prototype={areaStart:mg,areaEnd:mg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:K9(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const C4t=(function t(e){function r(n){return new GK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function WK(t,e){this._context=t,this._k=(1-e)/6}WK.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:K9(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const k4t=(function t(e){function r(n){return new WK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function qK(t,e,r){var n=t._x1,i=t._y1,s=t._x2,a=t._y2;if(t._l01_a>Oo){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Oo){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*u+t._x1*t._l23_2a-e*t._l12_2a)/h,a=(a*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,s,a,t._x2,t._y2)}function T5e(t,e){this._context=t,this._alpha=e}T5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:qK(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const C5e=(function t(e){function r(n){return e?new T5e(n,e):new HK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function k5e(t,e){this._context=t,this._alpha=e}k5e.prototype={areaStart:mg,areaEnd:mg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:qK(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const S4t=(function t(e){function r(n){return e?new k5e(n,e):new GK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function S5e(t,e){this._context=t,this._alpha=e}S5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:qK(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const E4t=(function t(e){function r(n){return e?new S5e(n,e):new WK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function E5e(t){this._context=t}E5e.prototype={areaStart:mg,areaEnd:mg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function A4t(t){return new E5e(t)}function Hle(t){return t<0?-1:1}function Gle(t,e,r){var n=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(n||i<0&&-0),a=(r-t._y1)/(i||n<0&&-0),o=(s*i+a*n)/(n+i);return(Hle(s)+Hle(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Wle(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function j$(t,e,r){var n=t._x0,i=t._y0,s=t._x1,a=t._y1,o=(s-n)/3;t._context.bezierCurveTo(n+o,i+o*e,s-o,a-o*r,s,a)}function Z9(t){this._context=t}Z9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:j$(this,this._t0,Wle(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,j$(this,Wle(this,r=Gle(this,t,e)),r);break;default:j$(this,this._t0,r=Gle(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function A5e(t){this._context=new M5e(t)}(A5e.prototype=Object.create(Z9.prototype)).point=function(t,e){Z9.prototype.point.call(this,e,t)};function M5e(t){this._context=t}M5e.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,s){this._context.bezierCurveTo(e,t,n,r,s,i)}};function R5e(t){return new Z9(t)}function _5e(t){return new A5e(t)}function L5e(t){this._context=t}L5e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=qle(t),i=qle(e),s=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/s[e];for(s[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function N5e(t){return new XN(t,.5)}function D5e(t){return new XN(t,0)}function O5e(t){return new XN(t,1)}function YC(t,e,r){this.k=t,this.x=e,this.y=r}YC.prototype={constructor:YC,scale:function(t){return t===1?this:new YC(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new YC(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};YC.prototype;var Xo=w(t=>{var i;const{securityLevel:e}=Ve();let r=wt("body");if(e==="sandbox"){const a=((i=wt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=wt(a.body)}return r.select(`#${t}`)},"selectSvgElement");function UK(t){return typeof t>"u"||t===null}w(UK,"isNothing");function P5e(t){return typeof t=="object"&&t!==null}w(P5e,"isObject");function $5e(t){return Array.isArray(t)?t:UK(t)?[]:[t]}w($5e,"toArray");function B5e(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;ro&&(s=" ... ",e=n-o+s.length),r-n>o&&(a=" ...",r=n+o-a.length),{str:s+t.slice(e,r).replace(/\t/g,"→")+a,pos:n-e+s.length}}w(MM,"getLine");function RM(t,e){return Ca.repeat(" ",e-t.length)+t}w(RM,"padStart");function O5e(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=MM(t.buffer,n[a-l],i[a-l],t.position-(n[a]-n[a-l]),d),o=Ca.repeat(" ",e.indent)+RM((t.line-l+1).toString(),h)+" | "+u.str+` -`+o;for(u=MM(t.buffer,n[a],i[a],t.position,d),o+=Ca.repeat(" ",e.indent)+RM((t.line+1).toString(),h)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}w(YK,"formatError");function c5(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=YK(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}w(c5,"YAMLException$1");c5.prototype=Object.create(Error.prototype);c5.prototype.constructor=c5;c5.prototype.toString=w(function(e){return this.name+": "+YK(this,e)},"toString");var oc=c5;function IM(t,e,r,n,i){var s="",a="",o=Math.floor(i/2)-1;return n-e>o&&(s=" ... ",e=n-o+s.length),r-n>o&&(a=" ...",r=n+o-a.length),{str:s+t.slice(e,r).replace(/\t/g,"→")+a,pos:n-e+s.length}}w(IM,"getLine");function NM(t,e){return Ca.repeat(" ",e-t.length)+t}w(NM,"padStart");function V5e(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=IM(t.buffer,n[a-l],i[a-l],t.position-(n[a]-n[a-l]),d),o=Ca.repeat(" ",e.indent)+NM((t.line-l+1).toString(),h)+" | "+u.str+` +`+o;for(u=IM(t.buffer,n[a],i[a],t.position,d),o+=Ca.repeat(" ",e.indent)+NM((t.line+1).toString(),h)+" | "+u.str+` `,o+=Ca.repeat("-",e.indent+h+3+u.pos)+`^ -`,l=1;l<=e.linesAfter&&!(a+l>=i.length);l++)u=MM(t.buffer,n[a+l],i[a+l],t.position-(n[a]-n[a+l]),d),o+=Ca.repeat(" ",e.indent)+RM((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}w(O5e,"makeSnippet");var M4t=O5e,R4t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_4t=["scalar","sequence","mapping"];function P5e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}w(P5e,"compileStyleAliases");function $5e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(R4t.indexOf(r)===-1)throw new ic('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=P5e(e.styleAliases||null),_4t.indexOf(this.kind)===-1)throw new ic('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}w($5e,"Type$1");var Vo=$5e;function eG(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}w(eG,"compileList");function B5e(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(w(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:w(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:w(function(t){return t.toString(10)},"decimal"),hexadecimal:w(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),F4t=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Z5e(t){return!(t===null||!F4t.test(t)||t[t.length-1]==="_")}w(Z5e,"resolveYamlFloat");function Q5e(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}w(Q5e,"constructYamlFloat");var z4t=/^[-+]?[0-9]+e/;function J5e(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ca.isNegativeZero(t))return"-0.0";return r=t.toString(10),z4t.test(r)?r.replace("e",".e"):r}w(J5e,"representYamlFloat");function e3e(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Ca.isNegativeZero(t))}w(e3e,"isFloat");var V4t=new Vo("tag:yaml.org,2002:float",{kind:"scalar",resolve:Z5e,construct:Q5e,predicate:e3e,represent:J5e,defaultStyle:"lowercase"}),t3e=O4t.extend({implicit:[P4t,$4t,B4t,V4t]}),H4t=t3e,r3e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n3e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function i3e(t){return t===null?!1:r3e.exec(t)!==null||n3e.exec(t)!==null}w(i3e,"resolveYamlTimestamp");function s3e(t){var e,r,n,i,s,a,o,l=0,u=null,h,d,f;if(e=r3e.exec(t),e===null&&(e=n3e.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(s=+e[4],a=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,s,a,o,l)),u&&f.setTime(f.getTime()-u),f}w(s3e,"constructYamlTimestamp");function a3e(t){return t.toISOString()}w(a3e,"representYamlTimestamp");var G4t=new Vo("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i3e,construct:s3e,instanceOf:Date,represent:a3e});function o3e(t){return t==="<<"||t===null}w(o3e,"resolveYamlMerge");var W4t=new Vo("tag:yaml.org,2002:merge",{kind:"scalar",resolve:o3e}),WK=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function l3e(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=WK;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(l3e,"resolveYamlBinary");function c3e(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=WK,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(a&255)),a=a<<6|s.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)):r===18?(o.push(a>>10&255),o.push(a>>2&255)):r===12&&o.push(a>>4&255),new Uint8Array(o)}w(c3e,"constructYamlBinary");function u3e(t){var e="",r=0,n,i,s=t.length,a=WK;for(n=0;n>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]),r=(r<<8)+t[n];return i=s%3,i===0?(e+=a[r>>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]):i===2?(e+=a[r>>10&63],e+=a[r>>4&63],e+=a[r<<2&63],e+=a[64]):i===1&&(e+=a[r>>2&63],e+=a[r<<4&63],e+=a[64],e+=a[64]),e}w(u3e,"representYamlBinary");function h3e(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(h3e,"isBinary");var q4t=new Vo("tag:yaml.org,2002:binary",{kind:"scalar",resolve:l3e,construct:c3e,predicate:h3e,represent:u3e}),U4t=Object.prototype.hasOwnProperty,Y4t=Object.prototype.toString;function d3e(t){if(t===null)return!0;var e=[],r,n,i,s,a,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}w(E3e,"charFromCodepoint");function qK(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(qK,"setProperty");var A3e=new Array(256),M3e=new Array(256);for(Cm=0;Cm<256;Cm++)A3e[Cm]=rG(Cm)?1:0,M3e[Cm]=rG(Cm);var Cm;function R3e(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||v3e,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}w(R3e,"State$1");function UK(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=M4t(r),new ic(e,r)}w(UK,"generateError");function Ir(t,e){throw UK(t,e)}w(Ir,"throwError");function y6(t,e){t.onWarning&&t.onWarning.call(null,UK(t,e))}w(y6,"throwWarning");var Gle={YAML:w(function(e,r,n){var i,s,a;e.version!==null&&Ir(e,"duplication of %YAML directive"),n.length!==1&&Ir(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Ir(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&Ir(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&y6(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(e,r,n){var i,s;n.length!==2&&Ir(e,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],w3e.test(i)||Ir(e,"ill-formed tag handle (first argument) of the TAG directive"),pg.call(e.tagMap,i)&&Ir(e,'there is a previously declared suffix for "'+i+'" tag handle'),T3e.test(s)||Ir(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Ir(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function Jf(t,e,r,n){var i,s,a,o;if(e1&&(t.result+=Ca.repeat(` -`,e-1))}w(jN,"writeFoldedLines");function _3e(t,e,r){var n,i,s,a,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),ml(p)||N1(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),ml(i)||r&&N1(i)))return!1;for(t.kind="scalar",t.result="",s=a=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),ml(i)||r&&N1(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),ml(n))break}else{if(t.position===t.lineStart&&ZE(t)||r&&N1(p))break;if(fh(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Ys(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=a,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(Jf(t,s,a,!1),jN(t,t.line-l),s=a=t.position,o=!1),Zp(p)||(a=t.position+1),p=t.input.charCodeAt(++t.position)}return Jf(t,s,a,!1),t.result?!0:(t.kind=d,t.result=f,!1)}w(_3e,"readPlainScalar");function L3e(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Jf(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else fh(r)?(Jf(t,n,i,!0),jN(t,Ys(t,!1,e)),n=i=t.position):t.position===t.lineStart&&ZE(t)?Ir(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Ir(t,"unexpected end of the stream within a single quoted scalar")}w(L3e,"readSingleQuotedScalar");function I3e(t,e){var r,n,i,s,a,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return Jf(t,r,t.position,!0),t.position++,!0;if(o===92){if(Jf(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),fh(o))Ys(t,!1,e);else if(o<256&&A3e[o])t.result+=M3e[o],t.position++;else if((a=k3e(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=C3e(o))>=0?s=(s<<4)+a:Ir(t,"expected hexadecimal character");t.result+=E3e(s),t.position++}else Ir(t,"unknown escape sequence");r=n=t.position}else fh(o)?(Jf(t,r,n,!0),jN(t,Ys(t,!1,e)),r=n=t.position):t.position===t.lineStart&&ZE(t)?Ir(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Ir(t,"unexpected end of the stream within a double quoted scalar")}w(I3e,"readDoubleQuotedScalar");function N3e(t,e){var r=!0,n,i,s,a=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(Ys(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=a,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&Ir(t,"expected the node content, but found ','"):Ir(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),ml(u)&&(d=f=!0,t.position++,Ys(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,Ty(t,e,X9,!1,!0),y=t.tag,m=t.result,Ys(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),Ys(t,!0,e),Ty(t,e,X9,!1,!0),v=t.result),p?D1(t,o,g,y,m,v,n,i,s):d?o.push(D1(t,null,g,y,m,v,n,i,s)):o.push(m),Ys(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}Ir(t,"unexpected end of the stream within a flow collection")}w(N3e,"readFlowCollection");function D3e(t,e){var r,n,i=U$,s=!1,a=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)U$===i?i=d===43?Hle:J4t:Ir(t,"repeat of a chomping mode identifier");else if((h=S3e(d))>=0)h===0?Ir(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Ir(t,"repeat of an indentation width identifier"):(o=e+h-1,a=!0);else break;if(Zp(d)){do d=t.input.charCodeAt(++t.position);while(Zp(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!fh(d)&&d!==0)}for(;d!==0;){for(YN(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!a||t.lineIndento&&(o=t.lineIndent),fh(d)){l++;continue}if(t.lineIndent=i.length);l++)u=IM(t.buffer,n[a+l],i[a+l],t.position-(n[a]-n[a+l]),d),o+=Ca.repeat(" ",e.indent)+NM((t.line+l+1).toString(),h)+" | "+u.str+` +`;return o.replace(/\n$/,"")}w(V5e,"makeSnippet");var D4t=V5e,O4t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],P4t=["scalar","sequence","mapping"];function H5e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}w(H5e,"compileStyleAliases");function G5e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(O4t.indexOf(r)===-1)throw new oc('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=H5e(e.styleAliases||null),P4t.indexOf(this.kind)===-1)throw new oc('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}w(G5e,"Type$1");var Vo=G5e;function iG(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}w(iG,"compileList");function W5e(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(w(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:w(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:w(function(t){return t.toString(10)},"decimal"),hexadecimal:w(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),q4t=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function n3e(t){return!(t===null||!q4t.test(t)||t[t.length-1]==="_")}w(n3e,"resolveYamlFloat");function i3e(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}w(i3e,"constructYamlFloat");var U4t=/^[-+]?[0-9]+e/;function s3e(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ca.isNegativeZero(t))return"-0.0";return r=t.toString(10),U4t.test(r)?r.replace("e",".e"):r}w(s3e,"representYamlFloat");function a3e(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Ca.isNegativeZero(t))}w(a3e,"isFloat");var Y4t=new Vo("tag:yaml.org,2002:float",{kind:"scalar",resolve:n3e,construct:i3e,predicate:a3e,represent:s3e,defaultStyle:"lowercase"}),o3e=V4t.extend({implicit:[H4t,G4t,W4t,Y4t]}),j4t=o3e,l3e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),c3e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function u3e(t){return t===null?!1:l3e.exec(t)!==null||c3e.exec(t)!==null}w(u3e,"resolveYamlTimestamp");function h3e(t){var e,r,n,i,s,a,o,l=0,u=null,h,d,f;if(e=l3e.exec(t),e===null&&(e=c3e.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(s=+e[4],a=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,s,a,o,l)),u&&f.setTime(f.getTime()-u),f}w(h3e,"constructYamlTimestamp");function d3e(t){return t.toISOString()}w(d3e,"representYamlTimestamp");var X4t=new Vo("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:u3e,construct:h3e,instanceOf:Date,represent:d3e});function f3e(t){return t==="<<"||t===null}w(f3e,"resolveYamlMerge");var K4t=new Vo("tag:yaml.org,2002:merge",{kind:"scalar",resolve:f3e}),jK=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function p3e(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=jK;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(p3e,"resolveYamlBinary");function g3e(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=jK,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(a&255)),a=a<<6|s.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)):r===18?(o.push(a>>10&255),o.push(a>>2&255)):r===12&&o.push(a>>4&255),new Uint8Array(o)}w(g3e,"constructYamlBinary");function m3e(t){var e="",r=0,n,i,s=t.length,a=jK;for(n=0;n>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]),r=(r<<8)+t[n];return i=s%3,i===0?(e+=a[r>>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]):i===2?(e+=a[r>>10&63],e+=a[r>>4&63],e+=a[r<<2&63],e+=a[64]):i===1&&(e+=a[r>>2&63],e+=a[r<<4&63],e+=a[64],e+=a[64]),e}w(m3e,"representYamlBinary");function y3e(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(y3e,"isBinary");var Z4t=new Vo("tag:yaml.org,2002:binary",{kind:"scalar",resolve:p3e,construct:g3e,predicate:y3e,represent:m3e}),Q4t=Object.prototype.hasOwnProperty,J4t=Object.prototype.toString;function v3e(t){if(t===null)return!0;var e=[],r,n,i,s,a,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}w(I3e,"charFromCodepoint");function XK(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(XK,"setProperty");var N3e=new Array(256),D3e=new Array(256);for(Em=0;Em<256;Em++)N3e[Em]=aG(Em)?1:0,D3e[Em]=aG(Em);var Em;function O3e(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||k3e,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}w(O3e,"State$1");function KK(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=D4t(r),new oc(e,r)}w(KK,"generateError");function Ir(t,e){throw KK(t,e)}w(Ir,"throwError");function x6(t,e){t.onWarning&&t.onWarning.call(null,KK(t,e))}w(x6,"throwWarning");var Yle={YAML:w(function(e,r,n){var i,s,a;e.version!==null&&Ir(e,"duplication of %YAML directive"),n.length!==1&&Ir(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Ir(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&Ir(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&x6(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(e,r,n){var i,s;n.length!==2&&Ir(e,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],A3e.test(i)||Ir(e,"ill-formed tag handle (first argument) of the TAG directive"),yg.call(e.tagMap,i)&&Ir(e,'there is a previously declared suffix for "'+i+'" tag handle'),M3e.test(s)||Ir(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Ir(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function n0(t,e,r,n){var i,s,a,o;if(e1&&(t.result+=Ca.repeat(` +`,e-1))}w(ZN,"writeFoldedLines");function P3e(t,e,r){var n,i,s,a,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),vl(p)||O1(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),vl(i)||r&&O1(i)))return!1;for(t.kind="scalar",t.result="",s=a=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),vl(i)||r&&O1(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),vl(n))break}else{if(t.position===t.lineStart&&e7(t)||r&&O1(p))break;if(mh(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Ys(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=a,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(n0(t,s,a,!1),ZN(t,t.line-l),s=a=t.position,o=!1),tg(p)||(a=t.position+1),p=t.input.charCodeAt(++t.position)}return n0(t,s,a,!1),t.result?!0:(t.kind=d,t.result=f,!1)}w(P3e,"readPlainScalar");function $3e(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(n0(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else mh(r)?(n0(t,n,i,!0),ZN(t,Ys(t,!1,e)),n=i=t.position):t.position===t.lineStart&&e7(t)?Ir(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Ir(t,"unexpected end of the stream within a single quoted scalar")}w($3e,"readSingleQuotedScalar");function B3e(t,e){var r,n,i,s,a,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return n0(t,r,t.position,!0),t.position++,!0;if(o===92){if(n0(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),mh(o))Ys(t,!1,e);else if(o<256&&N3e[o])t.result+=D3e[o],t.position++;else if((a=_3e(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=R3e(o))>=0?s=(s<<4)+a:Ir(t,"expected hexadecimal character");t.result+=I3e(s),t.position++}else Ir(t,"unknown escape sequence");r=n=t.position}else mh(o)?(n0(t,r,n,!0),ZN(t,Ys(t,!1,e)),r=n=t.position):t.position===t.lineStart&&e7(t)?Ir(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Ir(t,"unexpected end of the stream within a double quoted scalar")}w(B3e,"readDoubleQuotedScalar");function F3e(t,e){var r=!0,n,i,s,a=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(Ys(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=a,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&Ir(t,"expected the node content, but found ','"):Ir(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),vl(u)&&(d=f=!0,t.position++,Ys(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,ky(t,e,J9,!1,!0),y=t.tag,m=t.result,Ys(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),Ys(t,!0,e),ky(t,e,J9,!1,!0),v=t.result),p?P1(t,o,g,y,m,v,n,i,s):d?o.push(P1(t,null,g,y,m,v,n,i,s)):o.push(m),Ys(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}Ir(t,"unexpected end of the stream within a flow collection")}w(F3e,"readFlowCollection");function z3e(t,e){var r,n,i=X$,s=!1,a=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)X$===i?i=d===43?Ule:swt:Ir(t,"repeat of a chomping mode identifier");else if((h=L3e(d))>=0)h===0?Ir(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Ir(t,"repeat of an indentation width identifier"):(o=e+h-1,a=!0);else break;if(tg(d)){do d=t.input.charCodeAt(++t.position);while(tg(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!mh(d)&&d!==0)}for(;d!==0;){for(KN(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!a||t.lineIndento&&(o=t.lineIndent),mh(d)){l++;continue}if(t.lineIndente)&&l!==0)Ir(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(a=t.line,o=t.lineStart,l=t.position),Ty(t,e,K9,!0,i)&&(y?g=t.result:m=t.result),y||(D1(t,d,f,p,g,m,a,o,l),p=g=m=null),Ys(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&x!==0)Ir(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&Ir(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Ir(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}w(Ty,"composeNode");function F3e(t){var e=t.position,r,n,i,s=!1,a;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(a=t.input.charCodeAt(t.position))!==0&&(Ys(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||a!==37));){for(s=!0,a=t.input.charCodeAt(++t.position),r=t.position;a!==0&&!ml(a);)a=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Ir(t,"directive name must not be less than one character in length");a!==0;){for(;Zp(a);)a=t.input.charCodeAt(++t.position);if(a===35){do a=t.input.charCodeAt(++t.position);while(a!==0&&!fh(a));break}if(fh(a))break;for(r=t.position;a!==0&&!ml(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}a!==0&&YN(t),pg.call(Gle,n)?Gle[n](t,n,i):y6(t,'unknown document directive "'+n+'"')}if(Ys(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ys(t,!0,-1)):s&&Ir(t,"directives end mark is expected"),Ty(t,t.lineIndent-1,K9,!1,!0),Ys(t,!0,-1),t.checkLineBreaks&&twt.test(t.input.slice(e,t.position))&&y6(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&ZE(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ys(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=YK(t,r);if(typeof e!="function")return n;for(var i=0,s=n.length;ie)&&l!==0)Ir(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(a=t.line,o=t.lineStart,l=t.position),ky(t,e,e_,!0,i)&&(y?g=t.result:m=t.result),y||(P1(t,d,f,p,g,m,a,o,l),p=g=m=null),Ys(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&x!==0)Ir(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&Ir(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Ir(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}w(ky,"composeNode");function q3e(t){var e=t.position,r,n,i,s=!1,a;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(a=t.input.charCodeAt(t.position))!==0&&(Ys(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||a!==37));){for(s=!0,a=t.input.charCodeAt(++t.position),r=t.position;a!==0&&!vl(a);)a=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Ir(t,"directive name must not be less than one character in length");a!==0;){for(;tg(a);)a=t.input.charCodeAt(++t.position);if(a===35){do a=t.input.charCodeAt(++t.position);while(a!==0&&!mh(a));break}if(mh(a))break;for(r=t.position;a!==0&&!vl(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}a!==0&&KN(t),yg.call(Yle,n)?Yle[n](t,n,i):x6(t,'unknown document directive "'+n+'"')}if(Ys(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ys(t,!0,-1)):s&&Ir(t,"directives end mark is expected"),ky(t,t.lineIndent-1,e_,!1,!0),Ys(t,!0,-1),t.checkLineBreaks&&owt.test(t.input.slice(e,t.position))&&x6(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&e7(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ys(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=ZK(t,r);if(typeof e!="function")return n;for(var i=0,s=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}w(Z2,"codePointAt");function XK(t){var e=/^\n* /;return e.test(t)}w(XK,"needIndentIndicator");var eCe=1,cG=2,tCe=3,rCe=4,x2=5;function nCe(t,e,r,n,i,s,a,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=Q3e(Z2(t,0))&&J3e(Z2(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=Z2(t,l),!l5(u))return x2;m=m&&lG(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=Z2(t,l),u===v6)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!l5(u))return x2;m=m&&lG(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!a&&!i(t)?eCe:s===b6?x2:cG:r>9&&XK(t)?x2:a?s===b6?x2:cG:f?rCe:tCe}w(nCe,"chooseScalarStyle");function iCe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===b6?'""':"''";if(!t.noCompatMode&&(Twt.indexOf(e)!==-1||Cwt.test(e)))return t.quotingType===b6?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return Z3e(t,u)}switch(w(l,"testAmbiguity"),nCe(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!n,i)){case eCe:return e;case cG:return"'"+e.replace(/'/g,"''")+"'";case tCe:return"|"+uG(e,t.indent)+hG(aG(e,s));case rCe:return">"+uG(e,t.indent)+hG(aG(sCe(e,a),s));case x2:return'"'+aCe(e)+'"';default:throw new ic("impossible error: invalid scalar style")}})()}w(iCe,"writeScalar");function uG(t,e){var r=XK(t)?String(e):"",n=t[t.length-1]===` +`&&(s+=r),s+=a;return s}w(uG,"indentString");function r_(t,e){return` +`+Ca.repeat(" ",t.indent*e)}w(r_,"generateNextLine");function nCe(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}w(J2,"codePointAt");function JK(t){var e=/^\n* /;return e.test(t)}w(JK,"needIndentIndicator");var aCe=1,fG=2,oCe=3,lCe=4,T2=5;function cCe(t,e,r,n,i,s,a,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=iCe(J2(t,0))&&sCe(J2(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=J2(t,l),!u5(u))return T2;m=m&&dG(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=J2(t,l),u===w6)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!u5(u))return T2;m=m&&dG(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!a&&!i(t)?aCe:s===T6?T2:fG:r>9&&JK(t)?T2:a?s===T6?T2:fG:f?lCe:oCe}w(cCe,"chooseScalarStyle");function uCe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===T6?'""':"''";if(!t.noCompatMode&&(Mwt.indexOf(e)!==-1||Rwt.test(e)))return t.quotingType===T6?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return nCe(t,u)}switch(w(l,"testAmbiguity"),cCe(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!n,i)){case aCe:return e;case fG:return"'"+e.replace(/'/g,"''")+"'";case oCe:return"|"+pG(e,t.indent)+gG(uG(e,s));case lCe:return">"+pG(e,t.indent)+gG(uG(hCe(e,a),s));case T2:return'"'+dCe(e)+'"';default:throw new oc("impossible error: invalid scalar style")}})()}w(uCe,"writeScalar");function pG(t,e){var r=JK(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),s=i?"+":n?"":"-";return r+s+` -`}w(uG,"blockHeader");function hG(t){return t[t.length-1]===` -`?t.slice(0,-1):t}w(hG,"dropEndingNewline");function sCe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,r.lastIndex=u,dG(t.slice(0,u),e)})(),i=t[0]===` +`}w(pG,"blockHeader");function gG(t){return t[t.length-1]===` +`?t.slice(0,-1):t}w(gG,"dropEndingNewline");function hCe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,r.lastIndex=u,mG(t.slice(0,u),e)})(),i=t[0]===` `||t[0]===" ",s,a;a=r.exec(t);){var o=a[1],l=a[2];s=l[0]===" ",n+=o+(!i&&!s&&l!==""?` -`:"")+dG(l,e),i=s}return n}w(sCe,"foldString");function dG(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,s,a=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(s=a>i?a:o,l+=` +`:"")+mG(l,e),i=s}return n}w(hCe,"foldString");function mG(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,s,a=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(s=a>i?a:o,l+=` `+t.slice(i,s),i=s+1),a=o;return l+=` `,t.length-i>e&&a>i?l+=t.slice(i,a)+` -`+t.slice(a+1):l+=t.slice(i),l.slice(1)}w(dG,"foldLine");function aCe(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=Z2(t,i),n=Ko[r],!n&&l5(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||X3e(r);return e}w(aCe,"escapeString");function oCe(t,e,r){var n="",i=t.tag,s,a,o;for(s=0,a=r.length;s"u"&&_d(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}w(oCe,"writeFlowSequence");function fG(t,e,r,n){var i="",s=t.tag,a,o,l;for(a=0,o=r.length;a"u"&&_d(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Q9(t,e)),t.dump&&v6===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}w(fG,"writeBlockSequence");function lCe(t,e,r){var n="",i=t.tag,s=Object.keys(r),a,o,l,u,h;for(a=0,o=s.length;a1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),_d(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}w(lCe,"writeFlowMapping");function cCe(t,e,r,n){var i="",s=t.tag,a=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new ic("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,d&&(t.dump&&v6===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=Q9(t,e)),_d(t,e+1,h,!0,d)&&(t.dump&&v6===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}w(cCe,"writeBlockMapping");function pG(t,e,r){var n,i,s,a,o,l;for(i=r?t.explicitTypes:t.implicitTypes,s=0,a=i.length;s tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}w(pG,"detectType");function _d(t,e,r,n,i,s,a){t.tag=null,t.dump=r,pG(t,r,!1)||pG(t,r,!0);var o=V3e.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(cCe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(lCe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?fG(t,e-1,t.dump,i):fG(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(oCe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&iCe(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new ic("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}w(_d,"writeNode");function uCe(t,e){var r=[],n=[],i,s;for(J9(t,r,n),i=0,s=n.length;i=65536?i+=2:i++)r=J2(t,i),n=Ko[r],!n&&u5(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||tCe(r);return e}w(dCe,"escapeString");function fCe(t,e,r){var n="",i=t.tag,s,a,o;for(s=0,a=r.length;s"u"&&Nd(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}w(fCe,"writeFlowSequence");function yG(t,e,r,n){var i="",s=t.tag,a,o,l;for(a=0,o=r.length;a"u"&&Nd(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=r_(t,e)),t.dump&&w6===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}w(yG,"writeBlockSequence");function pCe(t,e,r){var n="",i=t.tag,s=Object.keys(r),a,o,l,u,h;for(a=0,o=s.length;a1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Nd(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}w(pCe,"writeFlowMapping");function gCe(t,e,r,n){var i="",s=t.tag,a=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new oc("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,d&&(t.dump&&w6===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=r_(t,e)),Nd(t,e+1,h,!0,d)&&(t.dump&&w6===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}w(gCe,"writeBlockMapping");function vG(t,e,r){var n,i,s,a,o,l;for(i=r?t.explicitTypes:t.implicitTypes,s=0,a=i.length;s tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}w(vG,"detectType");function Nd(t,e,r,n,i,s,a){t.tag=null,t.dump=r,vG(t,r,!1)||vG(t,r,!0);var o=Y3e.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(gCe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(pCe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?yG(t,e-1,t.dump,i):yG(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(fCe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&uCe(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new oc("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}w(Nd,"writeNode");function mCe(t,e){var r=[],n=[],i,s;for(n_(t,r,n),i=0,s=n.length;i{const{handDrawnSeed:e}=Ve();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),i3=w(t=>{const e=Mwt([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Mwt=w(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),KK=w(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),cr=w(t=>{const{stylesArray:e}=i3(t),r=[],n=[],i=[],s=[];return e.forEach(a=>{const o=a[0];KK(o)?r.push(a.join(":")+" !important"):(n.push(a.join(":")+" !important"),o.includes("stroke")&&i.push(a.join(":")+" !important"),o==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:s}},"styles2String"),fr=w((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ve(),{nodeBorder:i,mainBkg:s}=r,{stylesMap:a}=i3(t);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||i,seed:n,strokeWidth:((l=a.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:Rwt(a.get("stroke-dasharray"))},e)},"userNodeOverrides"),Rwt=w(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),RA={},ma={},Wle;function _wt(){return Wle||(Wle=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.BLANK_URL=ma.relativeFirstCharacters=ma.whitespaceEscapeCharsRegex=ma.urlSchemeRegex=ma.ctrlCharactersRegex=ma.htmlCtrlEntityRegex=ma.htmlEntitiesRegex=ma.invalidProtocolRegex=void 0,ma.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,ma.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ma.htmlCtrlEntityRegex=/&(newline|tab);/gi,ma.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ma.urlSchemeRegex=/^.+(:|:)/gim,ma.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,ma.relativeFirstCharacters=[".","/"],ma.BLANK_URL="about:blank"),ma}var qle;function Lwt(){if(qle)return RA;qle=1,Object.defineProperty(RA,"__esModule",{value:!0}),RA.sanitizeUrl=s;var t=_wt();function e(a){return t.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var o=a.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(a){return URL.canParse(a)}function i(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return t.BLANK_URL;var o,l=i(a.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return RA}var Xy=Lwt();function Iwt(t){return Array.isArray(t)}function Y$(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Nwt(){}function hCe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function QE(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const dCe="[object RegExp]",ZK="[object String]",QK="[object Number]",JK="[object Boolean]",eZ="[object Arguments]",fCe="[object Symbol]",pCe="[object Date]",gCe="[object Map]",mCe="[object Set]",yCe="[object Array]",vCe="[object ArrayBuffer]",bCe="[object Object]",xCe="[object DataView]",wCe="[object Uint8Array]",TCe="[object Uint8ClampedArray]",CCe="[object Uint16Array]",kCe="[object Uint32Array]",SCe="[object Int8Array]",ECe="[object Int16Array]",ACe="[object Int32Array]",MCe="[object Float32Array]",RCe="[object Float64Array]",Ule=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function tZ(t){return typeof Ule.Buffer<"u"&&Ule.Buffer.isBuffer(t)}function Dwt(t){return Number.isSafeInteger(t)&&t>=0}function _Ce(t){return t!=null&&typeof t!="function"&&Dwt(t.length)}function Owt(t){return t==="__proto__"}function ZN(t){return t==null||typeof t!="object"&&typeof t!="function"}function rZ(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Pwt(t,e){return Q2(t,void 0,t,new Map,e)}function Q2(t,e,r,n=new Map,i=void 0){const s=i==null?void 0:i(t,e,r,n);if(s!==void 0)return s;if(ZN(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const a=new Array(t.length);n.set(t,a);for(let o=0;o{if(typeof t=="object"){if(QE(t)==="[object Object]"&&typeof t.constructor!="function"){const a={};return s.set(t,a),qu(a,t,i,s),a}switch(Object.prototype.toString.call(t)){case QK:case ZK:case JK:{const a=new t.constructor(t==null?void 0:t.valueOf());return qu(a,t),a}case eZ:{const a={};return qu(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function Yle(t){return Bwt(t)}function gG(t){return t!==null&&typeof t=="object"&&QE(t)==="[object Arguments]"}function mG(t){return typeof t=="object"&&t!==null}function Fwt(t){return mG(t)&&_Ce(t)}function jk(t){return rZ(t)}function zwt(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function JE(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);const a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(JE.Cache||Map),r}JE.Cache=Map;function Vwt(t){if(ZN(t))return t;const e=QE(t);if(!Hwt(t))return{};if(Iwt(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(jk(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,s=n.byteOffset,a=n.byteLength,o=new ArrayBuffer(a),l=new Uint8Array(i,s,a);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?Wwt(i,t):j$(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((s,a)=>{i.set(a,s)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(s=>{i.add(s)}),i}if(e==="[object Arguments]"){const n=t,i={};return j$(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return qwt(r,t),j$(r,t),Gwt(r,t),r}function Hwt(t){switch(QE(t)){case eZ:case yCe:case vCe:case xCe:case JK:case pCe:case MCe:case RCe:case SCe:case ECe:case ACe:case gCe:case QK:case bCe:case dCe:case mCe:case ZK:case fCe:case wCe:case TCe:case CCe:case kCe:return!0;default:return!1}}function j$(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function Gwt(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function qwt(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function Uwt(t){if(ZN(t))return t;if(Array.isArray(t)||rZ(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function Ywt(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let s=0;sr!=="constructor").length===0:e.length===0}return!0}var LCe="​",Xwt={curveBasis:m6,curveBasisClosed:p4t,curveBasisOpen:g4t,curveBumpX:u5e,curveBumpY:h5e,curveBundle:m4t,curveCardinalClosed:y4t,curveCardinalOpen:v4t,curveCardinal:g5e,curveCatmullRomClosed:b4t,curveCatmullRomOpen:x4t,curveCatmullRom:y5e,curveLinear:Yk,curveLinearClosed:w4t,curveMonotoneX:C5e,curveMonotoneY:k5e,curveNatural:E5e,curveStep:A5e,curveStepAfter:R5e,curveStepBefore:M5e},Kwt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Zwt=w(function(t,e){const r=ICe(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);k9(a),n=sa(n,[...a])}else n=r.args;if(!n)return;let i=bK(t,e);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),ICe=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${Kwt.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),de.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let s;const a=[];for(;(s=qk.exec(t))!==null;)if(s.index===qk.lastIndex&&qk.lastIndex++,s&&!e||e&&((r=s[1])!=null&&r.match(e))||e&&((n=s[2])!=null&&n.match(e))){const o=s[1]?s[1]:s[2],l=s[3]?s[3].trim():s[4]?JSON.parse(s[4].trim()):null;a.push({type:o,args:l})}return a.length===0?{type:t,args:null}:a.length===1?a[0]:a}catch(i){return de.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),Qwt=w(function(t){return t.replace(qk,"")},"removeDirectives"),Jwt=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function nZ(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Xwt[r]??e}w(nZ,"interpolateToCurve");function NCe(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Xy.sanitizeUrl(r):r}w(NCe,"formatUrl");var eTt=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let s=window;for(let a=0;a{r+=iZ(i,e),e=i});const n=r/2;return sZ(t,n)}w(DCe,"traverseEdge");function OCe(t){return t.length===1?t[0]:DCe(t)}w(OCe,"calcLabelPosition");var Xle=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),sZ=w((t,e)=>{let r,n=e;for(const i of t){if(r){const s=iZ(i,r);if(s===0)return r;if(s=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:Xle((1-a)*r.x+a*i.x,5),y:Xle((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),tTt=w((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=sZ(e,25),s=t?10:5,a=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(a)*s+(e[0].x+i.x)/2,o.y=-Math.cos(a)*s+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function PCe(t,e,r){const n=structuredClone(r);de.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,s=sZ(n,i),a=10+t*.5,o=Math.atan2(n[0].y-s.y,n[0].x-s.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o+Math.PI)*a+(n[0].y+s.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o-Math.PI)*a+(n[0].y+s.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2-5):(l.x=Math.sin(o)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2),l}w(PCe,"calcTerminalLabelPosition");function aZ(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}w(aZ,"getStylesFromArray");var Kle=0,$Ce=w(()=>(Kle++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Kle),"generateId");function BCe(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iBCe(t.length),"random"),rTt=w(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"),nTt=w(function(t,e){const r=e.text.replace(Vt.lineBreakRegex," "),[,n]=B0(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const s=i.append("tspan");return s.attr("x",e.x+e.textMargin*2),s.attr("fill",e.fill),s.text(r),i},"drawSimpleText"),Xk=JE((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Vt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let s="";return n.forEach((a,o)=>{const l=Cl(`${a} `,r),u=Cl(s,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=iTt(a,e,"-",r);i.push(s,...f),s=p}else u+l>=e?(i.push(s),s=a):s=[s,a].filter(Boolean).join(" ");o+1===n.length&&i.push(s)}),i.filter(a=>a!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),iTt=JE((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],s=[];let a="";return i.forEach((o,l)=>{const u=`${a}${o}`;if(Cl(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;s.push(f?u:p),a=""}else a=u}),{hyphenatedStrings:s,remainingWord:a}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function e_(t,e){return QN(t,e).height}w(e_,"calculateTextHeight");function Cl(t,e){return QN(t,e).width}w(Cl,"calculateTextWidth");var QN=JE((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,s]=B0(r),a=["sans-serif",n],o=t.split(Vt.lineBreakRegex),l=[],u=wt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of a){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=rTt();y.text=m||LCe;const v=nTt(h,y).style("font-size",s).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),ox,sTt=(ox=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(ox,"InitIDGenerator"),ox),_A,aTt=w(function(t){return _A=_A||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),_A.innerHTML=t,unescape(_A.textContent)},"entityDecode");function oZ(t){return"str"in t}w(oZ,"isDetailedError");var oTt=w((t,e,r,n)=>{var s;if(!n)return;const i=(s=t.node())==null?void 0:s.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),B0=w(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function es(t,e){return jwt({},t,e)}w(es,"cleanAndMerge");var Kr={assignWithDepth:sa,wrapLabel:Xk,calculateTextHeight:e_,calculateTextWidth:Cl,calculateTextDimensions:QN,cleanAndMerge:es,detectInit:Zwt,detectDirective:ICe,isSubstringInArray:Jwt,interpolateToCurve:nZ,calcLabelPosition:OCe,calcCardinalityPosition:tTt,calcTerminalLabelPosition:PCe,formatUrl:NCe,getStylesFromArray:aZ,generateId:$Ce,random:FCe,runFunc:eTt,entityDecode:aTt,insertTitle:oTt,isLabelCoordinateInPath:zCe,parseFontSize:B0,InitIDGenerator:sTt},lTt=w(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),h0=w(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Mb=w((t,e,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function ja(t){return t??null}w(ja,"handleUndefinedAttr");function zCe(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return i.includes(r.toString())||i.includes(n.toString())}w(zCe,"isLabelCoordinateInPath");var s3=w(({flowchart:t})=>{var i,s;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((s=t==null?void 0:t.subGraphTitleMargin)==null?void 0:s.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function lZ(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(s=>{function a(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Ve().fontSize?Ve().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Sn.fontSize]=B0(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";s(i)}w(a,"setupImage"),setTimeout(()=>{i.complete&&a()}),i.addEventListener("error",a),i.addEventListener("load",a)})))}w(lZ,"configureLabelImages");const cTt=Object.freeze({left:0,top:0,width:16,height:16}),t_=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),VCe=Object.freeze({...cTt,...t_}),uTt=Object.freeze({...VCe,body:"",hidden:!1}),hTt=Object.freeze({width:null,height:null}),dTt=Object.freeze({...hTt,...t_}),fTt=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return X$(u)?u:null}const s=i[0],a=s.split("-");if(a.length>1){const o={provider:n,prefix:a.shift(),name:a.join("-")};return X$(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return X$(o,r)?o:null}return null},X$=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function pTt(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function Zle(t,e){const r=pTt(t,e);for(const n in uTt)n in t_?n in t&&!(n in r)&&(r[n]=t_[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function gTt(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function s(a){if(r[a])return i[a]=[];if(!(a in i)){i[a]=null;const o=n[a]&&n[a].parent,l=o&&s(o);l&&(i[a]=[o].concat(l))}return i[a]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(s),i}function Qle(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let s={};function a(o){s=Zle(n[o]||i[o],s)}return a(e),r.forEach(a),Zle(t,s)}function mTt(t,e){if(t.icons[e])return Qle(t,e,[]);const r=gTt(t,[e])[e];return r?Qle(t,e,r):null}const yTt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,vTt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Jle(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(yTt);if(n===null||!n.length)return t;const i=[];let s=n.shift(),a=vTt.test(s);for(;;){if(a){const o=parseFloat(s);isNaN(o)?i.push(s):i.push(Math.ceil(o*e*r)/r)}else i.push(s);if(s=n.shift(),s===void 0)return i.join("");a=!a}}function bTt(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),s=t.indexOf("",s);if(a===-1)break;r+=t.slice(i+1,s).trim(),t=t.slice(0,n).trim()+t.slice(a+1)}return{defs:r,content:t}}function xTt(t,e){return t?""+t+""+e:e}function wTt(t,e,r){const n=bTt(t);return xTt(n.defs,e+n.content+r)}const TTt=t=>t==="unset"||t==="undefined"||t==="none";function CTt(t,e){const r={...VCe,...t},n={...dTt,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let T;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:T=i.height/2+i.top,y.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:T=i.width/2+i.left,y.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")")}b%2===1&&(i.left!==i.top&&(T=i.left,i.left=i.top,i.top=T),i.width!==i.height&&(T=i.width,i.width=i.height,i.height=T)),y.length&&(s=wTt(s,'',""))});const a=n.width,o=n.height,l=i.width,u=i.height;let h,d;a===null?(d=o===null?"1em":o==="auto"?u:o,h=Jle(d,l/u)):(h=a==="auto"?l:a,d=o===null?Jle(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{TTt(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const kTt=/\sid="(\S+)"/g,ece=new Map;function STt(t){t=t.replace(/[0-9]+$/,"")||"a";const e=ece.get(t)||0;return ece.set(t,e+1),e?`${t}${e}`:t}function ETt(t){const e=[];let r;for(;r=kTt.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const s=STt(i),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function ATt(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var HCe={body:'?',height:80,width:80},yG=new Map,GCe=new Map,cZ=w(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(de.debug("Registering icon pack:",e.name),"loader"in e)GCe.set(e.name,e.loader);else if("icons"in e)yG.set(e.name,e.icons);else throw de.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),WCe=w(async(t,e)=>{const r=fTt(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=yG.get(n);if(!i){const a=GCe.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},yG.set(n,i)}catch(o){throw de.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=mTt(i,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),MTt=w(async t=>{try{return await WCe(t),!0}catch{return!1}},"isIconAvailable"),d0=w(async(t,e,r)=>{let n;try{n=await WCe(t,e==null?void 0:e.fallbackPrefix)}catch(a){de.error(a),n=HCe}const i=CTt(n,e),s=ATt(ETt(i.body),{...i.attributes,...r});return Ln(s,vr())},"getIconSVG");function uZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ky=uZ();function qCe(t){Ky=t}var Kk={exec:()=>null};function ii(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(yl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var RTt=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},_Tt=/^(?:[ \t]*(?:\n|$))+/,LTt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ITt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,e7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,NTt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hZ=/(?:[*+-]|\d{1,9}[.)])/,UCe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,YCe=ii(UCe).replace(/bull/g,hZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),DTt=ii(UCe).replace(/bull/g,hZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),dZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,OTt=/^[^\n]+/,fZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,PTt=ii(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$Tt=ii(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hZ).getRegex(),JN="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,BTt=ii("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",pZ).replace("tag",JN).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jCe=ii(dZ).replace("hr",e7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",JN).getRegex(),FTt=ii(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jCe).getRegex(),gZ={blockquote:FTt,code:LTt,def:PTt,fences:ITt,heading:NTt,hr:e7,html:BTt,lheading:YCe,list:$Tt,newline:_Tt,paragraph:jCe,table:Kk,text:OTt},tce=ii("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",e7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",JN).getRegex(),zTt={...gZ,lheading:DTt,table:tce,paragraph:ii(dZ).replace("hr",e7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tce).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",JN).getRegex()},VTt={...gZ,html:ii(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pZ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Kk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ii(dZ).replace("hr",e7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",YCe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},HTt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,GTt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,XCe=/^( {2,}|\\)\n(?!\s*$)/,WTt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",RTt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),QCe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,XTt=ii(QCe,"u").replace(/punct/g,eD).getRegex(),KTt=ii(QCe,"u").replace(/punct/g,ZCe).getRegex(),JCe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ZTt=ii(JCe,"gu").replace(/notPunctSpace/g,KCe).replace(/punctSpace/g,mZ).replace(/punct/g,eD).getRegex(),QTt=ii(JCe,"gu").replace(/notPunctSpace/g,YTt).replace(/punctSpace/g,UTt).replace(/punct/g,ZCe).getRegex(),JTt=ii("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,KCe).replace(/punctSpace/g,mZ).replace(/punct/g,eD).getRegex(),e5t=ii(/\\(punct)/,"gu").replace(/punct/g,eD).getRegex(),t5t=ii(/^<(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(),r5t=ii(pZ).replace("(?:-->|$)","-->").getRegex(),n5t=ii("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",r5t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),r_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,i5t=ii(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",r_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),eke=ii(/^!?\[(label)\]\[(ref)\]/).replace("label",r_).replace("ref",fZ).getRegex(),tke=ii(/^!?\[(ref)\](?:\[\])?/).replace("ref",fZ).getRegex(),s5t=ii("reflink|nolink(?!\\()","g").replace("reflink",eke).replace("nolink",tke).getRegex(),rce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,yZ={_backpedal:Kk,anyPunctuation:e5t,autolink:t5t,blockSkip:jTt,br:XCe,code:GTt,del:Kk,emStrongLDelim:XTt,emStrongRDelimAst:ZTt,emStrongRDelimUnd:JTt,escape:HTt,link:i5t,nolink:tke,punctuation:qTt,reflink:eke,reflinkSearch:s5t,tag:n5t,text:WTt,url:Kk},a5t={...yZ,link:ii(/^!?\[(label)\]\((.*?)\)/).replace("label",r_).getRegex(),reflink:ii(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r_).getRegex()},vG={...yZ,emStrongRDelimAst:QTt,emStrongLDelim:KTt,url:ii(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",rce).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:ii(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},nce=t=>l5t[t];function Hh(t,e){if(e){if(yl.escapeTest.test(t))return t.replace(yl.escapeReplace,nce)}else if(yl.escapeTestNoEncode.test(t))return t.replace(yl.escapeReplaceNoEncode,nce);return t}function ice(t){try{t=encodeURI(t).replace(yl.percentDecode,"%")}catch{return null}return t}function sce(t,e){var s;let r=t.replace(yl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(yl.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function ace(t,e,r,n,i){let s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function u5t(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +*/var Nwt=w(t=>{const{handDrawnSeed:e}=Ve();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),o3=w(t=>{const e=Dwt([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Dwt=w(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),eZ=w(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),cr=w(t=>{const{stylesArray:e}=o3(t),r=[],n=[],i=[],s=[];return e.forEach(a=>{const o=a[0];eZ(o)?r.push(a.join(":")+" !important"):(n.push(a.join(":")+" !important"),o.includes("stroke")&&i.push(a.join(":")+" !important"),o==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:s}},"styles2String"),fr=w((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ve(),{nodeBorder:i,mainBkg:s}=r,{stylesMap:a}=o3(t);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||i,seed:n,strokeWidth:((l=a.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:Owt(a.get("stroke-dasharray"))},e)},"userNodeOverrides"),Owt=w(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),IA={},ma={},jle;function Pwt(){return jle||(jle=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.BLANK_URL=ma.relativeFirstCharacters=ma.whitespaceEscapeCharsRegex=ma.urlSchemeRegex=ma.ctrlCharactersRegex=ma.htmlCtrlEntityRegex=ma.htmlEntitiesRegex=ma.invalidProtocolRegex=void 0,ma.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,ma.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ma.htmlCtrlEntityRegex=/&(newline|tab);/gi,ma.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ma.urlSchemeRegex=/^.+(:|:)/gim,ma.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,ma.relativeFirstCharacters=[".","/"],ma.BLANK_URL="about:blank"),ma}var Xle;function $wt(){if(Xle)return IA;Xle=1,Object.defineProperty(IA,"__esModule",{value:!0}),IA.sanitizeUrl=s;var t=Pwt();function e(a){return t.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var o=a.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(a){return URL.canParse(a)}function i(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return t.BLANK_URL;var o,l=i(a.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return IA}var Zy=$wt();function Bwt(t){return Array.isArray(t)}function K$(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Fwt(){}function yCe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function t7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const vCe="[object RegExp]",tZ="[object String]",rZ="[object Number]",nZ="[object Boolean]",iZ="[object Arguments]",bCe="[object Symbol]",xCe="[object Date]",wCe="[object Map]",TCe="[object Set]",CCe="[object Array]",kCe="[object ArrayBuffer]",SCe="[object Object]",ECe="[object DataView]",ACe="[object Uint8Array]",MCe="[object Uint8ClampedArray]",RCe="[object Uint16Array]",_Ce="[object Uint32Array]",LCe="[object Int8Array]",ICe="[object Int16Array]",NCe="[object Int32Array]",DCe="[object Float32Array]",OCe="[object Float64Array]",Kle=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function sZ(t){return typeof Kle.Buffer<"u"&&Kle.Buffer.isBuffer(t)}function zwt(t){return Number.isSafeInteger(t)&&t>=0}function PCe(t){return t!=null&&typeof t!="function"&&zwt(t.length)}function Vwt(t){return t==="__proto__"}function eD(t){return t==null||typeof t!="object"&&typeof t!="function"}function aZ(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Hwt(t,e){return eb(t,void 0,t,new Map,e)}function eb(t,e,r,n=new Map,i=void 0){const s=i==null?void 0:i(t,e,r,n);if(s!==void 0)return s;if(eD(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const a=new Array(t.length);n.set(t,a);for(let o=0;o{if(typeof t=="object"){if(t7(t)==="[object Object]"&&typeof t.constructor!="function"){const a={};return s.set(t,a),ju(a,t,i,s),a}switch(Object.prototype.toString.call(t)){case rZ:case tZ:case nZ:{const a=new t.constructor(t==null?void 0:t.valueOf());return ju(a,t),a}case iZ:{const a={};return ju(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function Zle(t){return Wwt(t)}function bG(t){return t!==null&&typeof t=="object"&&t7(t)==="[object Arguments]"}function xG(t){return typeof t=="object"&&t!==null}function qwt(t){return xG(t)&&PCe(t)}function Zk(t){return aZ(t)}function Uwt(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function r7(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);const a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(r7.Cache||Map),r}r7.Cache=Map;function Ywt(t){if(eD(t))return t;const e=t7(t);if(!jwt(t))return{};if(Bwt(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(Zk(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,s=n.byteOffset,a=n.byteLength,o=new ArrayBuffer(a),l=new Uint8Array(i,s,a);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?Kwt(i,t):Z$(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((s,a)=>{i.set(a,s)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(s=>{i.add(s)}),i}if(e==="[object Arguments]"){const n=t,i={};return Z$(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return Zwt(r,t),Z$(r,t),Xwt(r,t),r}function jwt(t){switch(t7(t)){case iZ:case CCe:case kCe:case ECe:case nZ:case xCe:case DCe:case OCe:case LCe:case ICe:case NCe:case wCe:case rZ:case SCe:case vCe:case TCe:case tZ:case bCe:case ACe:case MCe:case RCe:case _Ce:return!0;default:return!1}}function Z$(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function Xwt(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function Zwt(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function Qwt(t){if(eD(t))return t;if(Array.isArray(t)||aZ(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function Jwt(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let s=0;sr!=="constructor").length===0:e.length===0}return!0}var $Ce="​",tTt={curveBasis:b6,curveBasisClosed:x4t,curveBasisOpen:w4t,curveBumpX:m5e,curveBumpY:y5e,curveBundle:T4t,curveCardinalClosed:C4t,curveCardinalOpen:k4t,curveCardinal:w5e,curveCatmullRomClosed:S4t,curveCatmullRomOpen:E4t,curveCatmullRom:C5e,curveLinear:Kk,curveLinearClosed:A4t,curveMonotoneX:R5e,curveMonotoneY:_5e,curveNatural:I5e,curveStep:N5e,curveStepAfter:O5e,curveStepBefore:D5e},rTt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,nTt=w(function(t,e){const r=BCe(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);M9(a),n=sa(n,[...a])}else n=r.args;if(!n)return;let i=CK(t,e);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),BCe=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${rTt.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),de.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let s;const a=[];for(;(s=jk.exec(t))!==null;)if(s.index===jk.lastIndex&&jk.lastIndex++,s&&!e||e&&((r=s[1])!=null&&r.match(e))||e&&((n=s[2])!=null&&n.match(e))){const o=s[1]?s[1]:s[2],l=s[3]?s[3].trim():s[4]?JSON.parse(s[4].trim()):null;a.push({type:o,args:l})}return a.length===0?{type:t,args:null}:a.length===1?a[0]:a}catch(i){return de.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),iTt=w(function(t){return t.replace(jk,"")},"removeDirectives"),sTt=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function oZ(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return tTt[r]??e}w(oZ,"interpolateToCurve");function FCe(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Zy.sanitizeUrl(r):r}w(FCe,"formatUrl");var aTt=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let s=window;for(let a=0;a{r+=lZ(i,e),e=i});const n=r/2;return cZ(t,n)}w(zCe,"traverseEdge");function VCe(t){return t.length===1?t[0]:zCe(t)}w(VCe,"calcLabelPosition");var Jle=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),cZ=w((t,e)=>{let r,n=e;for(const i of t){if(r){const s=lZ(i,r);if(s===0)return r;if(s=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:Jle((1-a)*r.x+a*i.x,5),y:Jle((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),oTt=w((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=cZ(e,25),s=t?10:5,a=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(a)*s+(e[0].x+i.x)/2,o.y=-Math.cos(a)*s+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function HCe(t,e,r){const n=structuredClone(r);de.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,s=cZ(n,i),a=10+t*.5,o=Math.atan2(n[0].y-s.y,n[0].x-s.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o+Math.PI)*a+(n[0].y+s.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o-Math.PI)*a+(n[0].y+s.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2-5):(l.x=Math.sin(o)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2),l}w(HCe,"calcTerminalLabelPosition");function uZ(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}w(uZ,"getStylesFromArray");var ece=0,GCe=w(()=>(ece++,"id-"+Math.random().toString(36).substr(2,12)+"-"+ece),"generateId");function WCe(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iWCe(t.length),"random"),lTt=w(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"),cTt=w(function(t,e){const r=e.text.replace(Vt.lineBreakRegex," "),[,n]=H0(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const s=i.append("tspan");return s.attr("x",e.x+e.textMargin*2),s.attr("fill",e.fill),s.text(r),i},"drawSimpleText"),Qk=r7((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Vt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let s="";return n.forEach((a,o)=>{const l=Sl(`${a} `,r),u=Sl(s,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=uTt(a,e,"-",r);i.push(s,...f),s=p}else u+l>=e?(i.push(s),s=a):s=[s,a].filter(Boolean).join(" ");o+1===n.length&&i.push(s)}),i.filter(a=>a!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),uTt=r7((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],s=[];let a="";return i.forEach((o,l)=>{const u=`${a}${o}`;if(Sl(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;s.push(f?u:p),a=""}else a=u}),{hyphenatedStrings:s,remainingWord:a}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function i_(t,e){return tD(t,e).height}w(i_,"calculateTextHeight");function Sl(t,e){return tD(t,e).width}w(Sl,"calculateTextWidth");var tD=r7((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,s]=H0(r),a=["sans-serif",n],o=t.split(Vt.lineBreakRegex),l=[],u=wt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of a){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=lTt();y.text=m||$Ce;const v=cTt(h,y).style("font-size",s).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),cx,hTt=(cx=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(cx,"InitIDGenerator"),cx),NA,dTt=w(function(t){return NA=NA||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),NA.innerHTML=t,unescape(NA.textContent)},"entityDecode");function hZ(t){return"str"in t}w(hZ,"isDetailedError");var fTt=w((t,e,r,n)=>{var s;if(!n)return;const i=(s=t.node())==null?void 0:s.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),H0=w(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function es(t,e){return eTt({},t,e)}w(es,"cleanAndMerge");var Kr={assignWithDepth:sa,wrapLabel:Qk,calculateTextHeight:i_,calculateTextWidth:Sl,calculateTextDimensions:tD,cleanAndMerge:es,detectInit:nTt,detectDirective:BCe,isSubstringInArray:sTt,interpolateToCurve:oZ,calcLabelPosition:VCe,calcCardinalityPosition:oTt,calcTerminalLabelPosition:HCe,formatUrl:FCe,getStylesFromArray:uZ,generateId:GCe,random:qCe,runFunc:aTt,entityDecode:dTt,insertTitle:fTt,isLabelCoordinateInPath:UCe,parseFontSize:H0,InitIDGenerator:hTt},pTt=w(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),g0=w(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),_b=w((t,e,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function ja(t){return t??null}w(ja,"handleUndefinedAttr");function UCe(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return i.includes(r.toString())||i.includes(n.toString())}w(UCe,"isLabelCoordinateInPath");var l3=w(({flowchart:t})=>{var i,s;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((s=t==null?void 0:t.subGraphTitleMargin)==null?void 0:s.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function dZ(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(s=>{function a(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Ve().fontSize?Ve().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Sn.fontSize]=H0(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";s(i)}w(a,"setupImage"),setTimeout(()=>{i.complete&&a()}),i.addEventListener("error",a),i.addEventListener("load",a)})))}w(dZ,"configureLabelImages");const gTt=Object.freeze({left:0,top:0,width:16,height:16}),s_=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),YCe=Object.freeze({...gTt,...s_}),mTt=Object.freeze({...YCe,body:"",hidden:!1}),yTt=Object.freeze({width:null,height:null}),vTt=Object.freeze({...yTt,...s_}),bTt=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return Q$(u)?u:null}const s=i[0],a=s.split("-");if(a.length>1){const o={provider:n,prefix:a.shift(),name:a.join("-")};return Q$(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return Q$(o,r)?o:null}return null},Q$=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function xTt(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function tce(t,e){const r=xTt(t,e);for(const n in mTt)n in s_?n in t&&!(n in r)&&(r[n]=s_[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function wTt(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function s(a){if(r[a])return i[a]=[];if(!(a in i)){i[a]=null;const o=n[a]&&n[a].parent,l=o&&s(o);l&&(i[a]=[o].concat(l))}return i[a]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(s),i}function rce(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let s={};function a(o){s=tce(n[o]||i[o],s)}return a(e),r.forEach(a),tce(t,s)}function TTt(t,e){if(t.icons[e])return rce(t,e,[]);const r=wTt(t,[e])[e];return r?rce(t,e,r):null}const CTt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,kTt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function nce(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(CTt);if(n===null||!n.length)return t;const i=[];let s=n.shift(),a=kTt.test(s);for(;;){if(a){const o=parseFloat(s);isNaN(o)?i.push(s):i.push(Math.ceil(o*e*r)/r)}else i.push(s);if(s=n.shift(),s===void 0)return i.join("");a=!a}}function STt(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),s=t.indexOf("",s);if(a===-1)break;r+=t.slice(i+1,s).trim(),t=t.slice(0,n).trim()+t.slice(a+1)}return{defs:r,content:t}}function ETt(t,e){return t?""+t+""+e:e}function ATt(t,e,r){const n=STt(t);return ETt(n.defs,e+n.content+r)}const MTt=t=>t==="unset"||t==="undefined"||t==="none";function RTt(t,e){const r={...YCe,...t},n={...vTt,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let T;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:T=i.height/2+i.top,y.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:T=i.width/2+i.left,y.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")")}b%2===1&&(i.left!==i.top&&(T=i.left,i.left=i.top,i.top=T),i.width!==i.height&&(T=i.width,i.width=i.height,i.height=T)),y.length&&(s=ATt(s,'',""))});const a=n.width,o=n.height,l=i.width,u=i.height;let h,d;a===null?(d=o===null?"1em":o==="auto"?u:o,h=nce(d,l/u)):(h=a==="auto"?l:a,d=o===null?nce(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{MTt(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const _Tt=/\sid="(\S+)"/g,ice=new Map;function LTt(t){t=t.replace(/[0-9]+$/,"")||"a";const e=ice.get(t)||0;return ice.set(t,e+1),e?`${t}${e}`:t}function ITt(t){const e=[];let r;for(;r=_Tt.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const s=LTt(i),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function NTt(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var jCe={body:'?',height:80,width:80},wG=new Map,XCe=new Map,fZ=w(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(de.debug("Registering icon pack:",e.name),"loader"in e)XCe.set(e.name,e.loader);else if("icons"in e)wG.set(e.name,e.icons);else throw de.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),KCe=w(async(t,e)=>{const r=bTt(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=wG.get(n);if(!i){const a=XCe.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},wG.set(n,i)}catch(o){throw de.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=TTt(i,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),DTt=w(async t=>{try{return await KCe(t),!0}catch{return!1}},"isIconAvailable"),m0=w(async(t,e,r)=>{let n;try{n=await KCe(t,e==null?void 0:e.fallbackPrefix)}catch(a){de.error(a),n=jCe}const i=RTt(n,e),s=NTt(ITt(i.body),{...i.attributes,...r});return Ln(s,br())},"getIconSVG");function pZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Qy=pZ();function ZCe(t){Qy=t}var Jk={exec:()=>null};function si(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(bl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var OTt=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},PTt=/^(?:[ \t]*(?:\n|$))+/,$Tt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,BTt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,n7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,FTt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gZ=/(?:[*+-]|\d{1,9}[.)])/,QCe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,JCe=si(QCe).replace(/bull/g,gZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),zTt=si(QCe).replace(/bull/g,gZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,VTt=/^[^\n]+/,yZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,HTt=si(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",yZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),GTt=si(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,gZ).getRegex(),rD="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,WTt=si("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vZ).replace("tag",rD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eke=si(mZ).replace("hr",n7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rD).getRegex(),qTt=si(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eke).getRegex(),bZ={blockquote:qTt,code:$Tt,def:HTt,fences:BTt,heading:FTt,hr:n7,html:WTt,lheading:JCe,list:GTt,newline:PTt,paragraph:eke,table:Jk,text:VTt},sce=si("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",n7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rD).getRegex(),UTt={...bZ,lheading:zTt,table:sce,paragraph:si(mZ).replace("hr",n7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",sce).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rD).getRegex()},YTt={...bZ,html:si(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vZ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:si(mZ).replace("hr",n7).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",JCe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jTt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,XTt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tke=/^( {2,}|\\)\n(?!\s*$)/,KTt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",OTt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ike=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,t5t=si(ike,"u").replace(/punct/g,nD).getRegex(),r5t=si(ike,"u").replace(/punct/g,nke).getRegex(),ske="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",n5t=si(ske,"gu").replace(/notPunctSpace/g,rke).replace(/punctSpace/g,xZ).replace(/punct/g,nD).getRegex(),i5t=si(ske,"gu").replace(/notPunctSpace/g,JTt).replace(/punctSpace/g,QTt).replace(/punct/g,nke).getRegex(),s5t=si("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,rke).replace(/punctSpace/g,xZ).replace(/punct/g,nD).getRegex(),a5t=si(/\\(punct)/,"gu").replace(/punct/g,nD).getRegex(),o5t=si(/^<(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(),l5t=si(vZ).replace("(?:-->|$)","-->").getRegex(),c5t=si("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",l5t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),a_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,u5t=si(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",a_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ake=si(/^!?\[(label)\]\[(ref)\]/).replace("label",a_).replace("ref",yZ).getRegex(),oke=si(/^!?\[(ref)\](?:\[\])?/).replace("ref",yZ).getRegex(),h5t=si("reflink|nolink(?!\\()","g").replace("reflink",ake).replace("nolink",oke).getRegex(),ace=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wZ={_backpedal:Jk,anyPunctuation:a5t,autolink:o5t,blockSkip:e5t,br:tke,code:XTt,del:Jk,emStrongLDelim:t5t,emStrongRDelimAst:n5t,emStrongRDelimUnd:s5t,escape:jTt,link:u5t,nolink:oke,punctuation:ZTt,reflink:ake,reflinkSearch:h5t,tag:c5t,text:KTt,url:Jk},d5t={...wZ,link:si(/^!?\[(label)\]\((.*?)\)/).replace("label",a_).getRegex(),reflink:si(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",a_).getRegex()},TG={...wZ,emStrongRDelimAst:i5t,emStrongLDelim:r5t,url:si(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ace).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:si(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},oce=t=>p5t[t];function qh(t,e){if(e){if(bl.escapeTest.test(t))return t.replace(bl.escapeReplace,oce)}else if(bl.escapeTestNoEncode.test(t))return t.replace(bl.escapeReplaceNoEncode,oce);return t}function lce(t){try{t=encodeURI(t).replace(bl.percentDecode,"%")}catch{return null}return t}function cce(t,e){var s;let r=t.replace(bl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(bl.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function uce(t,e,r,n,i){let s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function m5t(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(` -`)}var n_=class{constructor(e){br(this,"options");br(this,"rules");br(this,"lexer");this.options=e||Ky}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Q3(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=u5t(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Q3(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Q3(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Q3(r[0],` +`)}var o_=class{constructor(e){xr(this,"options");xr(this,"rules");xr(this,"lexer");this.options=e||Qy}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:tC(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=m5t(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=tC(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:tC(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=tC(r[0],` `).split(` `),i="",s="",a=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u=m||!p.trim())d+=` `+E.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(f)||C.test(f)||b.test(f))break;d+=` `+p}!g&&!p.trim()&&(g=!0),h+=k+` -`,e=e.substring(k.length+1),f=E.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[h]})));return a}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Q3(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=c5t(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),ace(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return ace(n,s,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,s+i.index+d+o);if(Math.min(s,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let a;do a=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(a!==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(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Qu=class bG{constructor(e){br(this,"tokens");br(this,"options");br(this,"state");br(this,"tokenizer");br(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ky,this.options.tokenizer=this.options.tokenizer||new n_,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:yl,block:LA.normal,inline:Z3.normal};this.options.pedantic?(r.block=LA.pedantic,r.inline=Z3.pedantic):this.options.gfm&&(r.block=LA.gfm,this.options.breaks?r.inline=Z3.breaks:r.inline=Z3.gfm),this.tokenizer.rules=r}static get rules(){return{block:LA,inline:Z3}}static lex(e,r){return new bG(r).lex(e)}static lexInline(e,r){return new bG(r).inlineTokens(e)}lex(e){e=e.replace(yl.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` +`,e=e.substring(k.length+1),f=E.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[h]})));return a}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=tC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=g5t(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),uce(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return uce(n,s,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,s+i.index+d+o);if(Math.min(s,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let a;do a=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(a!==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(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},th=class CG{constructor(e){xr(this,"tokens");xr(this,"options");xr(this,"state");xr(this,"tokenizer");xr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Qy,this.options.tokenizer=this.options.tokenizer||new o_,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:bl,block:DA.normal,inline:eC.normal};this.options.pedantic?(r.block=DA.pedantic,r.inline=eC.pedantic):this.options.gfm&&(r.block=DA.gfm,this.options.breaks?r.inline=eC.breaks:r.inline=eC.gfm),this.tokenizer.rules=r}static get rules(){return{block:DA,inline:eC}}static lex(e,r){return new CG(r).lex(e)}static lexInline(e,r){return new CG(r).inlineTokens(e)}lex(e){e=e.replace(bl.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` @@ -1134,16 +1134,16 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let a=!1,o="";for(;e;){a||(o=""),a=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),a=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},i_=class{constructor(e){br(this,"options");br(this,"parser");this.options=e||Ky}space(e){return""}code({text:e,lang:r,escaped:n}){var a;let i=(a=(r||"").match(yl.notSpaceStart))==null?void 0:a[0],s=e.replace(yl.endingNewline,"")+` -`;return i?'
'+(n?s:Hh(s,!0))+`
-`:"
"+(n?s:Hh(s,!0))+`
+`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let a=!1,o="";for(;e;){a||(o=""),a=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),a=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},l_=class{constructor(e){xr(this,"options");xr(this,"parser");this.options=e||Qy}space(e){return""}code({text:e,lang:r,escaped:n}){var a;let i=(a=(r||"").match(bl.notSpaceStart))==null?void 0:a[0],s=e.replace(bl.endingNewline,"")+` +`;return i?'
'+(n?s:qh(s,!0))+`
+`:"
"+(n?s:qh(s,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o `+i+" -`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+Hh(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • +`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+qh(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let r="",n="";for(let s=0;s${i}`),` @@ -1152,28 +1152,28 @@ ${this.parser.parse(e)} `}tablerow({text:e}){return` ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Hh(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),s=ice(e);if(s===null)return i;e=s;let a='",a}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=ice(e);if(s===null)return Hh(n);e=s;let a=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new i_(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new n_(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new qC;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];qC.passThroughHooks.has(a)?s[o]=h=>{if(this.defaults.async&&qC.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return u.call(s,f)})();let d=l.call(s,h);return u.call(s,d)}:s[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await u.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Qu.lex(e,r??this.defaults)}parser(e,r){return Ju.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():e?Qu.lex:Qu.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?Ju.parse:Ju.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer():e?Qu.lex:Qu.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():e?Ju.parse:Ju.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+Hh(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Cy=new h5t;function di(t,e){return Cy.parse(t,e)}di.options=di.setOptions=function(t){return Cy.setOptions(t),di.defaults=Cy.defaults,qCe(di.defaults),di};di.getDefaults=uZ;di.defaults=Ky;di.use=function(...t){return Cy.use(...t),di.defaults=Cy.defaults,qCe(di.defaults),di};di.walkTokens=function(t,e){return Cy.walkTokens(t,e)};di.parseInline=Cy.parseInline;di.Parser=Ju;di.parser=Ju.parse;di.Renderer=i_;di.TextRenderer=vZ;di.Lexer=Qu;di.lexer=Qu.lex;di.Tokenizer=n_;di.Hooks=qC;di.parse=di;di.options;di.setOptions;di.use;di.walkTokens;di.parseInline;Ju.parse;Qu.lex;function rke(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${qh(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),s=lce(e);if(s===null)return i;e=s;let a='
    ",a}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=lce(e);if(s===null)return qh(n);e=s;let a=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new l_(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new o_(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new jC;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];jC.passThroughHooks.has(a)?s[o]=h=>{if(this.defaults.async&&jC.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return u.call(s,f)})();let d=l.call(s,h);return u.call(s,d)}:s[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await u.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return th.lex(e,r??this.defaults)}parser(e,r){return rh.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():e?th.lex:th.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?rh.parse:rh.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer():e?th.lex:th.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():e?rh.parse:rh.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+qh(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Sy=new y5t;function fi(t,e){return Sy.parse(t,e)}fi.options=fi.setOptions=function(t){return Sy.setOptions(t),fi.defaults=Sy.defaults,ZCe(fi.defaults),fi};fi.getDefaults=pZ;fi.defaults=Qy;fi.use=function(...t){return Sy.use(...t),fi.defaults=Sy.defaults,ZCe(fi.defaults),fi};fi.walkTokens=function(t,e){return Sy.walkTokens(t,e)};fi.parseInline=Sy.parseInline;fi.Parser=rh;fi.parser=rh.parse;fi.Renderer=l_;fi.TextRenderer=TZ;fi.Lexer=th;fi.lexer=th.lex;fi.Tokenizer=o_;fi.Hooks=jC;fi.parse=fi;fi.options;fi.setOptions;fi.use;fi.walkTokens;fi.parseInline;rh.parse;th.lex;function lke(t){for(var e=[],r=1;r/g,` +`)),a+=d+n[l+1]}),a}function cke(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return rke(n)}w(nke,"preprocessMarkdown");function ike(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}w(ike,"nonMarkdownToLines");function ske(t,e={}){const r=nke(t,e),n=di.lexer(r),i=[[]];let s=0;function a(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,d)=>{d!==0&&(s++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[s].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{a(u,o.type)}):o.type==="html"&&i[s].push({content:o.text,type:"normal"})}return w(a,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{a(u)}):o.type==="html"?i[s].push({content:o.text,type:"normal"}):i[s].push({content:o.raw,type:"normal"})}),i}w(ske,"markdownToLines");function ake(t){return t?`

    ${t.replace(/\\n|\n/g,"
    ")}

    `:""}w(ake,"nonMarkdownToHTML");function oke(t,{markdownAutoWrap:e}={}){const r=di.lexer(t);function n(i){var s,a,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="em"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="paragraph"?`

    ${(o=i.tokens)==null?void 0:o.map(n).join("")}

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(de.warn(`Unsupported markdown: ${i.type}`),i.raw)}return w(n,"output"),r.map(n).join("")}w(oke,"markdownToHTML");function lke(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(lke,"splitTextToChars");function cke(t,e){const r=lke(e.content);return bZ(t,[],r,e.type)}w(cke,"splitWordToFitWidth");function bZ(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...s]=r,a=[...e,i];return t([{content:a.join(""),type:n}])?bZ(t,a,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(bZ,"splitWordToFitWidthRecursion");function uke(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return s_(t,e)}w(uke,"splitLineToFitWidth");function s_(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const s=t.shift()??{content:" ",type:"normal"},a=[...n];if(i!==""&&a.push({content:i,type:"normal"}),a.push(s),e(a))return s_(t,e,r,a);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[o,l]=cke(e,s);r.push([o]),l.content&&t.unshift(l)}return s_(t,e,r)}w(s_,"splitLineToFitWidthRecursion");function wG(t,e){e&&t.attr("style",e)}w(wG,"applyStyle");var oce=16384;async function hke(t,e,r,n,i=!1,s=vr()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,oce)}px`),a.attr("height",`${Math.min(10*r,oce)}px`);const o=a.append("xhtml:div"),l=Ks(e.label)?await BN(e.label.replace(Vt.lineBreakRegex,` -`),s):Ln(e.label,s),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),wG(h,e.labelStyle),h.attr("class",`${u} ${n}`),wG(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),a.node()}w(hke,"addHtmlSpan");function tD(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}w(tD,"createTspan");function dke(t,e,r){const n=t.append("text"),i=tD(n,1,e);rD(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}w(dke,"computeWidthOfText");function fke(t,e,r){var a;const n=t.append("text"),i=tD(n,1,e);rD(i,[{content:r,type:"normal"}]);const s=(a=i.node())==null?void 0:a.getBoundingClientRect();return s&&n.remove(),s}w(fke,"computeDimensionOfText");function pke(t,e,r,n=!1,i=!1){const a=e.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=w(p=>dke(a,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:uke(h,d);for(const p of f){const g=tD(l,u,1.1,i);rD(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}w(pke,"createFormattedText");function TG(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}w(TG,"decodeHTMLEntities");function rD(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(TG(r.content)):i.text(" "+TG(r.content))})}w(rD,"updateTextContentAndStyles");async function gke(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await MTt(o)?await d0(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(gke,"replaceIconSubstring");var Zo=w(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:s=!0,markdown:a=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(de.debug("XYZ createText",e,r,n,i,s,o,"addSvgBackground: ",u),s){const d=a?oke(e,h):ake(e),f=await gke(h0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ks(e)?p:f,labelStyle:r.replace("fill:","color:")};return await hke(t,g,l,i,u,h)}else{const d=h0(e.replace(//g,"
    ")),f=a?ske(d.replace("
    ","
    "),h):ike(d),p=pke(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");wt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");wt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");wt(p).select("text").attr("style",m)}return n?wt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):wt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function K$(t,e,r){if(t&&t.length){const[n,i]=e,s=Math.PI/180*r,a=Math.cos(s),o=Math.sin(s);for(const l of t){const[u,h]=l;l[0]=(u-n)*a-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*a+i}}}function d5t(t,e){return t[0]===e[0]&&t[1]===e[1]}function f5t(t,e,r,n=1){const i=r,s=Math.max(e,.1),a=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of a)K$(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];d5t(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const T=m[x].edge,C=m[b].edge;p.push([[Math.round(T.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(a,s,n);if(i){for(const u of a)K$(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),K$(f,h,d)})(l,o,-i)}return l}function t7(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let s=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=i),f5t(t,i,n,s||1)}class xZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=t7(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function nD(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}let p5t=class extends xZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=t7(e,Object.assign({},r,{hachureGap:n})),s=Math.PI/180*r.hachureAngle,a=[],o=.5*n*Math.cos(s),l=.5*n*Math.sin(s);for(const[u,h]of i)nD([u,h])&&a.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}};class g5t extends xZ{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(e,i);return n.ops=n.ops.concat(s.ops),n}}let m5t=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=t7(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=i/4;for(const o of e){const l=nD(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=nD(a),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const a=nD(s),o=Math.round(a/(2*r));let l=s[0],u=s[1];l[0]>u[0]&&(l=s[1],u=s[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));s.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));s.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));s.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],s.push({key:"T",data:[e,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,r=i}return s}function yke(t){const e=[];let r="",n=0,i=0,s=0,a=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[s,a]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(vke(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=s,i=a}r=u}return e}function J3(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function vke(t,e,r,n,i,s,a,o,l,u){const h=(d=a,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=J3(t,e,-h),[r,n]=J3(r,n,-h);const N=(t-r)/2,L=(e-n)/2;let I=N*N/(i*i)+L*L/(s*s);I>1&&(I=Math.sqrt(I),i*=I,s*=I);const $=i*i,O=s*s,D=$*O-$*L*L-O*N*N,F=$*L*L+O*N*N,z=(o===l?-1:1)*Math.sqrt(Math.abs(D/F));m=z*i*L/s+(t+r)/2,y=z*-s*N/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/s).toFixed(9))),g=Math.asin(parseFloat(((n-y)/s).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const N=g,L=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=vke(r=m+i*Math.cos(g),n=y+s*Math.sin(g),L,I,i,s,a,0,l,[g,N,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),T=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*s*S,A=[t,e],R=[t+k*b,e-E*x],_=[r+k*C,n-E*T],P=[r,n];if(R[0]=2*A[0]-R[0],R[1]=2*A[1]-R[1],u)return[R,_,P].concat(f);{f=[R,_,P].concat(f);const N=[];for(let L=0;L2){const i=[];for(let s=0;s2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=pce(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=pce(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return a&&(o?v.push(...gg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...gg(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function hce(t,e){const r=yke(mke(wZ(t))),n=[];let i=[0,0],s=[0,0];for(const{key:a,data:o}of r)switch(a){case"M":s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...gg(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...C5t(l,u,h,d,f,p,s,e)),s=[f,p];break}case"Z":n.push(...gg(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function J$(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,s=n.length;if(s>2){r.push({op:"move",data:[n[0][0]+en(i,e),n[0][1]+en(i,e)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*wke(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=en(p,i,u),g=en(g,i,u);const m=[],y=()=>en(d,i,u),v=()=>en(h,i,u),x=i.preserveVertices;return a?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:en(h,i,u)),e+(x?0:en(h,i,u))]}),a?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(x?0:v()),n+(x?0:v())]}),m}function NA(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]),n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]);for(let i=1;i3){const s=[],a=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=Wm(l,u,.5),p=Wm(u,h,.5),g=Wm(h,d,.5),m=Wm(f,p,.5),y=Wm(p,g,.5),v=Wm(m,y,.5);SG([l,f,m,v],0,r,i),SG([v,y,g,d],0,r,i)}var s,a;return i}function S5t(t,e){return l_(t,0,t.length,e)}function l_(t,e,r,n,i){const s=i||[],a=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(l_(t,e,u+1,n,s),l_(t,u,r,n,s)):(s.length||s.push(a),s.push(o)),s}function eB(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s0?l_(n,0,n.length,r):n}const Tc="none";let c_=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,s){const a=this._o(s);return this._d("line",[bke(e,r,n,i,a)],a)}rectangle(e,r,n,i,s){const a=this._o(s),o=[],l=T5t(e,r,n,i,a);if(a.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];a.fillStyle==="solid"?o.push(J$([u],a)):o.push(Bv([u],a))}return a.stroke!==Tc&&o.push(l),this._d("rectangle",o,a)}ellipse(e,r,n,i,s){const a=this._o(s),o=[],l=xke(n,i,a),u=CG(e,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=CG(e,r,a,l).opset;h.type="fillPath",o.push(h)}else o.push(Bv([u.estimatedPoints],a));return a.stroke!==Tc&&o.push(u.opset),this._d("ellipse",o,a)}circle(e,r,n,i){const s=this.ellipse(e,r,n,n,i);return s.shape="circle",s}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[LM(e,!1,n)],n)}arc(e,r,n,i,s,a,o=!1,l){const u=this._o(l),h=[],d=uce(e,r,n,i,s,a,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=uce(e,r,n,i,s,a,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,x){const b=f,T=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=en(.01*C,x),S+=en(.01*S,x);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const A=(E-k)/x.curveStepCount,R=[];for(let _=k;_<=E;_+=A)R.push([b+C*Math.cos(_),T+S*Math.sin(_)]);return R.push([b+C*Math.cos(E),T+S*Math.sin(E)]),R.push([b,T]),Bv([R],x)})(e,r,n,i,s,a,u));return u.stroke!==Tc&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],s=cce(e,n);if(n.fill&&n.fill!==Tc)if(n.fillStyle==="solid"){const a=cce(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?a.push(...u):u.length===3?a.push(...eB(gce([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):a.push(...eB(gce(u),10,(1+n.roughness)/2))}a.length&&i.push(Bv([a],n))}return n.stroke!==Tc&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=LM(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(J$([e],n)):i.push(Bv([e],n))),n.stroke!==Tc&&i.push(s),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=n.fill&&n.fill!=="transparent"&&n.fill!==Tc,a=n.stroke!==Tc,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=yke(mke(wZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...eB(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const T=[];for(const C of g){const S=S5t(C,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=hce(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=hce(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(J$(l,n));else i.push(Bv(l,n));return a&&(o?l.forEach((h=>{i.push(LM(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const s=typeof r=="number"&&r>=0?i.data.map((a=>+a.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":n+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":n+=`L${s[0]} ${s[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Tc};break;case"fillPath":a={d:this.opsToPath(s),stroke:Tc,strokeWidth:0,fill:n.fill||Tc};break;case"fillSketch":a=this.fillSketch(s,n)}a&&i.push(a)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Tc,strokeWidth:n,fill:Tc}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class E5t{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new c_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,s=e.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,a,s),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,a,s,o),i.restore();break}case"fillSketch":this.fillSketch(i,a,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const s of r.ops){const a=typeof n=="number"&&n>=0?s.data.map((o=>+o.toFixed(n))):s.data;switch(s.op){case"move":e.moveTo(a[0],a[1]);break;case"bcurveTo":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":e.lineTo(a[0],a[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a),a}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a),a}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a),a}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s),s}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const DA="http://www.w3.org/2000/svg";class A5t{constructor(e,r){this.svg=e,this.gen=new c_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(DA,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(DA,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(DA,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&s.appendChild(l)}return s}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const s=e.createElementNS(DA,"path");return s.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),s.setAttribute("stroke",n.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),n.fillLineDash&&s.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a)}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a)}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a)}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var dr={canvas:(t,e)=>new E5t(t,e),svg:(t,e)=>new A5t(t,e),generator:t=>new c_(t),newSeed:()=>c_.newSeed()},Qr=w(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||zd((p=Ve())==null?void 0:p.htmlLabels);r?n=r:n="node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",ja(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Zo(a,Ln(h0(o),Ve()),{useHtmlLabels:i,width:e.width||((g=Ve().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Ve());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=wt(h);await lZ(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),tB=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??ui(Ve()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Zo(i,Ln(h0(e),Ve()),{useHtmlLabels:n,width:r.width||((u=(l=Ve())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(ui(Ve())){const h=s.children[0],d=wt(s);a=h.getBoundingClientRect(),d.attr("width",a.width),d.attr("height",a.height)}return n?i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):i.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:a,halfPadding:o,label:i}},"insertLabel"),wr=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Wr=w((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Fn(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}w(Fn,"createPathFromPoints");function mg(t,e,r,n,i,s){const a=[],l=r-t,u=n-e,h=l/s,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));a.push({x:m,y})}return a}w(mg,"generateFullSineWavePoints");function w6(t,e,r,n,i,s){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),s=e.find(l=>l.getAttribute("stroke")!=="none"),a=w((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:a(i,"fill"),"fill-opacity":a(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}w(EG,"mergePaths");var M5t=w((t,e)=>{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),Zy=M5t,R5t=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=ui(a);return await Zo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),$p=R5t,jg=w((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),_5t=w(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,o=a,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=cr(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=zd(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Zo(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const N=y.children[0],L=wt(y);v=N.getBoundingClientRect(),L.attr("width",v.width),L.attr("height",v.height)}const x=e.padding??0,b=e.width<=v.width+x?v.width+x:e.width;e.width<=v.width+x?e.diff=(b-e.width)/2-x:e.diff=-x;const T=e.height,C=e.y-T/2,S=e.y+T/2,k=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+T/3,A=g?4:0,R=v.height+2*A;let _,P;if(g){const N=Math.max(R,v.height+2*A),L=k+N,I=Math.max(0,b-N);if(e.look==="handDrawn"){const D=dr.svg(f),F=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),z=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=D.rectangle(k,C,N,T,F);_=f.insert(()=>V,":first-child");const B=D.rectangle(L,C,I,T,z);P=f.insert(()=>B,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",N).attr("height",T).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",L).attr("y",C).attr("width",I).attr("height",T).attr("fill","none").attr("stroke",o);const $=k+N/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const N=Math.max(0,E-C),L=Math.min(R,N),I=C+L,$=Math.max(0,S-I),O=e.x-b/2;if(e.look==="handDrawn"){const z=dr.svg(f),V=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),B=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),H=z.rectangle(O,C,b,L,V);_=f.insert(()=>H,":first-child");const G=z.rectangle(O,I,b,$,B);P=f.insert(()=>G,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",b).attr("height",L).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",b).attr("height",$).attr("fill","none").attr("stroke",o);const D=e.x-v.width/2,F=C+(L-v.height)/2;m.attr("transform",`translate(${D}, ${F})`)}if(de.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=b,e.height=T,e.offsetY=v.height-x/2,e.intersect=function(N){return Zy(e,N)},{cluster:f,labelBBox:v}},"swimlane"),Tke=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ui(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Zo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await $p(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(ui(r)){const k=g.children[0],E=wt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:i}),A=k.path(jg(x,b,y,v,0),E);T=d.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=s3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return Zy(e,k)},{cluster:d,labelBBox:m}},"rect"),L5t=w((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,s=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const a=n.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(o){return Zy(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),I5t=w(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await $p(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(ui(r)){const A=p.children[0],R=wt(p);g=A.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+m,b=e.height+m-g.height-6,T=e.x-v/2,C=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),R=dr.svg(u),_=e.rx||e.ry?R.path(jg(T,C,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):R.rectangle(T,C,v,x,{seed:i});k=u.insert(()=>_,":first-child");const P=R.rectangle(T,S,v,b,{fill:A?s:a,fillStyle:A?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",T).attr("y",C).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(ui(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return Zy(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),N5t=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ui(r),p=d.insert("g").attr("class","cluster-label "),g=await Zo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(ui(r)){const k=g.children[0],E=wt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:i}),A=k.path(jg(x,b,y,v,e.rx),E);T=d.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=s3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return Zy(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),D5t=w((t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:s}=n,a=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=a.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=dr.svg(a).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});p=a.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return Zy(e,m)},{cluster:a,labelBBox:{}}},"divider"),O5t=Tke,P5t={rect:Tke,squareRect:O5t,roundedWithTitle:I5t,noteGroup:L5t,divider:D5t,kanbanSection:N5t,swimlane:_5t},Cke=new Map,iD=w(async(t,e)=>{const r=e.shape||"rect",n=await P5t[r](t,e);return Cke.set(e.id,n),n},"insertCluster"),kke=w(()=>{Cke=new Map},"clear");function Ske(t,e){return t.intersect(e)}w(Ske,"intersectNode");var $5t=Ske;function Eke(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(AG,"sameSign");var F5t=Rke;function _ke(t,e,r){let n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){a=Math.min(a,h.x),o=Math.min(o,h.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));let l=n-t.width/2-a,u=i-t.height/2-o;for(let h=0;h1&&s.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",ja(o)),wr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,a,f),or.circle(e,a,f)},s}w(Lke,"anchor");function MG(t,e,r,n,i,s,a){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/s,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*s*Math.sin(h)*(a?-1:1),x=u-y*i*Math.cos(h)*(a?-1:1),b=Math.atan2((e-x)/s,(t-v)/i);let C=Math.atan2((n-x)/s,(r-v)/i)-b;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,A=b+E*C,R=v+i*Math.cos(A),_=x+s*Math.sin(A);S.push({x:R,y:_})}return S}w(MG,"generateArcPoints");function Ike(t,e,r){const[n,i]=[e,r].sort((s,a)=>a-s);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(Ike,"calculateArcSagitta");async function Nke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=w(A=>A+a,"calcTotalHeight"),l=w(A=>{const R=A/2;return[R/(2.5+A/50),R]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=Ike(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+s*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...MG(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...MG(y/2,v/2,y/2,-v/2,f,p,!0)],T=dr.svg(u),C=fr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Fn(b),k=T.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),wr(e,E),e.intersect=function(A){return or.polygon(e,b,A)},u}w(Nke,"bowTieRect");function F0(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}w(F0,"insertPolygonShape");var OA=12;async function Dke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?28:i,a=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s+OA),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),d=0,f=u,p=-h,g=0,m=[{x:d+OA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+OA},{x:d+OA,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=dr.svg(o),b=fr(e,{}),T=Fn(m),C=x.path(T,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=F0(o,u,h,m);return n&&y.attr("style",n),wr(e,y),e.intersect=function(x){return or.polygon(e,m,x)},o}w(Dke,"card");function Oke(t,e){const{nodeStyles:r}=cr(e);e.label="";const n=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,s=Math.max(28,e.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],o=dr.svg(n),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Fn(a),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return or.polygon(e,a,f)},n}w(Oke,"choice");async function TZ(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a,halfPadding:o}=await Qr(t,e,Wr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?a.width/2+l*2:a.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(s),g=fr(e,{}),m=p.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",ja(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return wr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return or.circle(p,m,g)},e.intersect=function(p){return de.info("Circle intersect",e,h,p),or.circle(e,h,p)},s}w(TZ,"circle");function Pke(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},s={x:-(n/2)*e,y:n/2*r},a={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${s.x},${s.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${a.x},${a.y}`}w(Pke,"createLine");function $ke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),s=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:a}=e,o=dr.svg(i),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,s*2,l),h=Pke(s),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),wr(e,f),e.intersect=function(p){return de.info("crossedCircle intersect",e,{radius:s,point:p}),or.circle(e,s,p)},i}w($ke,"crossedCircle");function yf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-u/2+d-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),wr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(Bke,"curlyBraceLeft");function vf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),wr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(Fke,"curlyBraceRight");function co(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),R.insert(()=>T,":first-child"),R.insert(()=>k,":first-child"),R.attr("class","text"),f&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),wr(e,R),e.intersect=function(_){return or.polygon(e,m,_)},i}w(zke,"curlyBraces");async function Vke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=Math.max(o,(h.width+s*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+a*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,T=x/4,C=[{x:b,y:0},{x:T,y:0},{x:0,y:x/2},{x:T,y:x},{x:b,y:x},...w6(-b,-x/2,p,50,270,90)],S=Fn(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),wr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},u}w(Vke,"curvedTrapezoid");var V5t=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),H5t=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),G5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),mce=8,yce=8;async function Hke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?24:i,a=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-a,e.widthC,":first-child"),g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=V5t(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",ja(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),wr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=or.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}w(Hke,"cylinder");async function a3(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a}=await Qr(t,e,Wr(e)),o=Math.max(a.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(a.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=dr.svg(s),y=fr(e,{}),v=f||p?m.path(jg(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=s.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",ja(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",ja(f)).attr("ry",ja(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return wr(e,d),e.calcIntersect=function(m,y){return or.rect(m,y)},e.intersect=function(m){return or.rect(e,m)},s}w(a3,"drawRect");async function Gke(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:s,width:a,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(s??0)*2,labelPaddingY:i??s??0},u=await a3(t,e,l);if(e.look==="handDrawn"){const p=dr.svg(u),g=fr(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}w(Gke,"datastore");async function Wke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?16:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=o.width+i,h=o.height+s,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=dr.svg(a),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),wr(e,b),e.intersect=function(T){return or.rect(e,T)},a}w(Wke,"dividedRectangle");async function qke(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?12:5;e.labelStyle=r;const s=e.padding??0,a=e.look==="neo"?16:s,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(a??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=dr.svg(o),y=fr(e,{roughness:.2,strokeWidth:2.5}),v=fr(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",ja(e.cssClasses)).attr("style",ja(f)),(p=d.node())==null||p.appendChild(x),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return wr(e,d),e.intersect=function(m){return de.info("DoubleCircle intersect",e,u,m),or.circle(e,u,m)},o}w(qke,"doublecircle");function Uke(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.label="",e.labelStyle=n;const s=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),a=7,{cssStyles:o}=e,l=dr.svg(s),{nodeBorder:u}=r,h=fr(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),wr(e,f),e.intersect=function(p){return de.info("filledCircle intersect",e,{radius:a,point:p}),or.circle(e,a,p)},s}w(Uke,"filledCircle");var vce=10,bce=10;async function Yke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,wr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return de.info("Triangle intersect",e,f,b),or.polygon(e,f,b)},a}w(Yke,"flippedTriangle");function jke(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:s}=cr(e);e.label="";const a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=dr.svg(a),p=fr(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=a.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),wr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return or.rect(e,v)},a}w(jke,"forkJoin");async function Xke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=15,s=10,a=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),wr(e,b),e.intersect=function(T){return de.info("Pill intersect",e,{radius:f,point:T}),or.polygon(e,y,T)},l}w(Xke,"halfRoundedRectangle");var W5t=w((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function Kke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const s=e.padding??0,a=70,o=32,l=e.look==="neo"?a:s,u=e.look==="neo"?o:s;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Qr(t,e,Wr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=dr.svg(h),b=fr(e,{}),T=W5t(0,0,g,f,p),C=x.path(T,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=F0(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,wr(e,y),e.intersect=function(x){return or.polygon(e,m,x)},h}w(Kke,"hexagon");async function Zke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Qr(t,e,Wr(e)),s=Math.max(30,(e==null?void 0:e.width)??0),a=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=dr.svg(i),u=fr(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Fn(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-s/2}, ${-a/2})`),wr(e,p),e.intersect=function(g){return de.info("Pill intersect",e,{points:h}),or.polygon(e,h,g)},i}w(Zke,"hourglass");async function Qke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=i3(e),v=-g/2,x=-p/2,b=e.label?8:0,T=dr.svg(u),C=fr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=T.rectangle(v,x,g,p,C),k=Math.max(g,h.width),E=p+h.height+b,A=T.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),R=u.insert(()=>S,":first-child"),_=u.insert(()=>A);if(e.icon){const P=u.append("g");P.html(`${await d0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=P.node().getBBox(),L=N.width,I=N.height,$=N.x,O=N.y;P.attr("transform",`translate(${-L/2-$},${f?h.height/2+b/2-I/2-O:-h.height/2-b/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),wr(e,_),e.intersect=function(P){if(de.info("iconSquare intersect",e,P),!e.label)return or.rect(e,P);const N=e.x??0,L=e.y??0,I=e.height??0;let $=[];return f?$=[{x:N-h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2+h.height+b},{x:N+g/2,y:L-I/2+h.height+b},{x:N+g/2,y:L+I/2},{x:N-g/2,y:L+I/2},{x:N-g/2,y:L-I/2+h.height+b},{x:N-h.width/2,y:L-I/2+h.height+b}]:$=[{x:N-g/2,y:L-I/2},{x:N+g/2,y:L-I/2},{x:N+g/2,y:L-I/2+p},{x:N+h.width/2,y:L-I/2+p},{x:N+h.width/2/2,y:L+I/2},{x:N-h.width/2,y:L+I/2},{x:N-h.width/2,y:L-I/2+p},{x:N-g/2,y:L-I/2+p}],or.polygon(e,$,P)},u}w(Qke,"icon");async function Jke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=i3(e),x=dr.svg(u),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=v.get("fill");b.stroke=T??y;const C=u.append("g");e.icon&&C.html(`${await d0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=C.node().getBBox(),k=S.width,E=S.height,A=S.x,R=S.y,_=Math.max(k,E)*Math.SQRT2+f*2,P=x.circle(0,0,_,b),N=Math.max(_,h.width),L=_+h.height+p,I=x.rectangle(-N/2,-L/2,N,L,{...b,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-A},${g?h.height/2+p/2-E/2-R:-h.height/2-p/2-E/2-R})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),wr(e,O),e.intersect=function(D){return de.info("iconSquare intersect",e,D),or.rect(e,D)},u}w(Jke,"iconCircle");async function eSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=i3(e),b=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=x.get("fill");k.stroke=E??v;const A=S.path(jg(b,T,m,g,5),k),R=Math.max(m,h.width),_=g+h.height+C,P=S.rectangle(-R/2,-_/2,R,_,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child").attr("class","icon-shape2"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await d0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),wr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:F=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,F,I)},u}w(eSe,"iconRounded");async function tSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=i3(e),b=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=x.get("fill");k.stroke=E??v;const A=S.path(jg(b,T,m,g,.1),k),R=Math.max(m,h.width),_=g+h.height+C,P=S.rectangle(-R/2,-_/2,R,_,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await d0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),wr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:F=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,F,I)},u}w(tSe,"iconSquare");async function rSe(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),s=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/s;const{labelStyles:a}=cr(e);e.labelStyle=a;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??s;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Qr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=dr.svg(d),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=x.rectangle(m,y,u,h,b),C=Math.max(u,f.width),S=h+f.height+v,k=x.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>T,":first-child"),A=d.insert(()=>k);if(e.img){const R=d.append("image");R.attr("href",e.img),R.attr("width",u),R.attr("height",h),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),wr(e,A),e.intersect=function(R){if(de.info("iconSquare intersect",e,R),!e.label)return or.rect(e,R);const _=e.x??0,P=e.y??0,N=e.height??0;let L=[];return g?L=[{x:_-f.width/2,y:P-N/2},{x:_+f.width/2,y:P-N/2},{x:_+f.width/2,y:P-N/2+f.height+v},{x:_+u/2,y:P-N/2+f.height+v},{x:_+u/2,y:P+N/2},{x:_-u/2,y:P+N/2},{x:_-u/2,y:P-N/2+f.height+v},{x:_-f.width/2,y:P-N/2+f.height+v}]:L=[{x:_-u/2,y:P-N/2},{x:_+u/2,y:P-N/2},{x:_+u/2,y:P-N/2+h},{x:_+f.width/2,y:P-N/2+h},{x:_+f.width/2/2,y:P+N/2},{x:_-f.width/2,y:P+N/2},{x:_-f.width/2,y:P-N/2+h},{x:_-u/2,y:P-N/2+h}],or.polygon(e,L,R)},d}w(rSe,"imageSquare");async function nSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=Math.max(l.width+(a??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(s??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=F0(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,wr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(nSe,"inv_trapezoid");async function iSe(t,e){const{shapeSvg:r,bbox:n,label:i}=await Qr(t,e,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),wr(e,s),e.intersect=function(l){return or.rect(e,l)},r}w(iSe,"labelRect");async function sSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=F0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,wr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(sSe,"lean_left");async function aSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=F0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,wr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(aSe,"lean_right");function oSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,a=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:a,y:0},{x:0,y:o+l/2},{x:a-2*l,y:o+l/2},{x:0,y:2*o},{x:a,y:o-l/2},{x:2*l,y:o-l/2}],h=dr.svg(i),d=fr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Fn(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),s&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${a/2},${-o})`),wr(e,g),e.intersect=function(m){return de.info("lightningBolt intersect",e,m),or.polygon(e,u,m)},i}w(oSe,"lightningBolt");var q5t=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),U5t=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Y5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),xce=10,wce=10;async function lSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-s,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=q5t(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",ja(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),wr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const x=or.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let T=f*f*(1-b*b/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,v.y-(e.y??0)>0&&(T=-T),x.y+=T}return x},o}w(lSe,"linedCylinder");async function cSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;if(e.width||e.height){const T=e.width;e.width=(T??0)*10/11-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(s??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(a??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=dr.svg(o),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...mg(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),wr(e,b),e.intersect=function(T){return or.polygon(e,v,T)},o}w(cSe,"linedWaveEdgedRect");async function uSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+s*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+a*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,x=dr.svg(l),b=fr(e,{}),T=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Fn(T);let k=x.path(S,b);const E=Fn(C);let A=x.path(E,b);e.look!=="handDrawn"&&(k=EG(k),A=EG(A));const R=l.insert("g",":first-child");return R.insert(()=>k),R.insert(()=>A),R.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),wr(e,R),e.intersect=function(_){return or.polygon(e,T,_)},l}w(uSe,"multiRect");async function hSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,Wr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(s.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(s.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:x}=e,b=mg(m-v,y+g+v,m+d-v,y+g+v,p,.8),T=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y:T.y-2*v},{x:m+d+v,y:T.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y},{x:m,y}],k=dr.svg(i),E=fr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const A=Fn(C),R=k.path(A,E),_=Fn(S),P=k.path(_,E),N=i.insert(()=>R,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-(s.width/2)-v-(s.x-(s.left??0))}, ${-(s.height/2)+v-p/2-(s.y-(s.top??0))})`),wr(e,N),e.intersect=function(L){return or.polygon(e,C,L)},i}w(hSe,"multiWaveEdgedRectangle");async function dSe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n,e.useHtmlLabels||ui(vr())||(e.centerLabel=!0);const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=dr.svg(a),m=fr(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=a.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),wr(e,v),e.intersect=function(x){return or.rect(e,x)},a}w(dSe,"note");var j5t=w((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function fSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,Wr(e)),a=s.width+(e.padding??0),o=s.height+(e.padding??0),l=a+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(i),g=fr(e,{}),m=j5t(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=F0(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),wr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=or.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}w(fSe,"question");async function pSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?21:i??0,a=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=dr.svg(o),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Fn(m),T=v.path(b,x),C=o.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),wr(e,C),e.intersect=function(S){return or.polygon(e,m,S)},o}w(pSe,"rect_left_inv_arrow");async function gSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),a=s.insert("g"),o=s.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await $p(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(ui(Ve())){const E=h.children[0],A=wt(h);d=E.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}de.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await $p(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=wt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;wt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),wt(h).attr("transform","translate( "+(d.width(de.debug("Rough node insert CXC",R),_),":first-child"),S=s.insert(()=>(de.debug("Rough node insert CXC",R),R),":first-child")}else S=a.insert("rect",":first-child"),k=a.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return wr(e,S),e.intersect=function(E){return or.rect(e,E)},s}w(gSe,"rectWithTitle");async function mSe(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return a3(t,e,i)}w(mSe,"roundedRect");var km=8;async function ySe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?km:km*2),h=((e==null?void 0:e.height)??o.height)+s*2,d=u-km,f=h,p=km-u/2,g=-h/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-km,y:g+f},{x:p-km,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(C=>[C.x,C.y]),v),T=a.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path").attr("style",ja(m)),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),l.attr("transform",`translate(${km/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),wr(e,T),e.intersect=function(C){return or.rect(e,C)},a}w(ySe,"shadedProcess");async function vSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-a*2,10));const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=dr.svg(o),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],T=Fn(b),C=v.path(T,x),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),wr(e,S),e.intersect=function(k){return or.polygon(e,b,k)},o}w(vSe,"slopedRect");async function bSe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return a3(t,e,s)}w(bSe,"squareRect");async function xSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?20:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=l.height+(e.look==="neo"?a*2:a),h=l.width+u/4+(e.look==="neo"?s*2:s),d=u/2,{cssStyles:f}=e,p=dr.svg(o),g=fr(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...w6(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...w6(h/2-d,0,d,50,270,450)],y=Fn(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),wr(e,x),e.intersect=function(b){return or.polygon(e,m,b)},o}w(xSe,"stadium");async function wSe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return a3(t,e,r)}w(wSe,"state");function TSe(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{cssStyles:s}=e,{lineColor:a,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=dr.svg(h),f=fr(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:a,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),s&&v.selectAll("path").attr("style",s),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const T=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",C=T?`${T}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return wr(e,v),e.intersect=function(T){return or.circle(e,(e.width??0)/2,T)},h}w(TSe,"stateEnd");function CSe(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if(e.look==="handDrawn"){const h=dr.svg(s).circle(0,0,e.width,Awt(n));a=s.insert(()=>h),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${h})`)}return wr(e,a),e.intersect=function(u){return or.circle(e,(e.width??7)/2,u)},s}w(CSe,"stateStart");var Fv=8;async function kSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,s=e.look==="neo"?28:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+2*Fv+s,h=((e==null?void 0:e.height)??l.height)+a,d=u-2*Fv,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=dr.svg(o),v=fr(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+Fv,g,p+Fv,g+f,v),T=y.line(p+Fv+d,g,p+Fv+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>T,":first-child");const C=o.insert(()=>x,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",ja(S)),wr(e,C)}else{const y=F0(o,d,f,m);n&&y.attr("style",n),wr(e,y)}return e.intersect=function(y){return or.polygon(e,m,y)},o}w(kSe,"subroutine");var rB=.2;async function SSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-a*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-rB*(e.height+a*2),10));const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2,h=rB*u,d=rB*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,x=dr.svg(o),b=fr(e,{}),T=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Fn(T),k=x.path(S,b),E=Fn(C),A=x.path(E,{...b,fillStyle:"solid"}),R=o.insert(()=>A,":first-child");return R.insert(()=>k,":first-child"),R.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),wr(e,R),e.intersect=function(_){return or.polygon(e,T,_)},o}w(SSe,"taggedRect");async function ESe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,Wr(e)),o=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=dr.svg(i),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...mg(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...mg(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],T=Fn(y),C=g.path(T,m),S=Fn(b),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-u/2-(s.y-(s.top??0))})`),wr(e,E),e.intersect=function(A){return or.polygon(e,y,A)},i}w(ESe,"taggedWaveEdgedRectangle");async function ASe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,Wr(e)),a=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(s.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-a/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",a).attr("height",o),wr(e,h),e.intersect=function(d){return or.rect(e,d)},i}w(ASe,"text");var X5t=w((t,e,r,n,i,s)=>`M${t},${e} +`);return lke(n)}w(cke,"preprocessMarkdown");function uke(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}w(uke,"nonMarkdownToLines");function hke(t,e={}){const r=cke(t,e),n=fi.lexer(r),i=[[]];let s=0;function a(o,l="normal"){o.type==="text"?o.text.split(` +`).forEach((h,d)=>{d!==0&&(s++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[s].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{a(u,o.type)}):o.type==="html"&&i[s].push({content:o.text,type:"normal"})}return w(a,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{a(u)}):o.type==="html"?i[s].push({content:o.text,type:"normal"}):i[s].push({content:o.raw,type:"normal"})}),i}w(hke,"markdownToLines");function dke(t){return t?`

    ${t.replace(/\\n|\n/g,"
    ")}

    `:""}w(dke,"nonMarkdownToHTML");function fke(t,{markdownAutoWrap:e}={}){const r=fi.lexer(t);function n(i){var s,a,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="em"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="paragraph"?`

    ${(o=i.tokens)==null?void 0:o.map(n).join("")}

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(de.warn(`Unsupported markdown: ${i.type}`),i.raw)}return w(n,"output"),r.map(n).join("")}w(fke,"markdownToHTML");function pke(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(pke,"splitTextToChars");function gke(t,e){const r=pke(e.content);return CZ(t,[],r,e.type)}w(gke,"splitWordToFitWidth");function CZ(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...s]=r,a=[...e,i];return t([{content:a.join(""),type:n}])?CZ(t,a,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(CZ,"splitWordToFitWidthRecursion");function mke(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return c_(t,e)}w(mke,"splitLineToFitWidth");function c_(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const s=t.shift()??{content:" ",type:"normal"},a=[...n];if(i!==""&&a.push({content:i,type:"normal"}),a.push(s),e(a))return c_(t,e,r,a);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[o,l]=gke(e,s);r.push([o]),l.content&&t.unshift(l)}return c_(t,e,r)}w(c_,"splitLineToFitWidthRecursion");function SG(t,e){e&&t.attr("style",e)}w(SG,"applyStyle");var hce=16384;async function yke(t,e,r,n,i=!1,s=br()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,hce)}px`),a.attr("height",`${Math.min(10*r,hce)}px`);const o=a.append("xhtml:div"),l=Ks(e.label)?await VN(e.label.replace(Vt.lineBreakRegex,` +`),s):Ln(e.label,s),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),SG(h,e.labelStyle),h.attr("class",`${u} ${n}`),SG(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),a.node()}w(yke,"addHtmlSpan");function iD(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}w(iD,"createTspan");function vke(t,e,r){const n=t.append("text"),i=iD(n,1,e);sD(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}w(vke,"computeWidthOfText");function bke(t,e,r){var a;const n=t.append("text"),i=iD(n,1,e);sD(i,[{content:r,type:"normal"}]);const s=(a=i.node())==null?void 0:a.getBoundingClientRect();return s&&n.remove(),s}w(bke,"computeDimensionOfText");function xke(t,e,r,n=!1,i=!1){const a=e.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=w(p=>vke(a,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:mke(h,d);for(const p of f){const g=iD(l,u,1.1,i);sD(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}w(xke,"createFormattedText");function EG(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}w(EG,"decodeHTMLEntities");function sD(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(EG(r.content)):i.text(" "+EG(r.content))})}w(sD,"updateTextContentAndStyles");async function wke(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await DTt(o)?await m0(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(wke,"replaceIconSubstring");var Zo=w(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:s=!0,markdown:a=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(de.debug("XYZ createText",e,r,n,i,s,o,"addSvgBackground: ",u),s){const d=a?fke(e,h):dke(e),f=await wke(g0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ks(e)?p:f,labelStyle:r.replace("fill:","color:")};return await yke(t,g,l,i,u,h)}else{const d=g0(e.replace(//g,"
    ")),f=a?hke(d.replace("
    ","
    "),h):uke(d),p=xke(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");wt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");wt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");wt(p).select("text").attr("style",m)}return n?wt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):wt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function J$(t,e,r){if(t&&t.length){const[n,i]=e,s=Math.PI/180*r,a=Math.cos(s),o=Math.sin(s);for(const l of t){const[u,h]=l;l[0]=(u-n)*a-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*a+i}}}function v5t(t,e){return t[0]===e[0]&&t[1]===e[1]}function b5t(t,e,r,n=1){const i=r,s=Math.max(e,.1),a=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of a)J$(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];v5t(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const T=m[x].edge,C=m[b].edge;p.push([[Math.round(T.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(a,s,n);if(i){for(const u of a)J$(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),J$(f,h,d)})(l,o,-i)}return l}function i7(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let s=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=i),b5t(t,i,n,s||1)}class kZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=i7(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function aD(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}let x5t=class extends kZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=i7(e,Object.assign({},r,{hachureGap:n})),s=Math.PI/180*r.hachureAngle,a=[],o=.5*n*Math.cos(s),l=.5*n*Math.sin(s);for(const[u,h]of i)aD([u,h])&&a.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}};class w5t extends kZ{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(e,i);return n.ops=n.ops.concat(s.ops),n}}let T5t=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=i7(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=i/4;for(const o of e){const l=aD(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=aD(a),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const a=aD(s),o=Math.round(a/(2*r));let l=s[0],u=s[1];l[0]>u[0]&&(l=s[1],u=s[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));s.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));s.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));s.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],s.push({key:"T",data:[e,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,r=i}return s}function Cke(t){const e=[];let r="",n=0,i=0,s=0,a=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[s,a]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(kke(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=s,i=a}r=u}return e}function rC(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function kke(t,e,r,n,i,s,a,o,l,u){const h=(d=a,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=rC(t,e,-h),[r,n]=rC(r,n,-h);const N=(t-r)/2,L=(e-n)/2;let I=N*N/(i*i)+L*L/(s*s);I>1&&(I=Math.sqrt(I),i*=I,s*=I);const $=i*i,O=s*s,D=$*O-$*L*L-O*N*N,F=$*L*L+O*N*N,z=(o===l?-1:1)*Math.sqrt(Math.abs(D/F));m=z*i*L/s+(t+r)/2,y=z*-s*N/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/s).toFixed(9))),g=Math.asin(parseFloat(((n-y)/s).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const N=g,L=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=kke(r=m+i*Math.cos(g),n=y+s*Math.sin(g),L,I,i,s,a,0,l,[g,N,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),T=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*s*S,A=[t,e],R=[t+k*b,e-E*x],_=[r+k*C,n-E*T],P=[r,n];if(R[0]=2*A[0]-R[0],R[1]=2*A[1]-R[1],u)return[R,_,P].concat(f);{f=[R,_,P].concat(f);const N=[];for(let L=0;L2){const i=[];for(let s=0;s2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=vce(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=vce(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return a&&(o?v.push(...vg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...vg(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function gce(t,e){const r=Cke(Tke(SZ(t))),n=[];let i=[0,0],s=[0,0];for(const{key:a,data:o}of r)switch(a){case"M":s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...vg(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...R5t(l,u,h,d,f,p,s,e)),s=[f,p];break}case"Z":n.push(...vg(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function rB(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,s=n.length;if(s>2){r.push({op:"move",data:[n[0][0]+en(i,e),n[0][1]+en(i,e)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*Ake(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=en(p,i,u),g=en(g,i,u);const m=[],y=()=>en(d,i,u),v=()=>en(h,i,u),x=i.preserveVertices;return a?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:en(h,i,u)),e+(x?0:en(h,i,u))]}),a?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(x?0:v()),n+(x?0:v())]}),m}function PA(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]),n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]);for(let i=1;i3){const s=[],a=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=Ym(l,u,.5),p=Ym(u,h,.5),g=Ym(h,d,.5),m=Ym(f,p,.5),y=Ym(p,g,.5),v=Ym(m,y,.5);RG([l,f,m,v],0,r,i),RG([v,y,g,d],0,r,i)}var s,a;return i}function L5t(t,e){return d_(t,0,t.length,e)}function d_(t,e,r,n,i){const s=i||[],a=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(d_(t,e,u+1,n,s),d_(t,u,r,n,s)):(s.length||s.push(a),s.push(o)),s}function nB(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s0?d_(n,0,n.length,r):n}const Sc="none";let f_=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,s){const a=this._o(s);return this._d("line",[Ske(e,r,n,i,a)],a)}rectangle(e,r,n,i,s){const a=this._o(s),o=[],l=M5t(e,r,n,i,a);if(a.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];a.fillStyle==="solid"?o.push(rB([u],a)):o.push(zv([u],a))}return a.stroke!==Sc&&o.push(l),this._d("rectangle",o,a)}ellipse(e,r,n,i,s){const a=this._o(s),o=[],l=Eke(n,i,a),u=AG(e,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=AG(e,r,a,l).opset;h.type="fillPath",o.push(h)}else o.push(zv([u.estimatedPoints],a));return a.stroke!==Sc&&o.push(u.opset),this._d("ellipse",o,a)}circle(e,r,n,i){const s=this.ellipse(e,r,n,n,i);return s.shape="circle",s}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[OM(e,!1,n)],n)}arc(e,r,n,i,s,a,o=!1,l){const u=this._o(l),h=[],d=pce(e,r,n,i,s,a,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=pce(e,r,n,i,s,a,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,x){const b=f,T=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=en(.01*C,x),S+=en(.01*S,x);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const A=(E-k)/x.curveStepCount,R=[];for(let _=k;_<=E;_+=A)R.push([b+C*Math.cos(_),T+S*Math.sin(_)]);return R.push([b+C*Math.cos(E),T+S*Math.sin(E)]),R.push([b,T]),zv([R],x)})(e,r,n,i,s,a,u));return u.stroke!==Sc&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],s=fce(e,n);if(n.fill&&n.fill!==Sc)if(n.fillStyle==="solid"){const a=fce(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?a.push(...u):u.length===3?a.push(...nB(bce([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):a.push(...nB(bce(u),10,(1+n.roughness)/2))}a.length&&i.push(zv([a],n))}return n.stroke!==Sc&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=OM(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(rB([e],n)):i.push(zv([e],n))),n.stroke!==Sc&&i.push(s),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=n.fill&&n.fill!=="transparent"&&n.fill!==Sc,a=n.stroke!==Sc,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=Cke(Tke(SZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...nB(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const T=[];for(const C of g){const S=L5t(C,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=gce(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=gce(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(rB(l,n));else i.push(zv(l,n));return a&&(o?l.forEach((h=>{i.push(OM(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const s=typeof r=="number"&&r>=0?i.data.map((a=>+a.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":n+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":n+=`L${s[0]} ${s[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Sc};break;case"fillPath":a={d:this.opsToPath(s),stroke:Sc,strokeWidth:0,fill:n.fill||Sc};break;case"fillSketch":a=this.fillSketch(s,n)}a&&i.push(a)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Sc,strokeWidth:n,fill:Sc}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class I5t{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new f_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,s=e.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,a,s),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,a,s,o),i.restore();break}case"fillSketch":this.fillSketch(i,a,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const s of r.ops){const a=typeof n=="number"&&n>=0?s.data.map((o=>+o.toFixed(n))):s.data;switch(s.op){case"move":e.moveTo(a[0],a[1]);break;case"bcurveTo":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":e.lineTo(a[0],a[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a),a}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a),a}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a),a}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s),s}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const $A="http://www.w3.org/2000/svg";class N5t{constructor(e,r){this.svg=e,this.gen=new f_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS($A,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS($A,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS($A,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&s.appendChild(l)}return s}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const s=e.createElementNS($A,"path");return s.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),s.setAttribute("stroke",n.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),n.fillLineDash&&s.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a)}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a)}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a)}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var dr={canvas:(t,e)=>new I5t(t,e),svg:(t,e)=>new N5t(t,e),generator:t=>new f_(t),newSeed:()=>f_.newSeed()},Qr=w(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||Gd((p=Ve())==null?void 0:p.htmlLabels);r?n=r:n="node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",ja(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Zo(a,Ln(g0(o),Ve()),{useHtmlLabels:i,width:e.width||((g=Ve().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Ve());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=wt(h);await dZ(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),iB=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??hi(Ve()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Zo(i,Ln(g0(e),Ve()),{useHtmlLabels:n,width:r.width||((u=(l=Ve())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(hi(Ve())){const h=s.children[0],d=wt(s);a=h.getBoundingClientRect(),d.attr("width",a.width),d.attr("height",a.height)}return n?i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):i.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:a,halfPadding:o,label:i}},"insertLabel"),Tr=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Wr=w((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Fn(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}w(Fn,"createPathFromPoints");function bg(t,e,r,n,i,s){const a=[],l=r-t,u=n-e,h=l/s,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));a.push({x:m,y})}return a}w(bg,"generateFullSineWavePoints");function k6(t,e,r,n,i,s){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),s=e.find(l=>l.getAttribute("stroke")!=="none"),a=w((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:a(i,"fill"),"fill-opacity":a(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}w(_G,"mergePaths");var D5t=w((t,e)=>{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),Jy=D5t,O5t=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=hi(a);return await Zo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Vp=O5t,Zg=w((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),P5t=w(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,o=a,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=cr(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=Gd(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Zo(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const N=y.children[0],L=wt(y);v=N.getBoundingClientRect(),L.attr("width",v.width),L.attr("height",v.height)}const x=e.padding??0,b=e.width<=v.width+x?v.width+x:e.width;e.width<=v.width+x?e.diff=(b-e.width)/2-x:e.diff=-x;const T=e.height,C=e.y-T/2,S=e.y+T/2,k=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+T/3,A=g?4:0,R=v.height+2*A;let _,P;if(g){const N=Math.max(R,v.height+2*A),L=k+N,I=Math.max(0,b-N);if(e.look==="handDrawn"){const D=dr.svg(f),F=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),z=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=D.rectangle(k,C,N,T,F);_=f.insert(()=>V,":first-child");const B=D.rectangle(L,C,I,T,z);P=f.insert(()=>B,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",N).attr("height",T).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",L).attr("y",C).attr("width",I).attr("height",T).attr("fill","none").attr("stroke",o);const $=k+N/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const N=Math.max(0,E-C),L=Math.min(R,N),I=C+L,$=Math.max(0,S-I),O=e.x-b/2;if(e.look==="handDrawn"){const z=dr.svg(f),V=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),B=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),H=z.rectangle(O,C,b,L,V);_=f.insert(()=>H,":first-child");const G=z.rectangle(O,I,b,$,B);P=f.insert(()=>G,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",b).attr("height",L).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",b).attr("height",$).attr("fill","none").attr("stroke",o);const D=e.x-v.width/2,F=C+(L-v.height)/2;m.attr("transform",`translate(${D}, ${F})`)}if(de.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=b,e.height=T,e.offsetY=v.height-x/2,e.intersect=function(N){return Jy(e,N)},{cluster:f,labelBBox:v}},"swimlane"),Mke=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=hi(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Zo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Vp(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(hi(r)){const k=g.children[0],E=wt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:i}),A=k.path(Zg(x,b,y,v,0),E);T=d.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=l3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return Jy(e,k)},{cluster:d,labelBBox:m}},"rect"),$5t=w((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,s=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const a=n.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(o){return Jy(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),B5t=w(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Vp(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(hi(r)){const A=p.children[0],R=wt(p);g=A.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+m,b=e.height+m-g.height-6,T=e.x-v/2,C=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),R=dr.svg(u),_=e.rx||e.ry?R.path(Zg(T,C,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):R.rectangle(T,C,v,x,{seed:i});k=u.insert(()=>_,":first-child");const P=R.rectangle(T,S,v,b,{fill:A?s:a,fillStyle:A?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",T).attr("y",C).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(hi(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return Jy(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),F5t=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=hi(r),p=d.insert("g").attr("class","cluster-label "),g=await Zo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(hi(r)){const k=g.children[0],E=wt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:i}),A=k.path(Zg(x,b,y,v,e.rx),E);T=d.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=l3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return Jy(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),z5t=w((t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:s}=n,a=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=a.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=dr.svg(a).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});p=a.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return Jy(e,m)},{cluster:a,labelBBox:{}}},"divider"),V5t=Mke,H5t={rect:Mke,squareRect:V5t,roundedWithTitle:B5t,noteGroup:$5t,divider:z5t,kanbanSection:F5t,swimlane:P5t},Rke=new Map,oD=w(async(t,e)=>{const r=e.shape||"rect",n=await H5t[r](t,e);return Rke.set(e.id,n),n},"insertCluster"),_ke=w(()=>{Rke=new Map},"clear");function Lke(t,e){return t.intersect(e)}w(Lke,"intersectNode");var G5t=Lke;function Ike(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(LG,"sameSign");var q5t=Oke;function Pke(t,e,r){let n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){a=Math.min(a,h.x),o=Math.min(o,h.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));let l=n-t.width/2-a,u=i-t.height/2-o;for(let h=0;h1&&s.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",ja(o)),Tr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,a,f),or.circle(e,a,f)},s}w($ke,"anchor");function IG(t,e,r,n,i,s,a){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/s,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*s*Math.sin(h)*(a?-1:1),x=u-y*i*Math.cos(h)*(a?-1:1),b=Math.atan2((e-x)/s,(t-v)/i);let C=Math.atan2((n-x)/s,(r-v)/i)-b;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,A=b+E*C,R=v+i*Math.cos(A),_=x+s*Math.sin(A);S.push({x:R,y:_})}return S}w(IG,"generateArcPoints");function Bke(t,e,r){const[n,i]=[e,r].sort((s,a)=>a-s);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(Bke,"calculateArcSagitta");async function Fke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=w(A=>A+a,"calcTotalHeight"),l=w(A=>{const R=A/2;return[R/(2.5+A/50),R]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=Bke(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+s*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...IG(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...IG(y/2,v/2,y/2,-v/2,f,p,!0)],T=dr.svg(u),C=fr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Fn(b),k=T.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),Tr(e,E),e.intersect=function(A){return or.polygon(e,b,A)},u}w(Fke,"bowTieRect");function G0(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}w(G0,"insertPolygonShape");var BA=12;async function zke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?28:i,a=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s+BA),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),d=0,f=u,p=-h,g=0,m=[{x:d+BA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+BA},{x:d+BA,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=dr.svg(o),b=fr(e,{}),T=Fn(m),C=x.path(T,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=G0(o,u,h,m);return n&&y.attr("style",n),Tr(e,y),e.intersect=function(x){return or.polygon(e,m,x)},o}w(zke,"card");function Vke(t,e){const{nodeStyles:r}=cr(e);e.label="";const n=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,s=Math.max(28,e.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],o=dr.svg(n),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Fn(a),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return or.polygon(e,a,f)},n}w(Vke,"choice");async function EZ(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a,halfPadding:o}=await Qr(t,e,Wr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?a.width/2+l*2:a.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(s),g=fr(e,{}),m=p.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",ja(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Tr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return or.circle(p,m,g)},e.intersect=function(p){return de.info("Circle intersect",e,h,p),or.circle(e,h,p)},s}w(EZ,"circle");function Hke(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},s={x:-(n/2)*e,y:n/2*r},a={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${s.x},${s.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${a.x},${a.y}`}w(Hke,"createLine");function Gke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),s=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:a}=e,o=dr.svg(i),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,s*2,l),h=Hke(s),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Tr(e,f),e.intersect=function(p){return de.info("crossedCircle intersect",e,{radius:s,point:p}),or.circle(e,s,p)},i}w(Gke,"crossedCircle");function xf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-u/2+d-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(Wke,"curlyBraceLeft");function wf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(qke,"curlyBraceRight");function co(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),R.insert(()=>T,":first-child"),R.insert(()=>k,":first-child"),R.attr("class","text"),f&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,R),e.intersect=function(_){return or.polygon(e,m,_)},i}w(Uke,"curlyBraces");async function Yke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=Math.max(o,(h.width+s*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+a*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,T=x/4,C=[{x:b,y:0},{x:T,y:0},{x:0,y:x/2},{x:T,y:x},{x:b,y:x},...k6(-b,-x/2,p,50,270,90)],S=Fn(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},u}w(Yke,"curvedTrapezoid");var Y5t=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),j5t=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),X5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),xce=8,wce=8;async function jke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?24:i,a=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-a,e.widthC,":first-child"),g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=Y5t(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",ja(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=or.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}w(jke,"cylinder");async function c3(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a}=await Qr(t,e,Wr(e)),o=Math.max(a.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(a.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=dr.svg(s),y=fr(e,{}),v=f||p?m.path(Zg(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=s.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",ja(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",ja(f)).attr("ry",ja(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Tr(e,d),e.calcIntersect=function(m,y){return or.rect(m,y)},e.intersect=function(m){return or.rect(e,m)},s}w(c3,"drawRect");async function Xke(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:s,width:a,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(s??0)*2,labelPaddingY:i??s??0},u=await c3(t,e,l);if(e.look==="handDrawn"){const p=dr.svg(u),g=fr(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}w(Xke,"datastore");async function Kke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?16:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=o.width+i,h=o.height+s,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=dr.svg(a),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Tr(e,b),e.intersect=function(T){return or.rect(e,T)},a}w(Kke,"dividedRectangle");async function Zke(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?12:5;e.labelStyle=r;const s=e.padding??0,a=e.look==="neo"?16:s,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(a??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=dr.svg(o),y=fr(e,{roughness:.2,strokeWidth:2.5}),v=fr(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",ja(e.cssClasses)).attr("style",ja(f)),(p=d.node())==null||p.appendChild(x),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Tr(e,d),e.intersect=function(m){return de.info("DoubleCircle intersect",e,u,m),or.circle(e,u,m)},o}w(Zke,"doublecircle");function Qke(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.label="",e.labelStyle=n;const s=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),a=7,{cssStyles:o}=e,l=dr.svg(s),{nodeBorder:u}=r,h=fr(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Tr(e,f),e.intersect=function(p){return de.info("filledCircle intersect",e,{radius:a,point:p}),or.circle(e,a,p)},s}w(Qke,"filledCircle");var Tce=10,Cce=10;async function Jke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,Tr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return de.info("Triangle intersect",e,f,b),or.polygon(e,f,b)},a}w(Jke,"flippedTriangle");function eSe(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:s}=cr(e);e.label="";const a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=dr.svg(a),p=fr(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=a.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Tr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return or.rect(e,v)},a}w(eSe,"forkJoin");async function tSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=15,s=10,a=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(T){return de.info("Pill intersect",e,{radius:f,point:T}),or.polygon(e,y,T)},l}w(tSe,"halfRoundedRectangle");var K5t=w((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function rSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const s=e.padding??0,a=70,o=32,l=e.look==="neo"?a:s,u=e.look==="neo"?o:s;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Qr(t,e,Wr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=dr.svg(h),b=fr(e,{}),T=K5t(0,0,g,f,p),C=x.path(T,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=G0(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,Tr(e,y),e.intersect=function(x){return or.polygon(e,m,x)},h}w(rSe,"hexagon");async function nSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Qr(t,e,Wr(e)),s=Math.max(30,(e==null?void 0:e.width)??0),a=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=dr.svg(i),u=fr(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Fn(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-s/2}, ${-a/2})`),Tr(e,p),e.intersect=function(g){return de.info("Pill intersect",e,{points:h}),or.polygon(e,h,g)},i}w(nSe,"hourglass");async function iSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=o3(e),v=-g/2,x=-p/2,b=e.label?8:0,T=dr.svg(u),C=fr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=T.rectangle(v,x,g,p,C),k=Math.max(g,h.width),E=p+h.height+b,A=T.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),R=u.insert(()=>S,":first-child"),_=u.insert(()=>A);if(e.icon){const P=u.append("g");P.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=P.node().getBBox(),L=N.width,I=N.height,$=N.x,O=N.y;P.attr("transform",`translate(${-L/2-$},${f?h.height/2+b/2-I/2-O:-h.height/2-b/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),Tr(e,_),e.intersect=function(P){if(de.info("iconSquare intersect",e,P),!e.label)return or.rect(e,P);const N=e.x??0,L=e.y??0,I=e.height??0;let $=[];return f?$=[{x:N-h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2+h.height+b},{x:N+g/2,y:L-I/2+h.height+b},{x:N+g/2,y:L+I/2},{x:N-g/2,y:L+I/2},{x:N-g/2,y:L-I/2+h.height+b},{x:N-h.width/2,y:L-I/2+h.height+b}]:$=[{x:N-g/2,y:L-I/2},{x:N+g/2,y:L-I/2},{x:N+g/2,y:L-I/2+p},{x:N+h.width/2,y:L-I/2+p},{x:N+h.width/2/2,y:L+I/2},{x:N-h.width/2,y:L+I/2},{x:N-h.width/2,y:L-I/2+p},{x:N-g/2,y:L-I/2+p}],or.polygon(e,$,P)},u}w(iSe,"icon");async function sSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=o3(e),x=dr.svg(u),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=v.get("fill");b.stroke=T??y;const C=u.append("g");e.icon&&C.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=C.node().getBBox(),k=S.width,E=S.height,A=S.x,R=S.y,_=Math.max(k,E)*Math.SQRT2+f*2,P=x.circle(0,0,_,b),N=Math.max(_,h.width),L=_+h.height+p,I=x.rectangle(-N/2,-L/2,N,L,{...b,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-A},${g?h.height/2+p/2-E/2-R:-h.height/2-p/2-E/2-R})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Tr(e,O),e.intersect=function(D){return de.info("iconSquare intersect",e,D),or.rect(e,D)},u}w(sSe,"iconCircle");async function aSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=o3(e),b=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=x.get("fill");k.stroke=E??v;const A=S.path(Zg(b,T,m,g,5),k),R=Math.max(m,h.width),_=g+h.height+C,P=S.rectangle(-R/2,-_/2,R,_,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child").attr("class","icon-shape2"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:F=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,F,I)},u}w(aSe,"iconRounded");async function oSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=o3(e),b=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=x.get("fill");k.stroke=E??v;const A=S.path(Zg(b,T,m,g,.1),k),R=Math.max(m,h.width),_=g+h.height+C,P=S.rectangle(-R/2,-_/2,R,_,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:F=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,F,I)},u}w(oSe,"iconSquare");async function lSe(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),s=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/s;const{labelStyles:a}=cr(e);e.labelStyle=a;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??s;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Qr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=dr.svg(d),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=x.rectangle(m,y,u,h,b),C=Math.max(u,f.width),S=h+f.height+v,k=x.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>T,":first-child"),A=d.insert(()=>k);if(e.img){const R=d.append("image");R.attr("href",e.img),R.attr("width",u),R.attr("height",h),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),Tr(e,A),e.intersect=function(R){if(de.info("iconSquare intersect",e,R),!e.label)return or.rect(e,R);const _=e.x??0,P=e.y??0,N=e.height??0;let L=[];return g?L=[{x:_-f.width/2,y:P-N/2},{x:_+f.width/2,y:P-N/2},{x:_+f.width/2,y:P-N/2+f.height+v},{x:_+u/2,y:P-N/2+f.height+v},{x:_+u/2,y:P+N/2},{x:_-u/2,y:P+N/2},{x:_-u/2,y:P-N/2+f.height+v},{x:_-f.width/2,y:P-N/2+f.height+v}]:L=[{x:_-u/2,y:P-N/2},{x:_+u/2,y:P-N/2},{x:_+u/2,y:P-N/2+h},{x:_+f.width/2,y:P-N/2+h},{x:_+f.width/2/2,y:P+N/2},{x:_-f.width/2,y:P+N/2},{x:_-f.width/2,y:P-N/2+h},{x:_-u/2,y:P-N/2+h}],or.polygon(e,L,R)},d}w(lSe,"imageSquare");async function cSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=Math.max(l.width+(a??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(s??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=G0(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(cSe,"inv_trapezoid");async function uSe(t,e){const{shapeSvg:r,bbox:n,label:i}=await Qr(t,e,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Tr(e,s),e.intersect=function(l){return or.rect(e,l)},r}w(uSe,"labelRect");async function hSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=G0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(hSe,"lean_left");async function dSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=G0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(dSe,"lean_right");function fSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,a=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:a,y:0},{x:0,y:o+l/2},{x:a-2*l,y:o+l/2},{x:0,y:2*o},{x:a,y:o-l/2},{x:2*l,y:o-l/2}],h=dr.svg(i),d=fr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Fn(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),s&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${a/2},${-o})`),Tr(e,g),e.intersect=function(m){return de.info("lightningBolt intersect",e,m),or.polygon(e,u,m)},i}w(fSe,"lightningBolt");var Z5t=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Q5t=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),J5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),kce=10,Sce=10;async function pSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-s,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=Z5t(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",ja(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const x=or.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let T=f*f*(1-b*b/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,v.y-(e.y??0)>0&&(T=-T),x.y+=T}return x},o}w(pSe,"linedCylinder");async function gSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;if(e.width||e.height){const T=e.width;e.width=(T??0)*10/11-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(s??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(a??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=dr.svg(o),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...bg(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Tr(e,b),e.intersect=function(T){return or.polygon(e,v,T)},o}w(gSe,"linedWaveEdgedRect");async function mSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+s*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+a*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,x=dr.svg(l),b=fr(e,{}),T=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Fn(T);let k=x.path(S,b);const E=Fn(C);let A=x.path(E,b);e.look!=="handDrawn"&&(k=_G(k),A=_G(A));const R=l.insert("g",":first-child");return R.insert(()=>k),R.insert(()=>A),R.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Tr(e,R),e.intersect=function(_){return or.polygon(e,T,_)},l}w(mSe,"multiRect");async function ySe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,Wr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(s.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(s.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:x}=e,b=bg(m-v,y+g+v,m+d-v,y+g+v,p,.8),T=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y:T.y-2*v},{x:m+d+v,y:T.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y},{x:m,y}],k=dr.svg(i),E=fr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const A=Fn(C),R=k.path(A,E),_=Fn(S),P=k.path(_,E),N=i.insert(()=>R,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-(s.width/2)-v-(s.x-(s.left??0))}, ${-(s.height/2)+v-p/2-(s.y-(s.top??0))})`),Tr(e,N),e.intersect=function(L){return or.polygon(e,C,L)},i}w(ySe,"multiWaveEdgedRectangle");async function vSe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n,e.useHtmlLabels||hi(br())||(e.centerLabel=!0);const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=dr.svg(a),m=fr(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=a.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,v),e.intersect=function(x){return or.rect(e,x)},a}w(vSe,"note");var e3t=w((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function bSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,Wr(e)),a=s.width+(e.padding??0),o=s.height+(e.padding??0),l=a+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(i),g=fr(e,{}),m=e3t(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=G0(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Tr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=or.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}w(bSe,"question");async function xSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?21:i??0,a=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=dr.svg(o),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Fn(m),T=v.path(b,x),C=o.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,m,S)},o}w(xSe,"rect_left_inv_arrow");async function wSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),a=s.insert("g"),o=s.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Vp(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(hi(Ve())){const E=h.children[0],A=wt(h);d=E.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}de.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Vp(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=wt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;wt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),wt(h).attr("transform","translate( "+(d.width(de.debug("Rough node insert CXC",R),_),":first-child"),S=s.insert(()=>(de.debug("Rough node insert CXC",R),R),":first-child")}else S=a.insert("rect",":first-child"),k=a.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return Tr(e,S),e.intersect=function(E){return or.rect(e,E)},s}w(wSe,"rectWithTitle");async function TSe(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return c3(t,e,i)}w(TSe,"roundedRect");var Am=8;async function CSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?Am:Am*2),h=((e==null?void 0:e.height)??o.height)+s*2,d=u-Am,f=h,p=Am-u/2,g=-h/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-Am,y:g+f},{x:p-Am,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(C=>[C.x,C.y]),v),T=a.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path").attr("style",ja(m)),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),l.attr("transform",`translate(${Am/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,T),e.intersect=function(C){return or.rect(e,C)},a}w(CSe,"shadedProcess");async function kSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-a*2,10));const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=dr.svg(o),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],T=Fn(b),C=v.path(T,x),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,b,k)},o}w(kSe,"slopedRect");async function SSe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return c3(t,e,s)}w(SSe,"squareRect");async function ESe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?20:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=l.height+(e.look==="neo"?a*2:a),h=l.width+u/4+(e.look==="neo"?s*2:s),d=u/2,{cssStyles:f}=e,p=dr.svg(o),g=fr(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...k6(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...k6(h/2-d,0,d,50,270,450)],y=Fn(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Tr(e,x),e.intersect=function(b){return or.polygon(e,m,b)},o}w(ESe,"stadium");async function ASe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return c3(t,e,r)}w(ASe,"state");function MSe(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{cssStyles:s}=e,{lineColor:a,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=dr.svg(h),f=fr(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:a,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),s&&v.selectAll("path").attr("style",s),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const T=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",C=T?`${T}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return Tr(e,v),e.intersect=function(T){return or.circle(e,(e.width??0)/2,T)},h}w(MSe,"stateEnd");function RSe(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if(e.look==="handDrawn"){const h=dr.svg(s).circle(0,0,e.width,Nwt(n));a=s.insert(()=>h),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${h})`)}return Tr(e,a),e.intersect=function(u){return or.circle(e,(e.width??7)/2,u)},s}w(RSe,"stateStart");var Vv=8;async function _Se(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,s=e.look==="neo"?28:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+2*Vv+s,h=((e==null?void 0:e.height)??l.height)+a,d=u-2*Vv,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=dr.svg(o),v=fr(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+Vv,g,p+Vv,g+f,v),T=y.line(p+Vv+d,g,p+Vv+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>T,":first-child");const C=o.insert(()=>x,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",ja(S)),Tr(e,C)}else{const y=G0(o,d,f,m);n&&y.attr("style",n),Tr(e,y)}return e.intersect=function(y){return or.polygon(e,m,y)},o}w(_Se,"subroutine");var sB=.2;async function LSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-a*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-sB*(e.height+a*2),10));const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2,h=sB*u,d=sB*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,x=dr.svg(o),b=fr(e,{}),T=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Fn(T),k=x.path(S,b),E=Fn(C),A=x.path(E,{...b,fillStyle:"solid"}),R=o.insert(()=>A,":first-child");return R.insert(()=>k,":first-child"),R.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),Tr(e,R),e.intersect=function(_){return or.polygon(e,T,_)},o}w(LSe,"taggedRect");async function ISe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,Wr(e)),o=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=dr.svg(i),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...bg(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...bg(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],T=Fn(y),C=g.path(T,m),S=Fn(b),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-u/2-(s.y-(s.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,y,A)},i}w(ISe,"taggedWaveEdgedRectangle");async function NSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,Wr(e)),a=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(s.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-a/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",a).attr("height",o),Tr(e,h),e.intersect=function(d){return or.rect(e,d)},i}w(NSe,"text");var t3t=w((t,e,r,n,i,s)=>`M${t},${e} a${i},${s} 0,0,1 0,${-n} l${r},0 a${i},${s} 0,0,1 0,${n} M${r},${-n} a${i},${s} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),K5t=w((t,e,r,n,i,s)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${s} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${s} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Z5t=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Tce=5,Cce=10;async function MSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-s,e.heightb,":first-child"),g=a.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=X5t(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",ja(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),wr(e,g),e.intersect=function(m){const y=or.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},a}w(MSe,"tiltedCylinder");async function RSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=(e.look==="neo",i),a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=F0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,wr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(RSe,"trapezoid");async function _Se(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-a*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),wr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},u}w(_Se,"trapezoidalPentagon");var kce=10,Sce=10;async function LSe(t,e){var T;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-s)/2,e.widthx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,wr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return de.info("Triangle intersect",e,p,C),or.polygon(e,p,C)},a}w(LSe,"triangle");async function ISe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(s??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(a??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=dr.svg(l),T=fr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const C=[{x:-d/2-x,y:g/2},...mg(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=Fn(C),k=b.path(S,T),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),wr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},l}w(ISe,"waveEdgedRectangle");async function NSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const T=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-a-T*(20/9)),e.width=e.width-s*2}const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:p}=e,g=dr.svg(o),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...mg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...mg(u/2,-f/2,-u/2,-f/2,d,-1)],v=Fn(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),wr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},o}w(NSe,"waveRectangle");var As=10;async function DSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-As,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-As,10));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+As,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+s*2+As,d=u-As,f=h-As,p=-d/2,g=-f/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{}),x=[{x:p-As,y:g-As},{x:p-As,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-As}],b=`M${p-As},${g-As} L${p+d},${g-As} L${p+d},${g+f} L${p-As},${g+f} L${p-As},${g-As} + l${-r},0`,"createCylinderPathD"),r3t=w((t,e,r,n,i,s)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${s} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${s} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),n3t=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Ece=5,Ace=10;async function DSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-s,e.heightb,":first-child"),g=a.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=t3t(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",ja(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,g),e.intersect=function(m){const y=or.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},a}w(DSe,"tiltedCylinder");async function OSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=(e.look==="neo",i),a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=G0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(OSe,"trapezoid");async function PSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-a*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},u}w(PSe,"trapezoidalPentagon");var Mce=10,Rce=10;async function $Se(t,e){var T;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-s)/2,e.widthx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,Tr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return de.info("Triangle intersect",e,p,C),or.polygon(e,p,C)},a}w($Se,"triangle");async function BSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(s??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(a??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=dr.svg(l),T=fr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const C=[{x:-d/2-x,y:g/2},...bg(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=Fn(C),k=b.path(S,T),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},l}w(BSe,"waveEdgedRectangle");async function FSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const T=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-a-T*(20/9)),e.width=e.width-s*2}const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:p}=e,g=dr.svg(o),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...bg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...bg(u/2,-f/2,-u/2,-f/2,d,-1)],v=Fn(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),Tr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},o}w(FSe,"waveRectangle");var As=10;async function zSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-As,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-As,10));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+As,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+s*2+As,d=u-As,f=h-As,p=-d/2,g=-f/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{}),x=[{x:p-As,y:g-As},{x:p-As,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-As}],b=`M${p-As},${g-As} L${p+d},${g-As} L${p+d},${g+f} L${p-As},${g+f} L${p-As},${g-As} M${p-As},${g} L${p+d},${g} - M${p},${g-As} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${As/2}, ${As/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+As/2-(o.x-(o.left??0))}, ${-(o.height/2)+As/2-(o.y-(o.top??0))})`),wr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(DSe,"windowPane");var Ece=new Set(["redux-color","redux-dark-color"]),Q5t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function CZ(t,e){var K,q,oe,Q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=vr(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=vr(),{background:re}=Z,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await CZ(t,ie)}const u=vr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Cl(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(C+S+k+E);C+=Z/_,S+=Z/_,k>0&&(k+=Z/_),E>0&&(E+=Z/_)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Z,re)=>Z+((re==null?void 0:re.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Z,re,ie)=>{const me=wt(ie[re]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${F+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&Ece.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const V=L.rectangle(F,z,O,D,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,re]of T.entries()){const me=(Z+1)%2===0&&re.yOffset!==0,te=L.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),O,re==null?void 0:re.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=T2(F,v.height+z,O+F,v.height+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>W).attr("class","divider"),G=T2(C+F,v.height+z,C+F,D+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I),y.insert(()=>W).attr("class","divider"),A){const Z=C+S+F;G=T2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}if(R){const Z=C+S+k+F;G=T2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}for(const Z of b){const re=v.height+z+Z;G=T2(F,re,O+F,re,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(wr(e,B),g&&e.look!=="handDrawn")if(n!=null&&Q5t.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),re=(Q=Z==null?void 0:Z.filter(ie=>ie.includes("stroke")))==null?void 0:Q.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return or.rect(e,Z)},y}w(CZ,"erBox");async function w2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==xp(e)&&(e=xp(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Zo(o,e,{width:Cl(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(zd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=wt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(w2,"addText");function T2(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}w(T2,"lineToPolygon");async function OSe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await UC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await UC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await UC(u,x,m,[x.parseClassifier()]);m+=b+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await UC(h,x,y,[x.parseClassifier()]);y+=b+s}let v=a.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(OSe,"textHelper");async function UC(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=vr();let a="useHtmlLabels"in e?e.useHtmlLabels:zd(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ks(o)&&(a=!0);const l=await Zo(i,SK(h0(o)),{width:Cl(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=wt(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=s.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}w(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&wt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}w(UC,"addText");async function PSe(t,e){var L,I;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??zd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await OSe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const T=-v/2,C=-x/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;b&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,x+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),R=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(R+_+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const F=wt(D[O]),z=F.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let B=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(F.attr("class").includes("methods-group")){const K=Math.max(P,a/2);b?B=Math.max(N,R+_+K+C+a*2+s)+a*2:B=R+_+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-a:B=V),o||(B-=4);let H=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(H=-((W=F.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),F.attr("transform",`translate(${H}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=R+_+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=R+_+P+C+a*2+s,O=m.line(A.x,b?Math.max(N,$):$,A.x+A.width,(b?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const F=D[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return wr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(PSe,"classBox");async function $Se(t,e){var A,R;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Gh(p,`<<${i.type}>>`,0,e.labelStyle):g=await Gh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Gh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const _=await Gh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await Gh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await Gh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await Gh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await Gh(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=_,await Gh(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,x=(((R=p.node())==null?void 0:R.getBBox().height)??200)+a,b=-v/2,T=-x/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,T,v,x,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,P,N)=>{const L=wt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-x/2;let F=b+a/2;(P===0||P===1)&&(F=$),L.attr("transform",`translate(${F}, ${D+a})`)}),m>g+y+o){const _=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,_],[b+v,_],[b+v,_+.001],[b,_+.001]];P=C.polygon(I,S)}else P=C.line(b,_,b+v,_,S);p.insert(()=>P).attr("class","divider")}return wr(e,E),e.intersect=function(_){return or.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w($Se,"requirementBox");async function Gh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Ve(),a=s.htmlLabels??!0,o=await Zo(i,SK(h0(e)),{width:Cl(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=wt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}w(Gh,"addText");var J5t=w(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function BSe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await tB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await tB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await tB(o,"assigned"in e&&e.assigned||"",p);e.width=a;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:R}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||R?L.path(jg(S,k,b,C,A||0),I):L.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",R??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",J5t(L))}}return wr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(BSe,"kanbanItem");async function FSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0 + M${p},${g-As} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${As/2}, ${As/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+As/2-(o.x-(o.left??0))}, ${-(o.height/2)+As/2-(o.y-(o.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(zSe,"windowPane");var _ce=new Set(["redux-color","redux-dark-color"]),i3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function AZ(t,e){var K,q,oe,Q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=br(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=br(),{background:re}=Z,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await AZ(t,ie)}const u=br();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Sl(e.label,u)+Z.labelPaddingX*20){const Z=v.width+h*2-(C+S+k+E);C+=Z/_,S+=Z/_,k>0&&(k+=Z/_),E>0&&(E+=Z/_)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Z,re)=>Z+((re==null?void 0:re.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Z,re,ie)=>{const me=wt(ie[re]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${F+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&_ce.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const V=L.rectangle(F,z,O,D,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,re]of T.entries()){const me=(Z+1)%2===0&&re.yOffset!==0,te=L.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),O,re==null?void 0:re.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=k2(F,v.height+z,O+F,v.height+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>W).attr("class","divider"),G=k2(C+F,v.height+z,C+F,D+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I),y.insert(()=>W).attr("class","divider"),A){const Z=C+S+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}if(R){const Z=C+S+k+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}for(const Z of b){const re=v.height+z+Z;G=k2(F,re,O+F,re,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(Tr(e,B),g&&e.look!=="handDrawn")if(n!=null&&i3t.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),re=(Q=Z==null?void 0:Z.filter(ie=>ie.includes("stroke")))==null?void 0:Q.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return or.rect(e,Z)},y}w(AZ,"erBox");async function C2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==kp(e)&&(e=kp(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Zo(o,e,{width:Sl(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Gd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=wt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(C2,"addText");function k2(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}w(k2,"lineToPolygon");async function VSe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await XC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await XC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await XC(u,x,m,[x.parseClassifier()]);m+=b+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await XC(h,x,y,[x.parseClassifier()]);y+=b+s}let v=a.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(VSe,"textHelper");async function XC(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=br();let a="useHtmlLabels"in e?e.useHtmlLabels:Gd(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ks(o)&&(a=!0);const l=await Zo(i,RK(g0(o)),{width:Sl(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=wt(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=s.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}w(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&wt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}w(XC,"addText");async function HSe(t,e){var L,I;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??Gd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await VSe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const T=-v/2,C=-x/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;b&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,x+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),R=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(R+_+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const F=wt(D[O]),z=F.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let B=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(F.attr("class").includes("methods-group")){const K=Math.max(P,a/2);b?B=Math.max(N,R+_+K+C+a*2+s)+a*2:B=R+_+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-a:B=V),o||(B-=4);let H=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(H=-((W=F.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),F.attr("transform",`translate(${H}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=R+_+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=R+_+P+C+a*2+s,O=m.line(A.x,b?Math.max(N,$):$,A.x+A.width,(b?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const F=D[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Tr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(HSe,"classBox");async function GSe(t,e){var A,R;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Uh(p,`<<${i.type}>>`,0,e.labelStyle):g=await Uh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Uh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const _=await Uh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await Uh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await Uh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await Uh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await Uh(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=_,await Uh(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,x=(((R=p.node())==null?void 0:R.getBBox().height)??200)+a,b=-v/2,T=-x/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,T,v,x,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,P,N)=>{const L=wt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-x/2;let F=b+a/2;(P===0||P===1)&&(F=$),L.attr("transform",`translate(${F}, ${D+a})`)}),m>g+y+o){const _=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,_],[b+v,_],[b+v,_+.001],[b,_+.001]];P=C.polygon(I,S)}else P=C.line(b,_,b+v,_,S);p.insert(()=>P).attr("class","divider")}return Tr(e,E),e.intersect=function(_){return or.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(GSe,"requirementBox");async function Uh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Ve(),a=s.htmlLabels??!0,o=await Zo(i,RK(g0(e)),{width:Sl(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=wt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}w(Uh,"addText");var s3t=w(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function WSe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await iB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await iB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await iB(o,"assigned"in e&&e.assigned||"",p);e.width=a;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:R}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||R?L.path(Zg(S,k,b,C,A||0),I):L.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",R??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",s3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(WSe,"kanbanItem");async function qSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 @@ -1191,7 +1191,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(e.look==="handDrawn"){const x=dr.svg(i),b=fr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",ja(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),wr(e,y),e.calcIntersect=function(x,b){return or.rect(x,b)},e.intersect=function(x){return de.info("Bang intersect",e,x),or.rect(e,x)},i}w(FSe,"bang");async function zSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+2*a,u=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 + H0 V0 Z`;if(e.look==="handDrawn"){const x=dr.svg(i),b=fr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",ja(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Tr(e,y),e.calcIntersect=function(x,b){return or.rect(x,b)},e.intersect=function(x){return de.info("Bang intersect",e,x),or.rect(e,x)},i}w(qSe,"bang");async function USe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+2*a,u=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} @@ -1205,7 +1205,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(e.look==="handDrawn"){const v=dr.svg(i),x=fr(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",ja(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),wr(e,m),e.calcIntersect=function(v,x){return or.rect(v,x)},e.intersect=function(v){return de.info("Cloud intersect",e,v),or.rect(e,v)},i}w(zSe,"cloud");async function VSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+8*a,u=s.height+2*a,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const v=dr.svg(i),x=fr(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",ja(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Tr(e,m),e.calcIntersect=function(v,x){return or.rect(v,x)},e.intersect=function(v){return de.info("Cloud intersect",e,v),or.rect(e,v)},i}w(USe,"cloud");async function YSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+8*a,u=s.height+2*a,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -1225,33 +1225,33 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error h${-(l-2*h)} q${-h},0 ${-h},${-h} Z - `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),i.append(()=>o.node()),wr(e,f),e.calcIntersect=function(p,g){return or.rect(p,g)},e.intersect=function(p){return or.rect(e,p)},i}w(VSe,"defaultMindmapNode");async function HSe(t,e){const r={padding:e.padding??0};return TZ(t,e,r)}w(HSe,"mindmapCircle");var e3t=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:bSe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:mSe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:xSe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:kSe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Hke},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Gke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:TZ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:FSe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:zSe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:fSe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Kke},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:aSe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:sSe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:RSe},{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:nSe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:qke},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:ASe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Dke},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ySe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:CSe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:TSe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:jke},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Zke},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Bke},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Fke},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:zke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:oSe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ISe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Xke},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:MSe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:lSe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Vke},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Wke},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:LSe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:DSe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Uke},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:_Se},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Yke},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:vSe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:hSe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:uSe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Nke},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:$ke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:ESe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:SSe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:NSe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:pSe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:cSe}],t3t=w(()=>{const e=[...Object.entries({state:wSe,choice:Oke,note:dSe,rectWithTitle:gSe,labelRect:iSe,iconSquare:tSe,iconCircle:Jke,icon:Qke,iconRounded:eSe,imageSquare:rSe,anchor:Lke,kanbanItem:BSe,mindmapCircle:HSe,defaultMindmapNode:VSe,classBox:PSe,erBox:CZ,requirementBox:$Se}),...e3t.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),GSe=t3t();function WSe(t){return t in GSe}w(WSe,"isValidShape");var sD=new Map;async function r7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?GSe[e.shape]:void 0;if(!s)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let a;r.config.securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a??null),i=await s(n,e,r)}else i=await s(t,e,r),n=i;return n.attr("data-look",ja(e.look)),e.tooltip&&i.attr("title",e.tooltip),sD.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(r7,"insertNode");var r3t=w((t,e)=>{sD.set(e.id,t)},"setNodeElem"),qSe=w(()=>{sD.clear()},"clear"),u_=w(t=>{const e=sD.get(t.id);de.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),cd=w((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),Oa={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Ace={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function YC(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=is(t),e=is(e);const[r,n]=[t.x,t.y],[i,s]=[e.x,e.y],a=i-r,o=s-n;return{angle:Math.atan(o/a),deltaX:a,deltaY:o}}w(YC,"calculateDeltaAndAngle");var is=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),USe=w(t=>({x:w(function(e,r,n){let i=0;const s=is(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Oa,t.arrowTypeEnd)){const{angle:p,deltaX:g}=YC(n[n.length-1],n[n.length-2]);i=Oa[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const a=Math.abs(is(e).x-is(n[n.length-1]).x),o=Math.abs(is(e).y-is(n[n.length-1]).y),l=Math.abs(is(e).x-is(n[0]).x),u=Math.abs(is(e).y-is(n[0]).y),h=Oa[t.arrowTypeStart],d=Oa[t.arrowTypeEnd],f=1;if(a0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Oa,t.arrowTypeEnd)){const{angle:p,deltaY:g}=YC(n[n.length-1],n[n.length-2]);i=Oa[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const a=Math.abs(is(e).y-is(n[n.length-1]).y),o=Math.abs(is(e).x-is(n[n.length-1]).x),l=Math.abs(is(e).y-is(n[0]).y),u=Math.abs(is(e).x-is(n[0]).x),h=Oa[t.arrowTypeStart],d=Oa[t.arrowTypeEnd],f=1;if(a0&&o0&&u{e.arrowTypeStart&&Mce(t,"start",e.arrowTypeStart,r,n,i,s,a),e.arrowTypeEnd&&Mce(t,"end",e.arrowTypeEnd,r,n,i,s,a)},"addEdgeMarkers"),i3t={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},s3t=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Mce=w((t,e,r,n,i,s,a=!1,o)=>{var g;const l=i3t[r],u=l&&s3t.includes(l.type);if(!l){de.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${s}-${h}${e==="start"?"Start":"End"}${a&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",o),l.fill&&T.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),a3t=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ve())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),T6=new Map,Hs=new Map,YSe=w(()=>{T6.clear(),Hs.clear()},"clear"),tC=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),h_=w(async(t,e)=>{const r=Ve();let n=ui(r);const{labelStyles:i}=cr(e);e.labelStyle=i;const s=t.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Zo(t,e.label,{style:tC(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);a.node().appendChild(u),de.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=wt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=wt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}a.attr("transform",cd(d,n)),T6.set(e.id,s),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await $p(g,e.startLabelLeft,tC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",cd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).startLeft=p,jC(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await $p(g,e.startLabelRight,tC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",cd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).startRight=p,jC(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await $p(p,e.endLabelLeft,tC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",cd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).endLeft=p,jC(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await $p(p,e.endLabelRight,tC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",cd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).endRight=p,jC(f,e.endLabelRight)}return u},"insertEdgeLabel");function jC(t,e){ui(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(jC,"setTerminalWidth");var jSe=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,T6.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=s3(n);if(t.label){const s=T6.get(t.id);let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const s=Hs.get(t.id).startLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Hs.get(t.id).startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Hs.get(t.id).endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Hs.get(t.id).endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),o3t=w((t,e)=>{var a;if(!(t!=null&&t.isLabelEdge)||!((a=t==null?void 0:t.id)!=null&&a.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y);return i<.001||s<.001?e:s>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),l3t=w((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),a=t.width/2,o=t.height/2;return i>=a||s>=o},"outsideNode"),c3t=w((t,e,r)=>{de.debug(`intersection calc abc89: + `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),i.append(()=>o.node()),Tr(e,f),e.calcIntersect=function(p,g){return or.rect(p,g)},e.intersect=function(p){return or.rect(e,p)},i}w(YSe,"defaultMindmapNode");async function jSe(t,e){const r={padding:e.padding??0};return EZ(t,e,r)}w(jSe,"mindmapCircle");var a3t=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:SSe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:TSe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:ESe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:_Se},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:jke},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Xke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:EZ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:qSe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:USe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:bSe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:rSe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:dSe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:hSe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:OSe},{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:cSe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Zke},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:NSe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:zke},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:CSe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:RSe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:MSe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:eSe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:nSe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Wke},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:qke},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Uke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:fSe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:BSe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:tSe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:DSe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:pSe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Yke},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Kke},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:$Se},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:zSe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Qke},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:PSe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Jke},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:kSe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ySe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:mSe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Fke},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Gke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:ISe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:LSe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:FSe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:xSe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:gSe}],o3t=w(()=>{const e=[...Object.entries({state:ASe,choice:Vke,note:vSe,rectWithTitle:wSe,labelRect:uSe,iconSquare:oSe,iconCircle:sSe,icon:iSe,iconRounded:aSe,imageSquare:lSe,anchor:$ke,kanbanItem:WSe,mindmapCircle:jSe,defaultMindmapNode:YSe,classBox:HSe,erBox:AZ,requirementBox:GSe}),...a3t.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),XSe=o3t();function KSe(t){return t in XSe}w(KSe,"isValidShape");var lD=new Map;async function s7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?XSe[e.shape]:void 0;if(!s)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let a;r.config.securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a??null),i=await s(n,e,r)}else i=await s(t,e,r),n=i;return n.attr("data-look",ja(e.look)),e.tooltip&&i.attr("title",e.tooltip),lD.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(s7,"insertNode");var l3t=w((t,e)=>{lD.set(e.id,t)},"setNodeElem"),ZSe=w(()=>{lD.clear()},"clear"),p_=w(t=>{const e=lD.get(t.id);de.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),dd=w((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),Oa={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Lce={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function KC(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=is(t),e=is(e);const[r,n]=[t.x,t.y],[i,s]=[e.x,e.y],a=i-r,o=s-n;return{angle:Math.atan(o/a),deltaX:a,deltaY:o}}w(KC,"calculateDeltaAndAngle");var is=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),QSe=w(t=>({x:w(function(e,r,n){let i=0;const s=is(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Oa,t.arrowTypeEnd)){const{angle:p,deltaX:g}=KC(n[n.length-1],n[n.length-2]);i=Oa[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const a=Math.abs(is(e).x-is(n[n.length-1]).x),o=Math.abs(is(e).y-is(n[n.length-1]).y),l=Math.abs(is(e).x-is(n[0]).x),u=Math.abs(is(e).y-is(n[0]).y),h=Oa[t.arrowTypeStart],d=Oa[t.arrowTypeEnd],f=1;if(a0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Oa,t.arrowTypeEnd)){const{angle:p,deltaY:g}=KC(n[n.length-1],n[n.length-2]);i=Oa[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const a=Math.abs(is(e).y-is(n[n.length-1]).y),o=Math.abs(is(e).x-is(n[n.length-1]).x),l=Math.abs(is(e).y-is(n[0]).y),u=Math.abs(is(e).x-is(n[0]).x),h=Oa[t.arrowTypeStart],d=Oa[t.arrowTypeEnd],f=1;if(a0&&o0&&u{e.arrowTypeStart&&Ice(t,"start",e.arrowTypeStart,r,n,i,s,a),e.arrowTypeEnd&&Ice(t,"end",e.arrowTypeEnd,r,n,i,s,a)},"addEdgeMarkers"),u3t={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},h3t=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Ice=w((t,e,r,n,i,s,a=!1,o)=>{var g;const l=u3t[r],u=l&&h3t.includes(l.type);if(!l){de.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${s}-${h}${e==="start"?"Start":"End"}${a&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",o),l.fill&&T.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),d3t=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ve())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),S6=new Map,Hs=new Map,JSe=w(()=>{S6.clear(),Hs.clear()},"clear"),iC=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),g_=w(async(t,e)=>{const r=Ve();let n=hi(r);const{labelStyles:i}=cr(e);e.labelStyle=i;const s=t.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Zo(t,e.label,{style:iC(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);a.node().appendChild(u),de.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=wt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=wt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}a.attr("transform",dd(d,n)),S6.set(e.id,s),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Vp(g,e.startLabelLeft,iC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",dd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).startLeft=p,ZC(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Vp(g,e.startLabelRight,iC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",dd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).startRight=p,ZC(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Vp(p,e.endLabelLeft,iC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",dd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).endLeft=p,ZC(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Vp(p,e.endLabelRight,iC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=wt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",dd(y,n)),Hs.get(e.id)||Hs.set(e.id,{}),Hs.get(e.id).endRight=p,ZC(f,e.endLabelRight)}return u},"insertEdgeLabel");function ZC(t,e){hi(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(ZC,"setTerminalWidth");var e6e=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,S6.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=l3(n);if(t.label){const s=S6.get(t.id);let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const s=Hs.get(t.id).startLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Hs.get(t.id).startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Hs.get(t.id).endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Hs.get(t.id).endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),f3t=w((t,e)=>{var a;if(!(t!=null&&t.isLabelEdge)||!((a=t==null?void 0:t.id)!=null&&a.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y);return i<.001||s<.001?e:s>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),p3t=w((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),a=t.width/2,o=t.height/2;return i>=a||s>=o},"outsideNode"),g3t=w((t,e,r)=>{de.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,s=Math.abs(n-r.x),a=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{de.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(de.info("abc88 checking point",s,e),!l3t(e,s)&&!i){const a=c3t(e,n,s);de.debug("abc88 inside",s,n,a),de.debug("abc88 intersection",a,e);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?de.warn("abc88 no intersect",a,r):r.push(a),i=!0}else de.warn("abc88 outside",s,n),n=s,i||r.push(s)}),de.debug("returning points",r),r},"cutPathAtIntersect");function XSe(t){const e=[],r=[];for(let n=1;n5&&Math.abs(s.y-i.y)>5||i.y===s.y&&s.x===a.x&&Math.abs(s.x-i.x)>5&&Math.abs(s.y-a.y)>5)&&(e.push(s),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}w(XSe,"extractCornerPoints");var _ce=w(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i),a=r/s;return{x:e.x-a*n,y:e.y-a*i}},"findAdjacentPoint"),u3t=w(function(t){const{cornerPointPositions:e}=XSe(t),r=[];for(let n=0;n10&&Math.abs(s.y-i.y)>=10){de.debug("Corner point fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));const p=5;a.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else de.debug("Corner point skipping fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),h3t=w((t,e,r)=>{const n=t-e-r,i=2,s=2,a=i+s,o=Math.floor(n/a),l=Array(o).fill(`${i} ${s}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),kZ=w(function(t,e,r,n,i,s,a,o=!1){var D;if(!a)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Ve();let h=e.points,d=!1;const f=i;var p=s;const g=[];for(const F in e.cssCompiledStyles)KK(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),z=F[0],V=F[F.length-1],B=.5,H=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(F.y));const v=a3t(e.curve);v!=="rounded"&&(y=u3t(y));let x=Yk;switch(v){case"linear":x=Yk;break;case"basis":x=m6;break;case"cardinal":x=g5e;break;case"bumpX":x=u5e;break;case"bumpY":x=h5e;break;case"catmullRom":x=y5e;break;case"monotoneX":x=C5e;break;case"monotoneY":x=k5e;break;case"natural":x=E5e;break;case"step":x=A5e;break;case"stepAfter":x=R5e;break;case"stepBefore":x=M5e;break;case"rounded":x=Yk;break;default:x=m6}const{x:b,y:T}=USe(e),C=g6().x(b).y(T).curve(x);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,E=v==="rounded"?KSe(ZSe(y,e),5):C(y);const A=Array.isArray(e.style)?e.style:[e.style];let R=A.find(F=>F==null?void 0:F.startsWith("stroke:")),_="";e.animate&&(_="edge-animation-fast"),e.animation&&(_="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const F=dr.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",k=wt(z).select("path").attr("id",`${a}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",A?A.reduce((B,H)=>B+";"+H,""):"");let V=k.attr("d");k.attr("d",V),t.node().appendChild(k.node())}else{const F=g.join(";"),z=A?A.reduce((K,q)=>K+q+";",""):"",V=(F?F+";"+z+";":z)+";"+(A?A.reduce((K,q)=>K+";"+q,""):"");k=t.append("path").attr("d",E).attr("id",`${a}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",V),R=(D=V.match(/stroke:([^;]+)/))==null?void 0:D[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=k.node(),H=typeof B.getTotalLength=="function"?B.getTotalLength():0,G=Ace[e.arrowTypeStart]||0,W=Ace[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?h3t(H,G,W):`0 ${G} ${H-G-W} ${W}`}; stroke-dashoffset: 0;`;k.attr("style",q+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",m),k.attr("data-look",ja(e.look)),e.showPoints&&y.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let N="";(Ve().flowchart.arrowMarkerAbsolute||Ve().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),de.info("arrowTypeStart",e.arrowTypeStart),de.info("arrowTypeEnd",e.arrowTypeEnd);const L=!P&&(e==null?void 0:e.look)==="neo";n3t(k,e,N,a,n,L,R);const I=Math.floor(h.length/2),$=h[I];Kr.isLabelCoordinateInPath($,k.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function KSe(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let s=0;s({...i}));if(t.length>=2&&Oa[e.arrowTypeStart]){const i=Oa[e.arrowTypeStart],s=t[0],a=t[1],{angle:o}=RG(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=s.x+l,r[0].y=s.y+u}const n=t.length;if(n>=2&&Oa[e.arrowTypeEnd]){const i=Oa[e.arrowTypeEnd],s=t[n-1],a=t[n-2],{angle:o}=RG(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=s.x-l,r[n-1].y=s.y-u}return r}w(ZSe,"applyMarkerOffsetsToPoints");var d3t=w((t,e,r,n)=>{e.forEach(i=>{O3t[i](t,r,n)})},"insertMarkers"),f3t=w((t,e,r)=>{de.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),p3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),g3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),m3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),y3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),v3t=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),b3t=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),x3t=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),w3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),T3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{transitionColor:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),C3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),k3t=w((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),S3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),E3t=w((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),A3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{strokeWidth:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),M3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{strokeWidth:s,mainBkg:a}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),R3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{strokeWidth:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),_3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{strokeWidth:s,mainBkg:a}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),L3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,s=Math.abs(n-r.x),a=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{de.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(de.info("abc88 checking point",s,e),!p3t(e,s)&&!i){const a=g3t(e,n,s);de.debug("abc88 inside",s,n,a),de.debug("abc88 intersection",a,e);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?de.warn("abc88 no intersect",a,r):r.push(a),i=!0}else de.warn("abc88 outside",s,n),n=s,i||r.push(s)}),de.debug("returning points",r),r},"cutPathAtIntersect");function t6e(t){const e=[],r=[];for(let n=1;n5&&Math.abs(s.y-i.y)>5||i.y===s.y&&s.x===a.x&&Math.abs(s.x-i.x)>5&&Math.abs(s.y-a.y)>5)&&(e.push(s),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}w(t6e,"extractCornerPoints");var Dce=w(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i),a=r/s;return{x:e.x-a*n,y:e.y-a*i}},"findAdjacentPoint"),m3t=w(function(t){const{cornerPointPositions:e}=t6e(t),r=[];for(let n=0;n10&&Math.abs(s.y-i.y)>=10){de.debug("Corner point fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));const p=5;a.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else de.debug("Corner point skipping fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),y3t=w((t,e,r)=>{const n=t-e-r,i=2,s=2,a=i+s,o=Math.floor(n/a),l=Array(o).fill(`${i} ${s}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),MZ=w(function(t,e,r,n,i,s,a,o=!1){var D;if(!a)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Ve();let h=e.points,d=!1;const f=i;var p=s;const g=[];for(const F in e.cssCompiledStyles)eZ(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),z=F[0],V=F[F.length-1],B=.5,H=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(F.y));const v=d3t(e.curve);v!=="rounded"&&(y=m3t(y));let x=Kk;switch(v){case"linear":x=Kk;break;case"basis":x=b6;break;case"cardinal":x=w5e;break;case"bumpX":x=m5e;break;case"bumpY":x=y5e;break;case"catmullRom":x=C5e;break;case"monotoneX":x=R5e;break;case"monotoneY":x=_5e;break;case"natural":x=I5e;break;case"step":x=N5e;break;case"stepAfter":x=O5e;break;case"stepBefore":x=D5e;break;case"rounded":x=Kk;break;default:x=b6}const{x:b,y:T}=QSe(e),C=v6().x(b).y(T).curve(x);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,E=v==="rounded"?r6e(n6e(y,e),5):C(y);const A=Array.isArray(e.style)?e.style:[e.style];let R=A.find(F=>F==null?void 0:F.startsWith("stroke:")),_="";e.animate&&(_="edge-animation-fast"),e.animation&&(_="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const F=dr.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",k=wt(z).select("path").attr("id",`${a}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",A?A.reduce((B,H)=>B+";"+H,""):"");let V=k.attr("d");k.attr("d",V),t.node().appendChild(k.node())}else{const F=g.join(";"),z=A?A.reduce((K,q)=>K+q+";",""):"",V=(F?F+";"+z+";":z)+";"+(A?A.reduce((K,q)=>K+";"+q,""):"");k=t.append("path").attr("d",E).attr("id",`${a}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",V),R=(D=V.match(/stroke:([^;]+)/))==null?void 0:D[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=k.node(),H=typeof B.getTotalLength=="function"?B.getTotalLength():0,G=Lce[e.arrowTypeStart]||0,W=Lce[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?y3t(H,G,W):`0 ${G} ${H-G-W} ${W}`}; stroke-dashoffset: 0;`;k.attr("style",q+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",m),k.attr("data-look",ja(e.look)),e.showPoints&&y.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let N="";(Ve().flowchart.arrowMarkerAbsolute||Ve().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),de.info("arrowTypeStart",e.arrowTypeStart),de.info("arrowTypeEnd",e.arrowTypeEnd);const L=!P&&(e==null?void 0:e.look)==="neo";c3t(k,e,N,a,n,L,R);const I=Math.floor(h.length/2),$=h[I];Kr.isLabelCoordinateInPath($,k.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function r6e(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let s=0;s({...i}));if(t.length>=2&&Oa[e.arrowTypeStart]){const i=Oa[e.arrowTypeStart],s=t[0],a=t[1],{angle:o}=NG(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=s.x+l,r[0].y=s.y+u}const n=t.length;if(n>=2&&Oa[e.arrowTypeEnd]){const i=Oa[e.arrowTypeEnd],s=t[n-1],a=t[n-2],{angle:o}=NG(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=s.x-l,r[n-1].y=s.y-u}return r}w(n6e,"applyMarkerOffsetsToPoints");var v3t=w((t,e,r,n)=>{e.forEach(i=>{V3t[i](t,r,n)})},"insertMarkers"),b3t=w((t,e,r)=>{de.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),x3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),w3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),T3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),C3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),k3t=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),S3t=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),E3t=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),A3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),M3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{transitionColor:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),R3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),_3t=w((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),L3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),I3t=w((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),N3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{strokeWidth:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),D3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{strokeWidth:s,mainBkg:a}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),O3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{strokeWidth:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),P3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{strokeWidth:s,mainBkg:a}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),$3t=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`)},"requirement_arrow"),I3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{strokeWidth:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L0,20`)},"requirement_arrow"),B3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{strokeWidth:s}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).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"),N3t=w((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),D3t=w((t,e,r)=>{const n=vr(),{themeVariables:i}=n,{strokeWidth:s}=i,a=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");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",`${s}`)},"requirement_contains_neo"),O3t={extension:f3t,composition:p3t,aggregation:g3t,dependency:m3t,lollipop:y3t,point:v3t,circle:b3t,cross:x3t,barb:w3t,barbNeo:T3t,only_one:C3t,zero_or_one:k3t,one_or_more:S3t,zero_or_more:E3t,only_one_neo:A3t,zero_or_one_neo:M3t,one_or_more_neo:R3t,zero_or_more_neo:_3t,requirement_arrow:L3t,requirement_contains:N3t,requirement_arrow_neo:I3t,requirement_contains_neo:D3t},SZ=d3t,P3t={common:Vt,getConfig:vr,insertCluster:iD,insertEdge:kZ,insertEdgeLabel:h_,insertMarkers:SZ,insertNode:r7,interpolateToCurve:nZ,labelHelper:Qr,log:de,positionEdgeLabel:jSe},C6={},QSe=w(t=>{for(const e of t)C6[e.name]=e},"registerLayoutLoaders"),$3t=w(()=>{QSe([{name:"dagre",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>yHt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>RHt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>bXt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");$3t();var o3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in C6))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=C6[t.layoutAlgorithm],i=await n.loader(),{theme:s,themeVariables:a}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=a,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,P3t,{algorithm:n.algorithm},r)},"render"),n7=w((t="",{fallback:e="dagre"}={})=>{if(t in C6)return t;if(e in C6)return de.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),EZ="comm",JSe="rule",e6e="decl",B3t="@media",F3t="@import",z3t="@supports",V3t="@namespace",_G="@keyframes",t6e="@layer",H3t="@scope",G3t=Math.abs,Zk=String.fromCharCode;function r6e(t){return t.trim()}function LG(t,e,r){return t.replace(e,r)}function Rb(t,e){return t.charCodeAt(e)|0}function c5(t,e,r){return t.slice(e,r)}function td(t){return t.length}function n6e(t){return t.length}function PA(t,e){return e.push(t),t}var aD=1,u5=1,i6e=0,Eu=0,na=0,l3="";function AZ(t,e,r,n,i,s,a,o){return{value:t,root:e,parent:r,type:n,props:i,children:s,line:aD,column:u5,length:a,return:"",siblings:o}}function W3t(){return na}function q3t(){return na=Eu>0?Rb(l3,--Eu):0,u5--,na===10&&(u5=1,aD--),na}function ph(){return na=Eu2||k6(na)>3?"":" "}function X3t(t,e){for(;--e&&ph()&&!(na<48||na>102||na>57&&na<65||na>70&&na<97););return oD(t,NM()+(e<6&&Bp()==32&&ph()==32))}function IG(t){for(;ph();)switch(na){case t:return Eu;case 34:case 39:t!==34&&t!==39&&IG(na);break;case 40:t===41&&IG(t);break;case 92:ph();break}return Eu}function K3t(t,e){for(;ph()&&t+na!==57;)if(t+na===84&&Bp()===47)break;return"/*"+oD(e,Eu-1)+"*"+Zk(t===47?t:ph())}function Z3t(t){for(;!k6(Bp());)ph();return oD(t,Eu)}function Q3t(t){return Y3t(DM("",null,null,null,[""],t=U3t(t),0,[0],t))}function DM(t,e,r,n,i,s,a,o,l){for(var u=0,h=0,d=a,f=0,p=0,g=0,m=1,y=1,v=1,x=0,b=0,T="",C=i,S=s,k=n,E=T;y;)switch(g=b,b=ph()){case 40:g!=108&&Rb(E,d-1)==58?(x++,E+="("):E+=nB(b);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=nB(b);break;case 9:case 10:case 13:case 32:if(x>0){E+=Zk(b);break}E+=j3t(g);break;case 92:E+=X3t(NM()-1,7);continue;case 47:switch(Bp()){case 42:case 47:PA(J3t(K3t(ph(),NM()),e,r,l),l),(k6(g||1)==5||k6(Bp()||1)==5)&&td(E)&&c5(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=td(E)*v;case 125*m:case 59:case 0:if(x>0&&b){E+=Zk(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=LG(E,/\f/g,"")),p>0&&(td(E)-d||m===0)&&PA(p>32?Ice(E+";",n,r,d-1,l):Ice(LG(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(PA(k=Lce(E,e,r,u,h,i,o,T,C=[],S=[],d,s),s),b===123)if(h===0)DM(E,e,k,k,C,s,d,o,S);else{switch(f){case 99:if(Rb(E,3)===110)break;case 108:if(Rb(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?DM(t,k,k,n&&PA(Lce(t,k,k,0,0,i,o,T,i,C=[],d,S),S),i,S,d,o,n?C:S):DM(E,k,k,k,[""],S,0,o,S)}}u=h=p=0,m=v=1,T=E="",d=a;break;case 58:d=1+td(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&q3t()==125)continue}switch(E+=Zk(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(x>0)break;o[u++]=(td(E)-1)*v,v=1;break;case 64:Bp()===45&&(E+=nB(ph())),f=Bp(),h=d=td(T=E+=Z3t(NM())),b++;break;case 45:g===45&&td(E)==2&&(m=0)}}return s}function Lce(t,e,r,n,i,s,a,o,l,u,h,d){for(var f=i-1,p=i===0?s:[""],g=n6e(p),m=0,y=0,v=0;m0?p[x]+" "+b:LG(b,/&\f/g,p[x])))&&(l[v++]=T);return AZ(t,e,r,i===0?JSe:o,l,u,h,d)}function J3t(t,e,r,n){return AZ(t,e,r,EZ,Zk(W3t()),c5(t,2,-2),0,n)}function Ice(t,e,r,n,i){return AZ(t,e,r,e6e,c5(t,0,n),c5(t,n+1,-1),n,i)}function NG(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),nCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>pKt);return{diagram:e}},void 0,import.meta.url);return{id:s6e,diagram:t}},"loader"),iCt={id:s6e,detector:rCt,loader:nCt},sCt=iCt,a6e="flowchart",aCt=w((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),oCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gee);return{diagram:e}},void 0,import.meta.url);return{id:a6e,diagram:t}},"loader"),lCt={id:a6e,detector:aCt,loader:oCt},cCt=lCt,o6e="flowchart-v2",uCt=w((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),hCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gee);return{diagram:e}},void 0,import.meta.url);return{id:o6e,diagram:t}},"loader"),dCt={id:o6e,detector:uCt,loader:hCt},fCt=dCt,l6e="swimlane",pCt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),gCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RKt);return{diagram:e}},void 0,import.meta.url);return{id:l6e,diagram:t}},"loader"),mCt={id:l6e,detector:pCt,loader:gCt},yCt=mCt,c6e="er",vCt=w(t=>/^\s*erDiagram/.test(t),"detector"),bCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$Kt);return{diagram:e}},void 0,import.meta.url);return{id:c6e,diagram:t}},"loader"),xCt={id:c6e,detector:vCt,loader:bCt},wCt=xCt,u6e="gitGraph",TCt=w(t=>/^\s*gitGraph/.test(t),"detector"),CCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hhr);return{diagram:e}},void 0,import.meta.url);return{id:u6e,diagram:t}},"loader"),kCt={id:u6e,detector:TCt,loader:CCt},SCt=kCt,h6e="gantt",ECt=w(t=>/^\s*gantt/.test(t),"detector"),ACt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Kdr);return{diagram:e}},void 0,import.meta.url);return{id:h6e,diagram:t}},"loader"),MCt={id:h6e,detector:ECt,loader:ACt},RCt=MCt,d6e="info",_Ct=w(t=>/^\s*info/.test(t),"detector"),LCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ifr);return{diagram:e}},void 0,import.meta.url);return{id:d6e,diagram:t}},"loader"),ICt={id:d6e,detector:_Ct,loader:LCt},f6e="pie",NCt=w(t=>/^\s*pie/.test(t),"detector"),DCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wfr);return{diagram:e}},void 0,import.meta.url);return{id:f6e,diagram:t}},"loader"),OCt={id:f6e,detector:NCt,loader:DCt},p6e="quadrantChart",PCt=w(t=>/^\s*quadrantChart/.test(t),"detector"),$Ct=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Rfr);return{diagram:e}},void 0,import.meta.url);return{id:p6e,diagram:t}},"loader"),BCt={id:p6e,detector:PCt,loader:$Ct},FCt=BCt,g6e="xychart",zCt=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),VCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wfr);return{diagram:e}},void 0,import.meta.url);return{id:g6e,diagram:t}},"loader"),HCt={id:g6e,detector:zCt,loader:VCt},GCt=HCt,m6e="requirement",WCt=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),qCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Qfr);return{diagram:e}},void 0,import.meta.url);return{id:m6e,diagram:t}},"loader"),UCt={id:m6e,detector:WCt,loader:qCt},YCt=UCt,y6e="sequence",jCt=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),XCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Y0r);return{diagram:e}},void 0,import.meta.url);return{id:y6e,diagram:t}},"loader"),KCt={id:y6e,detector:jCt,loader:XCt},ZCt=KCt,v6e="class",QCt=w((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),JCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>J0r);return{diagram:e}},void 0,import.meta.url);return{id:v6e,diagram:t}},"loader"),ekt={id:v6e,detector:QCt,loader:JCt},tkt=ekt,b6e="classDiagram",rkt=w((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),nkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>tpr);return{diagram:e}},void 0,import.meta.url);return{id:b6e,diagram:t}},"loader"),ikt={id:b6e,detector:rkt,loader:nkt},skt=ikt,x6e="state",akt=w((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),okt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wpr);return{diagram:e}},void 0,import.meta.url);return{id:x6e,diagram:t}},"loader"),lkt={id:x6e,detector:akt,loader:okt},ckt=lkt,w6e="stateDiagram",ukt=w((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),hkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Upr);return{diagram:e}},void 0,import.meta.url);return{id:w6e,diagram:t}},"loader"),dkt={id:w6e,detector:ukt,loader:hkt},fkt=dkt,T6e="journey",pkt=w(t=>/^\s*journey/.test(t),"detector"),gkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>pgr);return{diagram:e}},void 0,import.meta.url);return{id:T6e,diagram:t}},"loader"),mkt={id:T6e,detector:pkt,loader:gkt},ykt=mkt,vkt=w((t,e,r)=>{de.debug(`rendering svg for syntax error -`);const n=Xo(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Fs(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),C6e={draw:vkt},bkt=C6e,xkt={db:{},renderer:C6e,parser:{parse:w(()=>{},"parse")}},wkt=xkt,k6e="flowchart-elk",Tkt=w((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),Ckt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gee);return{diagram:e}},void 0,import.meta.url);return{id:k6e,diagram:t}},"loader"),kkt={id:k6e,detector:Tkt,loader:Ckt},Skt=kkt,S6e="timeline",Ekt=w(t=>/^\s*timeline/.test(t),"detector"),Akt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ggr);return{diagram:e}},void 0,import.meta.url);return{id:S6e,diagram:t}},"loader"),Mkt={id:S6e,detector:Ekt,loader:Akt},Rkt=Mkt,E6e="mindmap",_kt=w(t=>/^\s*mindmap/.test(t),"detector"),Lkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>smr);return{diagram:e}},void 0,import.meta.url);return{id:E6e,diagram:t}},"loader"),Ikt={id:E6e,detector:_kt,loader:Lkt},Nkt=Ikt,A6e="kanban",Dkt=w(t=>/^\s*kanban/.test(t),"detector"),Okt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Smr);return{diagram:e}},void 0,import.meta.url);return{id:A6e,diagram:t}},"loader"),Pkt={id:A6e,detector:Dkt,loader:Okt},$kt=Pkt,M6e="sankey",Bkt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),Fkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>u1r);return{diagram:e}},void 0,import.meta.url);return{id:M6e,diagram:t}},"loader"),zkt={id:M6e,detector:Bkt,loader:Fkt},Vkt=zkt,R6e="packet",Hkt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),Gkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>w1r);return{diagram:e}},void 0,import.meta.url);return{id:R6e,diagram:t}},"loader"),Wkt={id:R6e,detector:Hkt,loader:Gkt},_6e="radar",qkt=w(t=>/^\s*radar-beta/.test(t),"detector"),Ukt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>H1r);return{diagram:e}},void 0,import.meta.url);return{id:_6e,diagram:t}},"loader"),Ykt={id:_6e,detector:qkt,loader:Ukt},L6e="block",jkt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),Xkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gvr);return{diagram:e}},void 0,import.meta.url);return{id:L6e,diagram:t}},"loader"),Kkt={id:L6e,detector:jkt,loader:Xkt},Zkt=Kkt,I6e="treeView",Qkt=w(t=>/^\s*treeView-beta/.test(t),"detector"),Jkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Fvr);return{diagram:e}},void 0,import.meta.url);return{id:I6e,diagram:t}},"loader"),eSt={id:I6e,detector:Qkt,loader:Jkt},tSt=eSt,N6e="architecture",rSt=w(t=>/^\s*architecture/.test(t),"detector"),nSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>f2r);return{diagram:e}},void 0,import.meta.url);return{id:N6e,diagram:t}},"loader"),iSt={id:N6e,detector:rSt,loader:nSt},sSt=iSt,D6e="eventmodeling",aSt=w(t=>/^\s*eventmodeling/.test(t),"detector"),oSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>R2r);return{diagram:e}},void 0,import.meta.url);return{id:D6e,diagram:t}},"loader"),lSt={id:D6e,detector:aSt,loader:oSt},cSt=lSt,O6e="ishikawa",uSt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),hSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>U2r);return{diagram:e}},void 0,import.meta.url);return{id:O6e,diagram:t}},"loader"),dSt={id:O6e,detector:uSt,loader:hSt},P6e="venn",fSt=w(t=>/^\s*venn-beta/.test(t),"detector"),pSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Lbr);return{diagram:e}},void 0,import.meta.url);return{id:P6e,diagram:t}},"loader"),gSt={id:P6e,detector:fSt,loader:pSt},mSt=gSt,$6e="treemap",ySt=w(t=>/^\s*treemap/.test(t),"detector"),vSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hbr);return{diagram:e}},void 0,import.meta.url);return{id:$6e,diagram:t}},"loader"),bSt={id:$6e,detector:ySt,loader:vSt},B6e="wardley",xSt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),wSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>exr);return{diagram:e}},void 0,import.meta.url);return{id:B6e,diagram:t}},"loader"),TSt={id:B6e,detector:xSt,loader:wSt},CSt=TSt,F6e="cynefin",kSt=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),SSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>yxr);return{diagram:e}},void 0,import.meta.url);return{id:F6e,diagram:t}},"loader"),ESt={id:F6e,detector:kSt,loader:SSt},z6e="railroad",ASt=w(t=>/^\s*railroad-beta/i.test(t),"detector"),MSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hxr);return{diagram:e}},void 0,import.meta.url);return{id:z6e,diagram:t}},"loader"),RSt={id:z6e,detector:ASt,loader:MSt},V6e="railroadEbnf",_St=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),LSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zxr);return{diagram:e}},void 0,import.meta.url);return{id:V6e,diagram:t}},"loader"),ISt={id:V6e,detector:_St,loader:LSt},H6e="railroadAbnf",NSt=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),DSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>o4r);return{diagram:e}},void 0,import.meta.url);return{id:H6e,diagram:t}},"loader"),OSt={id:H6e,detector:NSt,loader:DSt},G6e="railroadPeg",PSt=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),$St=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>y4r);return{diagram:e}},void 0,import.meta.url);return{id:G6e,diagram:t}},"loader"),BSt={id:G6e,detector:PSt,loader:$St},Nce=!1,lD=w(()=>{Nce||(Nce=!0,M9("error",wkt,t=>t.toLowerCase().trim()==="error"),M9("---",{db:{clear:w(()=>{},"clear")},styles:{},renderer:{draw:w(()=>{},"draw")},parser:{parse:w(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:w(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),NH(Skt,Nkt,sSt),NH(sCt,$kt,skt,tkt,wCt,RCt,ICt,OCt,YCt,ZCt,yCt,fCt,cCt,Rkt,SCt,fkt,ckt,ykt,FCt,Vkt,Wkt,GCt,Zkt,cSt,tSt,Ykt,dSt,bSt,RSt,ISt,OSt,BSt,mSt,CSt,ESt))},"addDiagrams"),FSt=w(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(my).map(async([r,{detector:n,loader:i}])=>{if(i)try{BH(r)}catch{try{const{diagram:s,id:a}=await i();M9(a,s,n)}catch(s){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete my[r],s}}}))).filter(r=>r.status==="rejected");if(e.length>0){de.error(`Failed to load ${e.length} external diagrams`);for(const r of e)de.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),zSt="graphics-document document";function W6e(t,e){t.attr("role",zSt),e!==""&&t.attr("aria-roledescription",e)}w(W6e,"setA11yDiagramInfo");function q6e(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}w(q6e,"addSVGa11yTitleDescription");var ny,DG=(ny=class{constructor(e,r,n,i,s){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=s}static async fromText(e,r={}){var u,h;const n=vr(),i=bK(e,n);e=lTt(e)+` -`;try{BH(i)}catch{const d=Emt(i);if(!d)throw new aTe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();M9(f,p)}const{db:s,parser:a,renderer:o,init:l}=BH(i);return a.parser&&(a.parser.yy=s),(u=s.clear)==null||u.call(s),l==null||l(n),r.title&&((h=s.setDiagramTitle)==null||h.call(s,r.title)),await a.parse(e),new ny(i,e,s,a,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},w(ny,"Diagram"),ny),Dce=[],VSt=w(()=>{Dce.forEach(t=>{t()}),Dce=[]},"attachFunctions"),HSt=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function U6e(t){const e=t.match(sTe);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),F3t=w((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),z3t=w((t,e,r)=>{const n=br(),{themeVariables:i}=n,{strokeWidth:s}=i,a=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");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",`${s}`)},"requirement_contains_neo"),V3t={extension:b3t,composition:x3t,aggregation:w3t,dependency:T3t,lollipop:C3t,point:k3t,circle:S3t,cross:E3t,barb:A3t,barbNeo:M3t,only_one:R3t,zero_or_one:_3t,one_or_more:L3t,zero_or_more:I3t,only_one_neo:N3t,zero_or_one_neo:D3t,one_or_more_neo:O3t,zero_or_more_neo:P3t,requirement_arrow:$3t,requirement_contains:F3t,requirement_arrow_neo:B3t,requirement_contains_neo:z3t},RZ=v3t,H3t={common:Vt,getConfig:br,insertCluster:oD,insertEdge:MZ,insertEdgeLabel:g_,insertMarkers:RZ,insertNode:s7,interpolateToCurve:oZ,labelHelper:Qr,log:de,positionEdgeLabel:e6e},E6={},i6e=w(t=>{for(const e of t)E6[e.name]=e},"registerLayoutLoaders"),G3t=w(()=>{i6e([{name:"dagre",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>NHt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>qHt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>OXt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");G3t();var u3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in E6))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=E6[t.layoutAlgorithm],i=await n.loader(),{theme:s,themeVariables:a}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=a,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,H3t,{algorithm:n.algorithm},r)},"render"),a7=w((t="",{fallback:e="dagre"}={})=>{if(t in E6)return t;if(e in E6)return de.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),_Z="comm",s6e="rule",a6e="decl",W3t="@media",q3t="@import",U3t="@supports",Y3t="@namespace",DG="@keyframes",o6e="@layer",j3t="@scope",X3t=Math.abs,eS=String.fromCharCode;function l6e(t){return t.trim()}function OG(t,e,r){return t.replace(e,r)}function Lb(t,e){return t.charCodeAt(e)|0}function h5(t,e,r){return t.slice(e,r)}function id(t){return t.length}function c6e(t){return t.length}function FA(t,e){return e.push(t),t}var cD=1,d5=1,u6e=0,Ru=0,na=0,h3="";function LZ(t,e,r,n,i,s,a,o){return{value:t,root:e,parent:r,type:n,props:i,children:s,line:cD,column:d5,length:a,return:"",siblings:o}}function K3t(){return na}function Z3t(){return na=Ru>0?Lb(h3,--Ru):0,d5--,na===10&&(d5=1,cD--),na}function yh(){return na=Ru2||A6(na)>3?"":" "}function tCt(t,e){for(;--e&&yh()&&!(na<48||na>102||na>57&&na<65||na>70&&na<97););return uD(t,$M()+(e<6&&Hp()==32&&yh()==32))}function PG(t){for(;yh();)switch(na){case t:return Ru;case 34:case 39:t!==34&&t!==39&&PG(na);break;case 40:t===41&&PG(t);break;case 92:yh();break}return Ru}function rCt(t,e){for(;yh()&&t+na!==57;)if(t+na===84&&Hp()===47)break;return"/*"+uD(e,Ru-1)+"*"+eS(t===47?t:yh())}function nCt(t){for(;!A6(Hp());)yh();return uD(t,Ru)}function iCt(t){return J3t(BM("",null,null,null,[""],t=Q3t(t),0,[0],t))}function BM(t,e,r,n,i,s,a,o,l){for(var u=0,h=0,d=a,f=0,p=0,g=0,m=1,y=1,v=1,x=0,b=0,T="",C=i,S=s,k=n,E=T;y;)switch(g=b,b=yh()){case 40:g!=108&&Lb(E,d-1)==58?(x++,E+="("):E+=aB(b);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=aB(b);break;case 9:case 10:case 13:case 32:if(x>0){E+=eS(b);break}E+=eCt(g);break;case 92:E+=tCt($M()-1,7);continue;case 47:switch(Hp()){case 42:case 47:FA(sCt(rCt(yh(),$M()),e,r,l),l),(A6(g||1)==5||A6(Hp()||1)==5)&&id(E)&&h5(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=id(E)*v;case 125*m:case 59:case 0:if(x>0&&b){E+=eS(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=OG(E,/\f/g,"")),p>0&&(id(E)-d||m===0)&&FA(p>32?Pce(E+";",n,r,d-1,l):Pce(OG(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(FA(k=Oce(E,e,r,u,h,i,o,T,C=[],S=[],d,s),s),b===123)if(h===0)BM(E,e,k,k,C,s,d,o,S);else{switch(f){case 99:if(Lb(E,3)===110)break;case 108:if(Lb(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?BM(t,k,k,n&&FA(Oce(t,k,k,0,0,i,o,T,i,C=[],d,S),S),i,S,d,o,n?C:S):BM(E,k,k,k,[""],S,0,o,S)}}u=h=p=0,m=v=1,T=E="",d=a;break;case 58:d=1+id(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Z3t()==125)continue}switch(E+=eS(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(x>0)break;o[u++]=(id(E)-1)*v,v=1;break;case 64:Hp()===45&&(E+=aB(yh())),f=Hp(),h=d=id(T=E+=nCt($M())),b++;break;case 45:g===45&&id(E)==2&&(m=0)}}return s}function Oce(t,e,r,n,i,s,a,o,l,u,h,d){for(var f=i-1,p=i===0?s:[""],g=c6e(p),m=0,y=0,v=0;m0?p[x]+" "+b:OG(b,/&\f/g,p[x])))&&(l[v++]=T);return LZ(t,e,r,i===0?s6e:o,l,u,h,d)}function sCt(t,e,r,n){return LZ(t,e,r,_Z,eS(K3t()),h5(t,2,-2),0,n)}function Pce(t,e,r,n,i){return LZ(t,e,r,a6e,h5(t,0,n),h5(t,n+1,-1),n,i)}function $G(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),cCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_Kt);return{diagram:e}},void 0,import.meta.url);return{id:h6e,diagram:t}},"loader"),uCt={id:h6e,detector:lCt,loader:cCt},hCt=uCt,d6e="flowchart",dCt=w((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),fCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bee);return{diagram:e}},void 0,import.meta.url);return{id:d6e,diagram:t}},"loader"),pCt={id:d6e,detector:dCt,loader:fCt},gCt=pCt,f6e="flowchart-v2",mCt=w((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),yCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bee);return{diagram:e}},void 0,import.meta.url);return{id:f6e,diagram:t}},"loader"),vCt={id:f6e,detector:mCt,loader:yCt},bCt=vCt,p6e="swimlane",xCt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),wCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>qKt);return{diagram:e}},void 0,import.meta.url);return{id:p6e,diagram:t}},"loader"),TCt={id:p6e,detector:xCt,loader:wCt},CCt=TCt,g6e="er",kCt=w(t=>/^\s*erDiagram/.test(t),"detector"),SCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>JKt);return{diagram:e}},void 0,import.meta.url);return{id:g6e,diagram:t}},"loader"),ECt={id:g6e,detector:kCt,loader:SCt},ACt=ECt,m6e="gitGraph",MCt=w(t=>/^\s*gitGraph/.test(t),"detector"),RCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>idr);return{diagram:e}},void 0,import.meta.url);return{id:m6e,diagram:t}},"loader"),_Ct={id:m6e,detector:MCt,loader:RCt},LCt=_Ct,y6e="gantt",ICt=w(t=>/^\s*gantt/.test(t),"detector"),NCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>dfr);return{diagram:e}},void 0,import.meta.url);return{id:y6e,diagram:t}},"loader"),DCt={id:y6e,detector:ICt,loader:NCt},OCt=DCt,v6e="info",PCt=w(t=>/^\s*info/.test(t),"detector"),$Ct=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xfr);return{diagram:e}},void 0,import.meta.url);return{id:v6e,diagram:t}},"loader"),BCt={id:v6e,detector:PCt,loader:$Ct},b6e="pie",FCt=w(t=>/^\s*pie/.test(t),"detector"),zCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$fr);return{diagram:e}},void 0,import.meta.url);return{id:b6e,diagram:t}},"loader"),VCt={id:b6e,detector:FCt,loader:zCt},x6e="quadrantChart",HCt=w(t=>/^\s*quadrantChart/.test(t),"detector"),GCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>qfr);return{diagram:e}},void 0,import.meta.url);return{id:x6e,diagram:t}},"loader"),WCt={id:x6e,detector:HCt,loader:GCt},qCt=WCt,w6e="xychart",UCt=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),YCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>a0r);return{diagram:e}},void 0,import.meta.url);return{id:w6e,diagram:t}},"loader"),jCt={id:w6e,detector:UCt,loader:YCt},XCt=jCt,T6e="requirement",KCt=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),ZCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>p0r);return{diagram:e}},void 0,import.meta.url);return{id:T6e,diagram:t}},"loader"),QCt={id:T6e,detector:KCt,loader:ZCt},JCt=QCt,C6e="sequence",ekt=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),tkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cpr);return{diagram:e}},void 0,import.meta.url);return{id:C6e,diagram:t}},"loader"),rkt={id:C6e,detector:ekt,loader:tkt},nkt=rkt,k6e="class",ikt=w((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),skt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gpr);return{diagram:e}},void 0,import.meta.url);return{id:k6e,diagram:t}},"loader"),akt={id:k6e,detector:ikt,loader:skt},okt=akt,S6e="classDiagram",lkt=w((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),ckt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ypr);return{diagram:e}},void 0,import.meta.url);return{id:S6e,diagram:t}},"loader"),ukt={id:S6e,detector:lkt,loader:ckt},hkt=ukt,E6e="state",dkt=w((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),fkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>agr);return{diagram:e}},void 0,import.meta.url);return{id:E6e,diagram:t}},"loader"),pkt={id:E6e,detector:dkt,loader:fkt},gkt=pkt,A6e="stateDiagram",mkt=w((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),ykt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lgr);return{diagram:e}},void 0,import.meta.url);return{id:A6e,diagram:t}},"loader"),vkt={id:A6e,detector:mkt,loader:ykt},bkt=vkt,M6e="journey",xkt=w(t=>/^\s*journey/.test(t),"detector"),wkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_gr);return{diagram:e}},void 0,import.meta.url);return{id:M6e,diagram:t}},"loader"),Tkt={id:M6e,detector:xkt,loader:wkt},Ckt=Tkt,kkt=w((t,e,r)=>{de.debug(`rendering svg for syntax error +`);const n=Xo(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Fs(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),R6e={draw:kkt},Skt=R6e,Ekt={db:{},renderer:R6e,parser:{parse:w(()=>{},"parse")}},Akt=Ekt,_6e="flowchart-elk",Mkt=w((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),Rkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bee);return{diagram:e}},void 0,import.meta.url);return{id:_6e,diagram:t}},"loader"),_kt={id:_6e,detector:Mkt,loader:Rkt},Lkt=_kt,L6e="timeline",Ikt=w(t=>/^\s*timeline/.test(t),"detector"),Nkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>smr);return{diagram:e}},void 0,import.meta.url);return{id:L6e,diagram:t}},"loader"),Dkt={id:L6e,detector:Ikt,loader:Nkt},Okt=Dkt,I6e="mindmap",Pkt=w(t=>/^\s*mindmap/.test(t),"detector"),$kt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wmr);return{diagram:e}},void 0,import.meta.url);return{id:I6e,diagram:t}},"loader"),Bkt={id:I6e,detector:Pkt,loader:$kt},Fkt=Bkt,N6e="kanban",zkt=w(t=>/^\s*kanban/.test(t),"detector"),Vkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Vmr);return{diagram:e}},void 0,import.meta.url);return{id:N6e,diagram:t}},"loader"),Hkt={id:N6e,detector:zkt,loader:Vkt},Gkt=Hkt,D6e="sankey",Wkt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),qkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>E1r);return{diagram:e}},void 0,import.meta.url);return{id:D6e,diagram:t}},"loader"),Ukt={id:D6e,detector:Wkt,loader:qkt},Ykt=Ukt,O6e="packet",jkt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),Xkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$1r);return{diagram:e}},void 0,import.meta.url);return{id:O6e,diagram:t}},"loader"),Kkt={id:O6e,detector:jkt,loader:Xkt},P6e="radar",Zkt=w(t=>/^\s*radar-beta/.test(t),"detector"),Qkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>iyr);return{diagram:e}},void 0,import.meta.url);return{id:P6e,diagram:t}},"loader"),Jkt={id:P6e,detector:Zkt,loader:Qkt},$6e="block",eSt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),tSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Lvr);return{diagram:e}},void 0,import.meta.url);return{id:$6e,diagram:t}},"loader"),rSt={id:$6e,detector:eSt,loader:tSt},nSt=rSt,B6e="treeView",iSt=w(t=>/^\s*treeView-beta/.test(t),"detector"),sSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>t2r);return{diagram:e}},void 0,import.meta.url);return{id:B6e,diagram:t}},"loader"),aSt={id:B6e,detector:iSt,loader:sSt},oSt=aSt,F6e="architecture",lSt=w(t=>/^\s*architecture/.test(t),"detector"),cSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>R2r);return{diagram:e}},void 0,import.meta.url);return{id:F6e,diagram:t}},"loader"),uSt={id:F6e,detector:lSt,loader:cSt},hSt=uSt,z6e="eventmodeling",dSt=w(t=>/^\s*eventmodeling/.test(t),"detector"),fSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>q2r);return{diagram:e}},void 0,import.meta.url);return{id:z6e,diagram:t}},"loader"),pSt={id:z6e,detector:dSt,loader:fSt},gSt=pSt,V6e="ishikawa",mSt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),ySt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lbr);return{diagram:e}},void 0,import.meta.url);return{id:V6e,diagram:t}},"loader"),vSt={id:V6e,detector:mSt,loader:ySt},H6e="venn",bSt=w(t=>/^\s*venn-beta/.test(t),"detector"),xSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ybr);return{diagram:e}},void 0,import.meta.url);return{id:H6e,diagram:t}},"loader"),wSt={id:H6e,detector:bSt,loader:xSt},TSt=wSt,G6e="treemap",CSt=w(t=>/^\s*treemap/.test(t),"detector"),kSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ixr);return{diagram:e}},void 0,import.meta.url);return{id:G6e,diagram:t}},"loader"),SSt={id:G6e,detector:CSt,loader:kSt},W6e="wardley",ESt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),ASt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>mxr);return{diagram:e}},void 0,import.meta.url);return{id:W6e,diagram:t}},"loader"),MSt={id:W6e,detector:ESt,loader:ASt},RSt=MSt,q6e="cynefin",_St=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),LSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Nxr);return{diagram:e}},void 0,import.meta.url);return{id:q6e,diagram:t}},"loader"),ISt={id:q6e,detector:_St,loader:LSt},U6e="railroad",NSt=w(t=>/^\s*railroad-beta/i.test(t),"detector"),DSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>i4r);return{diagram:e}},void 0,import.meta.url);return{id:U6e,diagram:t}},"loader"),OSt={id:U6e,detector:NSt,loader:DSt},Y6e="railroadEbnf",PSt=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),$St=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>f4r);return{diagram:e}},void 0,import.meta.url);return{id:Y6e,diagram:t}},"loader"),BSt={id:Y6e,detector:PSt,loader:$St},j6e="railroadAbnf",FSt=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),zSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>C4r);return{diagram:e}},void 0,import.meta.url);return{id:j6e,diagram:t}},"loader"),VSt={id:j6e,detector:FSt,loader:zSt},X6e="railroadPeg",HSt=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),GSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>N4r);return{diagram:e}},void 0,import.meta.url);return{id:X6e,diagram:t}},"loader"),WSt={id:X6e,detector:HSt,loader:GSt},$ce=!1,hD=w(()=>{$ce||($ce=!0,I9("error",Akt,t=>t.toLowerCase().trim()==="error"),I9("---",{db:{clear:w(()=>{},"clear")},styles:{},renderer:{draw:w(()=>{},"draw")},parser:{parse:w(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:w(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),$H(Lkt,Fkt,hSt),$H(hCt,Gkt,hkt,okt,ACt,OCt,BCt,VCt,JCt,nkt,CCt,bCt,gCt,Okt,LCt,bkt,gkt,Ckt,qCt,Ykt,Kkt,XCt,nSt,gSt,oSt,Jkt,vSt,SSt,OSt,BSt,VSt,WSt,TSt,RSt,ISt))},"addDiagrams"),qSt=w(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(vy).map(async([r,{detector:n,loader:i}])=>{if(i)try{HH(r)}catch{try{const{diagram:s,id:a}=await i();I9(a,s,n)}catch(s){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete vy[r],s}}}))).filter(r=>r.status==="rejected");if(e.length>0){de.error(`Failed to load ${e.length} external diagrams`);for(const r of e)de.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),USt="graphics-document document";function K6e(t,e){t.attr("role",USt),e!==""&&t.attr("aria-roledescription",e)}w(K6e,"setA11yDiagramInfo");function Z6e(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}w(Z6e,"addSVGa11yTitleDescription");var sy,BG=(sy=class{constructor(e,r,n,i,s){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=s}static async fromText(e,r={}){var u,h;const n=br(),i=CK(e,n);e=pTt(e)+` +`;try{HH(i)}catch{const d=Imt(i);if(!d)throw new dTe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();I9(f,p)}const{db:s,parser:a,renderer:o,init:l}=HH(i);return a.parser&&(a.parser.yy=s),(u=s.clear)==null||u.call(s),l==null||l(n),r.title&&((h=s.setDiagramTitle)==null||h.call(s,r.title)),await a.parse(e),new sy(i,e,s,a,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},w(sy,"Diagram"),sy),Bce=[],YSt=w(()=>{Bce.forEach(t=>{t()}),Bce=[]},"attachFunctions"),jSt=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Q6e(t){const e=t.match(hTe);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(` -`):e[2];let i=KN(n,{schema:XN})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const s={};return i.displayMode&&(s.displayMode=i.displayMode.toString()),i.title&&(s.title=i.title.toString()),i.config&&(s.config=i.config),{text:t.slice(e[0].length),metadata:s}}w(U6e,"extractFrontMatter");var GSt=w(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),WSt=w(t=>{const{text:e,metadata:r}=U6e(t),{displayMode:n,title:i,config:s={}}=r;return n&&(s.gantt||(s.gantt={}),s.gantt.displayMode=n),{title:i,config:s,text:e}},"processFrontmatter"),qSt=w(t=>{const e=Kr.detectInit(t)??{},r=Kr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:Qwt(t),directive:e}},"processDirectives");function MZ(t){const e=GSt(t),r=WSt(e),n=qSt(r.text),i=es(r.config,n.directive);return t=HSt(n.text),{code:t,title:r.title,config:i}}w(MZ,"preprocessDiagram");function Y6e(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(Y6e,"toBase64");var USt=5e4,YSt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",jSt="sandbox",XSt="loose",KSt="http://www.w3.org/2000/svg",ZSt="http://www.w3.org/1999/xlink",QSt="http://www.w3.org/1999/xhtml",JSt="100%",e6t="100%",t6t="border:0;margin:0;",r6t="margin:0",n6t="allow-top-navigation-by-user-activation allow-popups",i6t='The "iframe" tag is not supported by your browser.',s6t=["foreignobject"],a6t=["dominant-baseline"];function RZ(t){const e=MZ(t);return E9(),Tmt(e.config??{}),e}w(RZ,"processAndSetConfigs");async function j6e(t,e){lD();try{const{code:r,config:n}=RZ(t);return{diagramType:(await K6e(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(j6e,"parse");var Oce=w((t,e,r=[])=>{const n=Jwe(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),o6t=w((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=ui(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{jle(l.styles)||o.forEach(u=>{r.insertRule(Oce(l.id,u,l.styles),r.cssRules.length)}),jle(l.textStyles)||r.insertRule(Oce(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=PH(i)+` +`):e[2];let i=JN(n,{schema:QN})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const s={};return i.displayMode&&(s.displayMode=i.displayMode.toString()),i.title&&(s.title=i.title.toString()),i.config&&(s.config=i.config),{text:t.slice(e[0].length),metadata:s}}w(Q6e,"extractFrontMatter");var XSt=w(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),KSt=w(t=>{const{text:e,metadata:r}=Q6e(t),{displayMode:n,title:i,config:s={}}=r;return n&&(s.gantt||(s.gantt={}),s.gantt.displayMode=n),{title:i,config:s,text:e}},"processFrontmatter"),ZSt=w(t=>{const e=Kr.detectInit(t)??{},r=Kr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:iTt(t),directive:e}},"processDirectives");function IZ(t){const e=XSt(t),r=KSt(e),n=ZSt(r.text),i=es(r.config,n.directive);return t=jSt(n.text),{code:t,title:r.title,config:i}}w(IZ,"preprocessDiagram");function J6e(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(J6e,"toBase64");var QSt=5e4,JSt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",e6t="sandbox",t6t="loose",r6t="http://www.w3.org/2000/svg",n6t="http://www.w3.org/1999/xlink",i6t="http://www.w3.org/1999/xhtml",s6t="100%",a6t="100%",o6t="border:0;margin:0;",l6t="margin:0",c6t="allow-top-navigation-by-user-activation allow-popups",u6t='The "iframe" tag is not supported by your browser.',h6t=["foreignobject"],d6t=["dominant-baseline"];function NZ(t){const e=IZ(t);return _9(),Mmt(e.config??{}),e}w(NZ,"processAndSetConfigs");async function eEe(t,e){hD();try{const{code:r,config:n}=NZ(t);return{diagramType:(await rEe(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(eEe,"parse");var Fce=w((t,e,r=[])=>{const n=sTe(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),f6t=w((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=hi(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Qle(l.styles)||o.forEach(u=>{r.insertRule(Fce(l.id,u,l.styles),r.cssRules.length)}),Qle(l.textStyles)||r.insertRule(Fce(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=zH(i)+` `}else n+=`${t.themeCSS} -`;return n+PH(r)},"createCssStyles"),l6t=w((t,e)=>NG(Q3t(`${t}{${e}}`),tCt([w(function(n,i,s,a){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===_G)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[B3t,z3t,t6e,H3t,"@container","@starting-style"],_G].includes(n.type)||(de.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=EZ))},"addNamespace"),eCt])),"compileCSS"),c6t=w((t,e,r,n)=>{const i=o6t(t,r),s=Hmt(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return l6t(n,s)},"createUserStyles"),u6t=w((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=h0(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),h6t=w((t="",e)=>{var i,s;const r=(s=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&s.height?e.viewBox.baseVal.height+"px":e6t,n=Y6e(`${t}`);return``},"putIntoIFrame"),Pce=w((t,e,r,n,i)=>{const s=t.append("div");s.attr("id",r),n&&s.attr("style",n);const a=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns",KSt);return i&&a.attr("xmlns:xlink",i),a.append("g"),t},"appendDivSvgG");function OG(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(OG,"sandboxedIframe");var d6t=w((t,e,r,n)=>{var i,s,a;(i=t.getElementById(e))==null||i.remove(),(s=t.getElementById(r))==null||s.remove(),(a=t.getElementById(n))==null||a.remove()},"removeExistingElements"),f6t=w(async function(t,e,r){var P,N,L,I,$,O;lD();const n=RZ(e);e=n.code;const i=vr();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??USt)&&(e=YSt);const s=`#${t}`,a="i"+t,o="#"+a,l="d"+t,u="#"+l,h=w(()=>{const F=wt(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=wt(document.body);const f=i.securityLevel===jSt,p=i.securityLevel===XSt,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=OG(wt(r),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt(r);Pce(d,t,l,`font-family: ${g}`,ZSt)}else{if(d6t(document,t,l,a),f){const D=OG(wt(document.body),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt("body");Pce(d,t,l)}let m,y;try{m=await DG.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await DG.fromText("error"),y=D}const v=d.select(u).node(),x=m.type,b=v.firstChild,T=b.firstChild,C=(N=(P=m.renderer).getClasses)==null?void 0:N.call(P,e,m),S=c6t(i,x,C,s),k=document.createElement("style");k.innerHTML=S,b.insertBefore(k,T);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(D){throw i.suppressErrorRendering?h():bkt.draw(e,t,"11.16.1"),D}const E=d.select(`${u} svg`),A=(I=(L=m.db).getAccTitle)==null?void 0:I.call(L),R=(O=($=m.db).getAccDescription)==null?void 0:O.call($);Z6e(x,E,A,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",QSt);let _=d.select(u).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=u6t(_,f,zd(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();_=h6t(_,D)}else p||(_=o0.sanitize(_,{ADD_TAGS:s6t,ADD_ATTR:a6t,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(VSt(),y)throw y;return h(),{diagramType:x,svg:_,bindFunctions:m.db.bindFunctions}},"render");function X6e(t={}){var n;const e=sa({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),xmt(e),e!=null&&e.theme&&e.theme in Qf?e.themeVariables=Qf[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Qf.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?bmt(e):eTe();mK(r.logLevel),lD()}w(X6e,"initialize");var K6e=w((t,e={})=>{const{code:r}=MZ(t);return DG.fromText(r,e)},"getDiagramFromText");function Z6e(t,e,r,n){W6e(e,t),q6e(e,r,n,e.attr("id"))}w(Z6e,"addA11yInfo");var ky=Object.freeze({render:f6t,parse:j6e,getDiagramFromText:K6e,initialize:X6e,getConfig:vr,setConfig:tTe,getSiteConfig:eTe,updateSiteConfig:wmt,reset:w(()=>{E9()},"reset"),globalReset:w(()=>{E9(JT)},"globalReset"),defaultConfig:JT});mK(vr().logLevel);E9(vr());var p6t=w((t,e,r)=>{de.warn(t),oZ(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),Q6e=w(async function(t={querySelector:".mermaid"}){try{await g6t(t)}catch(e){if(oZ(e)&&de.error(e.str),Pc.parseError&&Pc.parseError(e),!t.suppressErrors)throw de.error("Use the suppressErrors option to suppress these errors"),e}},"run"),g6t=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=ky.getConfig();de.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");de.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(de.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),ky.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const s=new Kr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let a;const o=[];for(const l of Array.from(i)){if(de.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${s.next()}`;a=l.innerHTML,a=rke(Kr.entityDecode(a)).trim().replace(//gi,"
    ");const h=Kr.detectInit(a);h&&de.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await rEe(u,a,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){p6t(d,o,Pc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),J6e=w(function(t){ky.initialize(t)},"initialize"),m6t=w(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&J6e(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await Q6e(n)},"init"),y6t=w(async(t,{lazyLoad:e=!0}={})=>{lD(),NH(...t),e===!1&&await FSt()},"registerExternalDiagrams"),eEe=w(function(){if(Pc.startOnLoad){const{startOnLoad:t}=ky.getConfig();t&&Pc.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",eEe,!1);var v6t=w(function(t){Pc.parseError=t},"setParseErrorHandler"),d_=[],iB=!1,tEe=w(async()=>{if(!iB){for(iB=!0;d_.length>0;){const t=d_.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}iB=!1}},"executeQueue"),b6t=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((s,a)=>{ky.parse(t,e).then(o=>{s(o),r(o)},o=>{var l;de.error("Error parsing",o),(l=Pc.parseError)==null||l.call(Pc,o),a(o),n(o)})}),"performCall");d_.push(i),tEe().catch(n)}),"parse"),rEe=w((t,e,r)=>new Promise((n,i)=>{const s=w(()=>new Promise((a,o)=>{ky.render(t,e,r).then(l=>{a(l),n(l)},l=>{var u;de.error("Error parsing",l),(u=Pc.parseError)==null||u.call(Pc,l),o(l),i(l)})}),"performCall");d_.push(s),tEe().catch(i)}),"render"),x6t=w(()=>Object.keys(my).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Pc={startOnLoad:!0,mermaidAPI:ky,parse:b6t,render:rEe,init:m6t,run:Q6e,registerExternalDiagrams:y6t,registerLayoutLoaders:QSe,initialize:J6e,parseError:void 0,contentLoaded:eEe,setParseErrorHandler:v6t,detectType:bK,registerIconPacks:cZ,getRegisteredDiagramsMetadata:x6t},$ce=Pc;/*! Check if previously processed *//*! +`;return n+zH(r)},"createCssStyles"),p6t=w((t,e)=>$G(iCt(`${t}{${e}}`),oCt([w(function(n,i,s,a){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===DG)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[W3t,U3t,o6e,j3t,"@container","@starting-style"],DG].includes(n.type)||(de.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=_Z))},"addNamespace"),aCt])),"compileCSS"),g6t=w((t,e,r,n)=>{const i=f6t(t,r),s=jmt(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return p6t(n,s)},"createUserStyles"),m6t=w((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=g0(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),y6t=w((t="",e)=>{var i,s;const r=(s=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&s.height?e.viewBox.baseVal.height+"px":a6t,n=J6e(`${t}`);return``},"putIntoIFrame"),zce=w((t,e,r,n,i)=>{const s=t.append("div");s.attr("id",r),n&&s.attr("style",n);const a=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns",r6t);return i&&a.attr("xmlns:xlink",i),a.append("g"),t},"appendDivSvgG");function FG(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(FG,"sandboxedIframe");var v6t=w((t,e,r,n)=>{var i,s,a;(i=t.getElementById(e))==null||i.remove(),(s=t.getElementById(r))==null||s.remove(),(a=t.getElementById(n))==null||a.remove()},"removeExistingElements"),b6t=w(async function(t,e,r){var P,N,L,I,$,O;hD();const n=NZ(e);e=n.code;const i=br();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??QSt)&&(e=JSt);const s=`#${t}`,a="i"+t,o="#"+a,l="d"+t,u="#"+l,h=w(()=>{const F=wt(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=wt(document.body);const f=i.securityLevel===e6t,p=i.securityLevel===t6t,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=FG(wt(r),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt(r);zce(d,t,l,`font-family: ${g}`,n6t)}else{if(v6t(document,t,l,a),f){const D=FG(wt(document.body),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt("body");zce(d,t,l)}let m,y;try{m=await BG.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await BG.fromText("error"),y=D}const v=d.select(u).node(),x=m.type,b=v.firstChild,T=b.firstChild,C=(N=(P=m.renderer).getClasses)==null?void 0:N.call(P,e,m),S=g6t(i,x,C,s),k=document.createElement("style");k.innerHTML=S,b.insertBefore(k,T);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(D){throw i.suppressErrorRendering?h():Skt.draw(e,t,"11.16.1"),D}const E=d.select(`${u} svg`),A=(I=(L=m.db).getAccTitle)==null?void 0:I.call(L),R=(O=($=m.db).getAccDescription)==null?void 0:O.call($);nEe(x,E,A,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",i6t);let _=d.select(u).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=m6t(_,f,Gd(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();_=y6t(_,D)}else p||(_=h0.sanitize(_,{ADD_TAGS:h6t,ADD_ATTR:d6t,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(YSt(),y)throw y;return h(),{diagramType:x,svg:_,bindFunctions:m.db.bindFunctions}},"render");function tEe(t={}){var n;const e=sa({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Emt(e),e!=null&&e.theme&&e.theme in r0?e.themeVariables=r0[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=r0.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Smt(e):aTe();xK(r.logLevel),hD()}w(tEe,"initialize");var rEe=w((t,e={})=>{const{code:r}=IZ(t);return BG.fromText(r,e)},"getDiagramFromText");function nEe(t,e,r,n){K6e(e,t),Z6e(e,r,n,e.attr("id"))}w(nEe,"addA11yInfo");var Ey=Object.freeze({render:b6t,parse:eEe,getDiagramFromText:rEe,initialize:tEe,getConfig:br,setConfig:oTe,getSiteConfig:aTe,updateSiteConfig:Amt,reset:w(()=>{_9()},"reset"),globalReset:w(()=>{_9(t5)},"globalReset"),defaultConfig:t5});xK(br().logLevel);_9(br());var x6t=w((t,e,r)=>{de.warn(t),hZ(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),iEe=w(async function(t={querySelector:".mermaid"}){try{await w6t(t)}catch(e){if(hZ(e)&&de.error(e.str),Fc.parseError&&Fc.parseError(e),!t.suppressErrors)throw de.error("Use the suppressErrors option to suppress these errors"),e}},"run"),w6t=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=Ey.getConfig();de.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");de.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(de.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),Ey.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const s=new Kr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let a;const o=[];for(const l of Array.from(i)){if(de.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${s.next()}`;a=l.innerHTML,a=lke(Kr.entityDecode(a)).trim().replace(//gi,"
    ");const h=Kr.detectInit(a);h&&de.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await lEe(u,a,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){x6t(d,o,Fc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),sEe=w(function(t){Ey.initialize(t)},"initialize"),T6t=w(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&sEe(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await iEe(n)},"init"),C6t=w(async(t,{lazyLoad:e=!0}={})=>{hD(),$H(...t),e===!1&&await qSt()},"registerExternalDiagrams"),aEe=w(function(){if(Fc.startOnLoad){const{startOnLoad:t}=Ey.getConfig();t&&Fc.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",aEe,!1);var k6t=w(function(t){Fc.parseError=t},"setParseErrorHandler"),m_=[],oB=!1,oEe=w(async()=>{if(!oB){for(oB=!0;m_.length>0;){const t=m_.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}oB=!1}},"executeQueue"),S6t=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((s,a)=>{Ey.parse(t,e).then(o=>{s(o),r(o)},o=>{var l;de.error("Error parsing",o),(l=Fc.parseError)==null||l.call(Fc,o),a(o),n(o)})}),"performCall");m_.push(i),oEe().catch(n)}),"parse"),lEe=w((t,e,r)=>new Promise((n,i)=>{const s=w(()=>new Promise((a,o)=>{Ey.render(t,e,r).then(l=>{a(l),n(l)},l=>{var u;de.error("Error parsing",l),(u=Fc.parseError)==null||u.call(Fc,l),o(l),i(l)})}),"performCall");m_.push(s),oEe().catch(i)}),"render"),E6t=w(()=>Object.keys(vy).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Fc={startOnLoad:!0,mermaidAPI:Ey,parse:S6t,render:lEe,init:T6t,run:iEe,registerExternalDiagrams:C6t,registerLayoutLoaders:i6e,initialize:sEe,parseError:void 0,contentLoaded:aEe,setParseErrorHandler:k6t,detectType:CK,registerIconPacks:fZ,getRegisteredDiagramsMetadata:E6t},Vce=Fc;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */function w6t(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const T6t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Qp(t){const e=[];for(let r=0,n=t.length;rCc||t.height>Cc)&&(t.width>Cc&&t.height>Cc?t.width>t.height?(t.height*=Cc/t.width,t.width=Cc):(t.width*=Cc/t.height,t.height=Cc):t.width>Cc?(t.height*=Cc/t.width,t.width=Cc):(t.width*=Cc/t.height,t.height=Cc))}function p_(t){return new Promise((e,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>e(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function A6t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function M6t(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(t),A6t(i)}const cc=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||cc(r,e)};function R6t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function _6t(t,e){return nEe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function L6t(t,e,r,n){const i=`.${t}:${e}`,s=r.cssText?R6t(r):_6t(r,n);return document.createTextNode(`${i}{${s}}`)}function Bce(t,e,r,n){const i=window.getComputedStyle(t,r),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=T6t();try{e.className=`${e.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild(L6t(a,r,i,n)),e.appendChild(o)}function I6t(t,e,r){Bce(t,e,":before",r),Bce(t,e,":after",r)}const Fce="application/font-woff",zce="image/jpeg",N6t={woff:Fce,woff2:Fce,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:zce,jpeg:zce,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function D6t(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function _Z(t){const e=D6t(t).toLowerCase();return N6t[e]||""}function O6t(t){return t.split(/,/)[1]}function PG(t){return t.search(/^(data:)/)!==-1}function P6t(t,e){return`data:${e};base64,${t}`}async function sEe(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(r({res:n,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const sB={};function $6t(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function LZ(t,e,r){const n=$6t(t,e,r.includeQueryParams);if(sB[n]!=null)return sB[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const s=await sEe(t,r.fetchRequestInit,({res:a,result:o})=>(e||(e=a.headers.get("Content-Type")||""),O6t(o)));i=P6t(s,e)}catch(s){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return sB[n]=i,i}async function B6t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):p_(e)}async function F6t(t,e){if(t.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=t.clientWidth,s.height=t.clientHeight,a==null||a.drawImage(t,0,0,s.width,s.height);const o=s.toDataURL();return p_(o)}const r=t.poster,n=_Z(r),i=await LZ(r,n,e);return p_(i)}async function z6t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await cD(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function V6t(t,e){return cc(t,HTMLCanvasElement)?B6t(t):cc(t,HTMLVideoElement)?F6t(t,e):cc(t,HTMLIFrameElement)?z6t(t,e):t.cloneNode(aEe(t))}const H6t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",aEe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function G6t(t,e,r){var n,i;if(aEe(e))return e;let s=[];return H6t(t)&&t.assignedNodes?s=Qp(t.assignedNodes()):cc(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?s=Qp(t.contentDocument.body.childNodes):s=Qp(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),s.length===0||cc(t,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>cD(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function W6t(t,e,r){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):nEe(r).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),cc(t,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),n.setProperty(s,a,i.getPropertyPriority(s))})}function q6t(t,e){cc(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),cc(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function U6t(t,e){if(cc(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Y6t(t,e,r){return cc(e,Element)&&(W6t(t,e,r),I6t(t,e,r),q6t(t,e),U6t(t,e)),e}async function j6t(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let s=0;sV6t(n,e)).then(n=>G6t(t,n,e)).then(n=>Y6t(t,n,e)).then(n=>j6t(n,e))}const oEe=/url\((['"]?)([^'"]+?)\1\)/g,X6t=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,K6t=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Z6t(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Q6t(t){const e=[];return t.replace(oEe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!PG(r))}async function J6t(t,e,r,n,i){try{const s=r?w6t(e,r):e,a=_Z(e);let o;return i||(o=await LZ(s,a,n)),t.replace(Z6t(e),`$1${o}$3`)}catch{}return t}function eEt(t,{preferredFontFormat:e}){return e?t.replace(K6t,r=>{for(;;){const[n,,i]=X6t.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function lEe(t){return t.search(oEe)!==-1}async function cEe(t,e,r){if(!lEe(t))return t;const n=eEt(t,r);return Q6t(n).reduce((s,a)=>s.then(o=>J6t(o,a,e,r)),Promise.resolve(n))}async function Vv(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const s=await cEe(i,null,r);return e.style.setProperty(t,s,e.style.getPropertyPriority(t)),!0}return!1}async function tEt(t,e){await Vv("background",t,e)||await Vv("background-image",t,e),await Vv("mask",t,e)||await Vv("-webkit-mask",t,e)||await Vv("mask-image",t,e)||await Vv("-webkit-mask-image",t,e)}async function rEt(t,e){const r=cc(t,HTMLImageElement);if(!(r&&!PG(t.src))&&!(cc(t,SVGImageElement)&&!PG(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await LZ(n,_Z(n),e);await new Promise((s,a)=>{t.onload=s,t.onerror=e.onImageErrorHandler?(...l)=>{try{s(e.onImageErrorHandler(...l))}catch(u){a(u)}}:a;const o=t;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function nEt(t,e){const n=Qp(t.childNodes).map(i=>uEe(i,e));await Promise.all(n).then(()=>t)}async function uEe(t,e){cc(t,Element)&&(await tEt(t,e),await rEt(t,e),await nEt(t,e))}function iEt(t,e){const{style:r}=t;e.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.width&&(r.width=`${e.width}px`),e.height&&(r.height=`${e.height}px`);const n=e.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),t}const Vce={};async function Hce(t){let e=Vce[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},Vce[t]=e,e}async function Gce(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),sEe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>r)}function Wce(t){if(t==null)return[];const e=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=t.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(n);if(l===null)break;e.push(l[0])}n=n.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(n);if(l===null){if(l=o.exec(n),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;e.push(l[0])}return e}async function sEt(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{Qp(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,u=Hce(l).then(h=>Gce(h,e)).then(h=>Wce(h).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:d,error:f})}})).catch(h=>{console.error("Error loading remote css",h.toString())});n.push(u)}})}catch(s){const a=t.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Hce(i.href).then(o=>Gce(o,e)).then(o=>Wce(o).forEach(l=>{a.insertRule(l,a.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{Qp(i.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),r))}function aEt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>lEe(e.style.getPropertyValue("src")))}async function oEt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Qp(t.ownerDocument.styleSheets),n=await sEt(r,e);return aEt(n)}function hEe(t){return t.trim().replace(/["']/g,"")}function lEt(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{e.add(hEe(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(t),e}async function cEt(t,e){const r=await oEt(t,e),n=lEt(t);return(await Promise.all(r.filter(s=>n.has(hEe(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return cEe(s.cssText,a,e)}))).join(` -`)}async function uEt(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await cEt(t,e);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function hEt(t,e={}){const{width:r,height:n}=iEe(t,e),i=await cD(t,e,!0);return await uEt(i,e),await uEe(i,e),iEt(i,e),await M6t(i,r,n)}async function dEt(t,e={}){const{width:r,height:n}=iEe(t,e),i=await hEt(t,e),s=await p_(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=e.pixelRatio||S6t(),u=e.canvasWidth||r,h=e.canvasHeight||n;return a.width=u*l,a.height=h*l,e.skipAutoScale||E6t(a),a.style.width=`${u}`,a.style.height=`${h}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}function IZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Qy=IZ();function dEe(t){Qy=t}var o1={exec:()=>null};function Vn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(vl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var fEt=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
    /i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},pEt=/^(?:[ \t]*(?:\n|$))+/,gEt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mEt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,i7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yEt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,NZ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,fEe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pEe=Vn(fEe).replace(/bull/g,NZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),vEt=Vn(fEe).replace(/bull/g,NZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),DZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bEt=/^[^\n]+/,OZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xEt=Vn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",OZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wEt=Vn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,NZ).getRegex(),uD="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",PZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,TEt=Vn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",PZ).replace("tag",uD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gEe=Vn(DZ).replace("hr",i7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",uD).getRegex(),CEt=Vn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gEe).getRegex(),$Z={blockquote:CEt,code:gEt,def:xEt,fences:mEt,heading:yEt,hr:i7,html:TEt,lheading:pEe,list:wEt,newline:pEt,paragraph:gEe,table:o1,text:bEt},qce=Vn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",i7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",uD).getRegex(),kEt={...$Z,lheading:vEt,table:qce,paragraph:Vn(DZ).replace("hr",i7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qce).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",uD).getRegex()},SEt={...$Z,html:Vn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",PZ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vn(DZ).replace("hr",i7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",pEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},EEt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,AEt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mEe=/^( {2,}|\\)\n(?!\s*$)/,MEt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",fEt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),vEe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,NEt=Vn(vEe,"u").replace(/punct/g,c3).getRegex(),DEt=Vn(vEe,"u").replace(/punct/g,yEe).getRegex(),bEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",OEt=Vn(bEe,"gu").replace(/notPunctSpace/g,BZ).replace(/punctSpace/g,hD).replace(/punct/g,c3).getRegex(),PEt=Vn(bEe,"gu").replace(/notPunctSpace/g,LEt).replace(/punctSpace/g,_Et).replace(/punct/g,yEe).getRegex(),$Et=Vn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,BZ).replace(/punctSpace/g,hD).replace(/punct/g,c3).getRegex(),BEt=Vn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,c3).getRegex(),FEt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zEt=Vn(FEt,"gu").replace(/notPunctSpace/g,BZ).replace(/punctSpace/g,hD).replace(/punct/g,c3).getRegex(),VEt=Vn(/\\(punct)/,"gu").replace(/punct/g,c3).getRegex(),HEt=Vn(/^<(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(),GEt=Vn(PZ).replace("(?:-->|$)","-->").getRegex(),WEt=Vn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",GEt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),g_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,qEt=Vn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",g_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xEe=Vn(/^!?\[(label)\]\[(ref)\]/).replace("label",g_).replace("ref",OZ).getRegex(),wEe=Vn(/^!?\[(ref)\](?:\[\])?/).replace("ref",OZ).getRegex(),UEt=Vn("reflink|nolink(?!\\()","g").replace("reflink",xEe).replace("nolink",wEe).getRegex(),Uce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,FZ={_backpedal:o1,anyPunctuation:VEt,autolink:HEt,blockSkip:IEt,br:mEe,code:AEt,del:o1,delLDelim:o1,delRDelim:o1,emStrongLDelim:NEt,emStrongRDelimAst:OEt,emStrongRDelimUnd:$Et,escape:EEt,link:qEt,nolink:wEe,punctuation:REt,reflink:xEe,reflinkSearch:UEt,tag:WEt,text:MEt,url:o1},YEt={...FZ,link:Vn(/^!?\[(label)\]\((.*?)\)/).replace("label",g_).getRegex(),reflink:Vn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",g_).getRegex()},$G={...FZ,emStrongRDelimAst:PEt,emStrongLDelim:DEt,delLDelim:BEt,delRDelim:zEt,url:Vn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Uce).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:Vn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Yce=t=>XEt[t];function Wh(t,e){if(e){if(vl.escapeTest.test(t))return t.replace(vl.escapeReplace,Yce)}else if(vl.escapeTestNoEncode.test(t))return t.replace(vl.escapeReplaceNoEncode,Yce);return t}function jce(t){try{t=encodeURI(t).replace(vl.percentDecode,"%")}catch{return null}return t}function Xce(t,e){var s;let r=t.replace(vl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(vl.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function ZEt(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let s=4-r%4;n+=" ".repeat(s),r+=s}else n+=i,r++;return n}function Kce(t,e,r,n,i){let s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function QEt(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */function A6t(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const M6t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function rg(t){const e=[];for(let r=0,n=t.length;rEc||t.height>Ec)&&(t.width>Ec&&t.height>Ec?t.width>t.height?(t.height*=Ec/t.width,t.width=Ec):(t.width*=Ec/t.height,t.height=Ec):t.width>Ec?(t.height*=Ec/t.width,t.width=Ec):(t.width*=Ec/t.height,t.height=Ec))}function v_(t){return new Promise((e,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>e(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function N6t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function D6t(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(t),N6t(i)}const dc=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||dc(r,e)};function O6t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function P6t(t,e){return cEe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function $6t(t,e,r,n){const i=`.${t}:${e}`,s=r.cssText?O6t(r):P6t(r,n);return document.createTextNode(`${i}{${s}}`)}function Hce(t,e,r,n){const i=window.getComputedStyle(t,r),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=M6t();try{e.className=`${e.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild($6t(a,r,i,n)),e.appendChild(o)}function B6t(t,e,r){Hce(t,e,":before",r),Hce(t,e,":after",r)}const Gce="application/font-woff",Wce="image/jpeg",F6t={woff:Gce,woff2:Gce,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Wce,jpeg:Wce,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function z6t(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function DZ(t){const e=z6t(t).toLowerCase();return F6t[e]||""}function V6t(t){return t.split(/,/)[1]}function zG(t){return t.search(/^(data:)/)!==-1}function H6t(t,e){return`data:${e};base64,${t}`}async function hEe(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(r({res:n,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const lB={};function G6t(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function OZ(t,e,r){const n=G6t(t,e,r.includeQueryParams);if(lB[n]!=null)return lB[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const s=await hEe(t,r.fetchRequestInit,({res:a,result:o})=>(e||(e=a.headers.get("Content-Type")||""),V6t(o)));i=H6t(s,e)}catch(s){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return lB[n]=i,i}async function W6t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):v_(e)}async function q6t(t,e){if(t.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=t.clientWidth,s.height=t.clientHeight,a==null||a.drawImage(t,0,0,s.width,s.height);const o=s.toDataURL();return v_(o)}const r=t.poster,n=DZ(r),i=await OZ(r,n,e);return v_(i)}async function U6t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await dD(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function Y6t(t,e){return dc(t,HTMLCanvasElement)?W6t(t):dc(t,HTMLVideoElement)?q6t(t,e):dc(t,HTMLIFrameElement)?U6t(t,e):t.cloneNode(dEe(t))}const j6t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",dEe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function X6t(t,e,r){var n,i;if(dEe(e))return e;let s=[];return j6t(t)&&t.assignedNodes?s=rg(t.assignedNodes()):dc(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?s=rg(t.contentDocument.body.childNodes):s=rg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),s.length===0||dc(t,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>dD(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function K6t(t,e,r){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):cEe(r).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),dc(t,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),n.setProperty(s,a,i.getPropertyPriority(s))})}function Z6t(t,e){dc(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),dc(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function Q6t(t,e){if(dc(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function J6t(t,e,r){return dc(e,Element)&&(K6t(t,e,r),B6t(t,e,r),Z6t(t,e),Q6t(t,e)),e}async function eEt(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let s=0;sY6t(n,e)).then(n=>X6t(t,n,e)).then(n=>J6t(t,n,e)).then(n=>eEt(n,e))}const fEe=/url\((['"]?)([^'"]+?)\1\)/g,tEt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,rEt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function nEt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function iEt(t){const e=[];return t.replace(fEe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!zG(r))}async function sEt(t,e,r,n,i){try{const s=r?A6t(e,r):e,a=DZ(e);let o;return i||(o=await OZ(s,a,n)),t.replace(nEt(e),`$1${o}$3`)}catch{}return t}function aEt(t,{preferredFontFormat:e}){return e?t.replace(rEt,r=>{for(;;){const[n,,i]=tEt.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function pEe(t){return t.search(fEe)!==-1}async function gEe(t,e,r){if(!pEe(t))return t;const n=aEt(t,r);return iEt(n).reduce((s,a)=>s.then(o=>sEt(o,a,e,r)),Promise.resolve(n))}async function Gv(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const s=await gEe(i,null,r);return e.style.setProperty(t,s,e.style.getPropertyPriority(t)),!0}return!1}async function oEt(t,e){await Gv("background",t,e)||await Gv("background-image",t,e),await Gv("mask",t,e)||await Gv("-webkit-mask",t,e)||await Gv("mask-image",t,e)||await Gv("-webkit-mask-image",t,e)}async function lEt(t,e){const r=dc(t,HTMLImageElement);if(!(r&&!zG(t.src))&&!(dc(t,SVGImageElement)&&!zG(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await OZ(n,DZ(n),e);await new Promise((s,a)=>{t.onload=s,t.onerror=e.onImageErrorHandler?(...l)=>{try{s(e.onImageErrorHandler(...l))}catch(u){a(u)}}:a;const o=t;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function cEt(t,e){const n=rg(t.childNodes).map(i=>mEe(i,e));await Promise.all(n).then(()=>t)}async function mEe(t,e){dc(t,Element)&&(await oEt(t,e),await lEt(t,e),await cEt(t,e))}function uEt(t,e){const{style:r}=t;e.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.width&&(r.width=`${e.width}px`),e.height&&(r.height=`${e.height}px`);const n=e.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),t}const qce={};async function Uce(t){let e=qce[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},qce[t]=e,e}async function Yce(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),hEe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>r)}function jce(t){if(t==null)return[];const e=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=t.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(n);if(l===null)break;e.push(l[0])}n=n.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(n);if(l===null){if(l=o.exec(n),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;e.push(l[0])}return e}async function hEt(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{rg(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,u=Uce(l).then(h=>Yce(h,e)).then(h=>jce(h).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:d,error:f})}})).catch(h=>{console.error("Error loading remote css",h.toString())});n.push(u)}})}catch(s){const a=t.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Uce(i.href).then(o=>Yce(o,e)).then(o=>jce(o).forEach(l=>{a.insertRule(l,a.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{rg(i.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),r))}function dEt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>pEe(e.style.getPropertyValue("src")))}async function fEt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=rg(t.ownerDocument.styleSheets),n=await hEt(r,e);return dEt(n)}function yEe(t){return t.trim().replace(/["']/g,"")}function pEt(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{e.add(yEe(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(t),e}async function gEt(t,e){const r=await fEt(t,e),n=pEt(t);return(await Promise.all(r.filter(s=>n.has(yEe(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return gEe(s.cssText,a,e)}))).join(` +`)}async function mEt(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await gEt(t,e);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function yEt(t,e={}){const{width:r,height:n}=uEe(t,e),i=await dD(t,e,!0);return await mEt(i,e),await mEe(i,e),uEt(i,e),await D6t(i,r,n)}async function vEt(t,e={}){const{width:r,height:n}=uEe(t,e),i=await yEt(t,e),s=await v_(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=e.pixelRatio||L6t(),u=e.canvasWidth||r,h=e.canvasHeight||n;return a.width=u*l,a.height=h*l,e.skipAutoScale||I6t(a),a.style.width=`${u}`,a.style.height=`${h}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}function PZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ev=PZ();function vEe(t){ev=t}var u1={exec:()=>null};function Vn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(xl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var bEt=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},xEt=/^(?:[ \t]*(?:\n|$))+/,wEt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,TEt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,o7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,CEt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$Z=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,bEe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xEe=Vn(bEe).replace(/bull/g,$Z).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),kEt=Vn(bEe).replace(/bull/g,$Z).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),BZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,SEt=/^[^\n]+/,FZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,EEt=Vn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",FZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),AEt=Vn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$Z).getRegex(),fD="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,MEt=Vn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zZ).replace("tag",fD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wEe=Vn(BZ).replace("hr",o7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",fD).getRegex(),REt=Vn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wEe).getRegex(),VZ={blockquote:REt,code:wEt,def:EEt,fences:TEt,heading:CEt,hr:o7,html:MEt,lheading:xEe,list:AEt,newline:xEt,paragraph:wEe,table:u1,text:SEt},Xce=Vn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",fD).getRegex(),_Et={...VZ,lheading:kEt,table:Xce,paragraph:Vn(BZ).replace("hr",o7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xce).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",fD).getRegex()},LEt={...VZ,html:Vn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zZ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:u1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vn(BZ).replace("hr",o7).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",xEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IEt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,NEt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,TEe=/^( {2,}|\\)\n(?!\s*$)/,DEt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bEt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kEe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,FEt=Vn(kEe,"u").replace(/punct/g,d3).getRegex(),zEt=Vn(kEe,"u").replace(/punct/g,CEe).getRegex(),SEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",VEt=Vn(SEe,"gu").replace(/notPunctSpace/g,HZ).replace(/punctSpace/g,pD).replace(/punct/g,d3).getRegex(),HEt=Vn(SEe,"gu").replace(/notPunctSpace/g,$Et).replace(/punctSpace/g,PEt).replace(/punct/g,CEe).getRegex(),GEt=Vn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,HZ).replace(/punctSpace/g,pD).replace(/punct/g,d3).getRegex(),WEt=Vn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,d3).getRegex(),qEt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",UEt=Vn(qEt,"gu").replace(/notPunctSpace/g,HZ).replace(/punctSpace/g,pD).replace(/punct/g,d3).getRegex(),YEt=Vn(/\\(punct)/,"gu").replace(/punct/g,d3).getRegex(),jEt=Vn(/^<(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(),XEt=Vn(zZ).replace("(?:-->|$)","-->").getRegex(),KEt=Vn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",XEt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),b_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ZEt=Vn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",b_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),EEe=Vn(/^!?\[(label)\]\[(ref)\]/).replace("label",b_).replace("ref",FZ).getRegex(),AEe=Vn(/^!?\[(ref)\](?:\[\])?/).replace("ref",FZ).getRegex(),QEt=Vn("reflink|nolink(?!\\()","g").replace("reflink",EEe).replace("nolink",AEe).getRegex(),Kce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,GZ={_backpedal:u1,anyPunctuation:YEt,autolink:jEt,blockSkip:BEt,br:TEe,code:NEt,del:u1,delLDelim:u1,delRDelim:u1,emStrongLDelim:FEt,emStrongRDelimAst:VEt,emStrongRDelimUnd:GEt,escape:IEt,link:ZEt,nolink:AEe,punctuation:OEt,reflink:EEe,reflinkSearch:QEt,tag:KEt,text:DEt,url:u1},JEt={...GZ,link:Vn(/^!?\[(label)\]\((.*?)\)/).replace("label",b_).getRegex(),reflink:Vn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",b_).getRegex()},VG={...GZ,emStrongRDelimAst:HEt,emStrongLDelim:zEt,delLDelim:WEt,delRDelim:UEt,url:Vn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Kce).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:Vn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Zce=t=>t7t[t];function Yh(t,e){if(e){if(xl.escapeTest.test(t))return t.replace(xl.escapeReplace,Zce)}else if(xl.escapeTestNoEncode.test(t))return t.replace(xl.escapeReplaceNoEncode,Zce);return t}function Qce(t){try{t=encodeURI(t).replace(xl.percentDecode,"%")}catch{return null}return t}function Jce(t,e){var s;let r=t.replace(xl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(xl.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function n7t(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let s=4-r%4;n+=" ".repeat(s),r+=s}else n+=i,r++;return n}function eue(t,e,r,n,i){let s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function i7t(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(` -`)}var m_=class{constructor(e){br(this,"options");br(this,"rules");br(this,"lexer");this.options=e||Qy}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:nC(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=QEt(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=nC(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:nC(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=nC(r[0],` +`)}var x_=class{constructor(e){xr(this,"options");xr(this,"rules");xr(this,"lexer");this.options=e||ev}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:aC(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=i7t(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=aC(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:aC(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=aC(r[0],` `).split(` `),i="",s="",a=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u1,o={type:"list",raw:"",ordered:a,start:a?+s.slice(0,-1):"",loose:!1,items:[]};s=a?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=a?s:"[*+-]");let l=this.rules.other.listItemRegex(s),u=!1;for(;e;){let d=!1,f="",p="";if(!(r=l.exec(e))||this.rules.block.hr.test(e))break;f=r[0],e=e.substring(f.length);let g=ZEt(r[2].split(` +`);continue}}return{type:"blockquote",raw:i,tokens:a,text:s}}}list(e){var n,i;let r=this.rules.block.list.exec(e);if(r){let s=r[1].trim(),a=s.length>1,o={type:"list",raw:"",ordered:a,start:a?+s.slice(0,-1):"",loose:!1,items:[]};s=a?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=a?s:"[*+-]");let l=this.rules.other.listItemRegex(s),u=!1;for(;e;){let d=!1,f="",p="";if(!(r=l.exec(e))||this.rules.block.hr.test(e))break;f=r[0],e=e.substring(f.length);let g=n7t(r[2].split(` `,1)[0],r[1].length),m=e.split(` `,1)[0],y=!g.trim(),v=0;if(this.options.pedantic?(v=2,p=g.trimStart()):y?v=r[1].length+1:(v=g.search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=g.slice(v),v+=r[1].length),y&&this.rules.other.blankLine.test(m)&&(f+=m+` `,e=e.substring(m.length+1),d=!0),!d){let x=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),T=this.rules.other.fencesBeginRegex(v),C=this.rules.other.headingBeginRegex(v),S=this.rules.other.htmlBeginRegex(v),k=this.rules.other.blockquoteBeginRegex(v);for(;e;){let E=e.split(` `,1)[0],A;if(m=E,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),A=m):A=m.replace(this.rules.other.tabCharGlobal," "),T.test(m)||C.test(m)||S.test(m)||k.test(m)||x.test(m)||b.test(m))break;if(A.search(this.rules.other.nonSpaceChar)>=v||!m.trim())p+=` `+A.slice(v);else{if(y||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(g)||C.test(g)||b.test(g))break;p+=` `+m}y=!m.trim(),f+=E+` -`,e=e.substring(E.length+1),g=A.slice(v)}}o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(u=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=f}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((n=d.tokens[0])==null?void 0:n.type)==="text"||((i=d.tokens[0])==null?void 0:i.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!o.loose){let f=d.tokens.filter(g=>g.type==="space"),p=f.length>0&&f.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=p}}if(o.loose)for(let d of o.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:s}}}table(e){var o;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=Xce(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[h]})));return a}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r){let n=r[1].trim();return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=nC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=KEt(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Kce(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Kce(n,s,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,s+i.index+d+o);if(Math.min(s,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e,r,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,u=this.rules.inline.delRDelim;for(u.lastIndex=0,r=r.slice(-1*e.length+s);(i=u.exec(r))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==s))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...i[0]][0].length,d=e.slice(0,s+i.index+h+o),f=d.slice(s,-s);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let a;do a=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(a!==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(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},eh=class BG{constructor(e){br(this,"tokens");br(this,"options");br(this,"state");br(this,"inlineQueue");br(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Qy,this.options.tokenizer=this.options.tokenizer||new m_,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:vl,block:$A.normal,inline:rC.normal};this.options.pedantic?(r.block=$A.pedantic,r.inline=rC.pedantic):this.options.gfm&&(r.block=$A.gfm,this.options.breaks?r.inline=rC.breaks:r.inline=rC.gfm),this.tokenizer.rules=r}static get rules(){return{block:$A,inline:rC}}static lex(e,r){return new BG(r).lex(e)}static lexInline(e,r){return new BG(r).inlineTokens(e)}lex(e){e=e.replace(vl.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` +`,e=e.substring(E.length+1),g=A.slice(v)}}o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(u=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=f}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((n=d.tokens[0])==null?void 0:n.type)==="text"||((i=d.tokens[0])==null?void 0:i.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!o.loose){let f=d.tokens.filter(g=>g.type==="space"),p=f.length>0&&f.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=p}}if(o.loose)for(let d of o.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:s}}}table(e){var o;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=Jce(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[h]})));return a}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r){let n=r[1].trim();return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=aC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=r7t(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),eue(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return eue(n,s,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,s+i.index+d+o);if(Math.min(s,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e,r,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,a,o,l=s,u=this.rules.inline.delRDelim;for(u.lastIndex=0,r=r.slice(-1*e.length+s);(i=u.exec(r))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==s))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...i[0]][0].length,d=e.slice(0,s+i.index+h+o),f=d.slice(s,-s);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let a;do a=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(a!==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(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},nh=class HG{constructor(e){xr(this,"tokens");xr(this,"options");xr(this,"state");xr(this,"inlineQueue");xr(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ev,this.options.tokenizer=this.options.tokenizer||new x_,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:xl,block:zA.normal,inline:sC.normal};this.options.pedantic?(r.block=zA.pedantic,r.inline=sC.pedantic):this.options.gfm&&(r.block=zA.gfm,this.options.breaks?r.inline=sC.breaks:r.inline=sC.gfm),this.tokenizer.rules=r}static get rules(){return{block:zA,inline:sC}}static lex(e,r){return new HG(r).lex(e)}static lexInline(e,r){return new HG(r).inlineTokens(e)}lex(e){e=e.replace(xl.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` @@ -1285,9 +1285,9 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let a=!1,o="";for(;e;){a||(o=""),a=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),a=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},y_=class{constructor(e){br(this,"options");br(this,"parser");this.options=e||Qy}space(e){return""}code({text:e,lang:r,escaped:n}){var a;let i=(a=(r||"").match(vl.notSpaceStart))==null?void 0:a[0],s=e.replace(vl.endingNewline,"")+` -`;return i?'

    '+(n?s:Wh(s,!0))+`
    -`:"
    "+(n?s:Wh(s,!0))+`
    +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let a=!1,o="";for(;e;){a||(o=""),a=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),a=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},w_=class{constructor(e){xr(this,"options");xr(this,"parser");this.options=e||ev}space(e){return""}code({text:e,lang:r,escaped:n}){var a;let i=(a=(r||"").match(xl.notSpaceStart))==null?void 0:a[0],s=e.replace(xl.endingNewline,"")+` +`;return i?'
    '+(n?s:Yh(s,!0))+`
    +`:"
    "+(n?s:Yh(s,!0))+`
    `}blockquote({tokens:e}){return`
    ${this.parser.parse(e)}
    `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} @@ -1303,60 +1303,67 @@ ${this.parser.parse(e)} `}tablerow({text:e}){return`
    ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Wh(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),s=jce(e);if(s===null)return i;e=s;let a='
    ",a}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=jce(e);if(s===null)return Wh(n);e=s;let a=`${Wh(n)}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new y_(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new m_(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new XC;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];XC.passThroughHooks.has(a)?s[o]=h=>{if(this.defaults.async&&XC.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return u.call(s,f)})();let d=l.call(s,h);return u.call(s,d)}:s[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await u.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return eh.lex(e,r??this.defaults)}parser(e,r){return th.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer(e):e?eh.lex:eh.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(e):e?th.parse:th.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer(e):e?eh.lex:eh.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(e):e?th.parse:th.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+Wh(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Sy=new JEt;function vi(t,e){return Sy.parse(t,e)}vi.options=vi.setOptions=function(t){return Sy.setOptions(t),vi.defaults=Sy.defaults,dEe(vi.defaults),vi};vi.getDefaults=IZ;vi.defaults=Qy;vi.use=function(...t){return Sy.use(...t),vi.defaults=Sy.defaults,dEe(vi.defaults),vi};vi.walkTokens=function(t,e){return Sy.walkTokens(t,e)};vi.parseInline=Sy.parseInline;vi.Parser=th;vi.parser=th.parse;vi.Renderer=y_;vi.TextRenderer=zZ;vi.Lexer=eh;vi.lexer=eh.lex;vi.Tokenizer=m_;vi.Hooks=XC;vi.parse=vi;vi.options;vi.setOptions;vi.use;vi.walkTokens;vi.parseInline;th.parse;eh.lex;const e7t=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function t7t(t){return t.flatMap((e,r)=>{var n;if(e.type==="space"||((n=t[r+1])===null||n===void 0?void 0:n.type)==="space")return[e];const i=(e.raw||"").match(e7t);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function r7t(t,e){const r=e.split(` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Yh(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),s=Qce(e);if(s===null)return i;e=s;let a='
    ",a}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=Qce(e);if(s===null)return Yh(n);e=s;let a=`${Yh(n)}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new w_(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new x_(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new QC;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];QC.passThroughHooks.has(a)?s[o]=h=>{if(this.defaults.async&&QC.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return u.call(s,f)})();let d=l.call(s,h);return u.call(s,d)}:s[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await u.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return nh.lex(e,r??this.defaults)}parser(e,r){return ih.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer(e):e?nh.lex:nh.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(e):e?ih.parse:ih.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer(e):e?nh.lex:nh.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(e):e?ih.parse:ih.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+Yh(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Ay=new s7t;function vi(t,e){return Ay.parse(t,e)}vi.options=vi.setOptions=function(t){return Ay.setOptions(t),vi.defaults=Ay.defaults,vEe(vi.defaults),vi};vi.getDefaults=PZ;vi.defaults=ev;vi.use=function(...t){return Ay.use(...t),vi.defaults=Ay.defaults,vEe(vi.defaults),vi};vi.walkTokens=function(t,e){return Ay.walkTokens(t,e)};vi.parseInline=Ay.parseInline;vi.Parser=ih;vi.parser=ih.parse;vi.Renderer=w_;vi.TextRenderer=WZ;vi.Lexer=nh;vi.lexer=nh.lex;vi.Tokenizer=x_;vi.Hooks=QC;vi.parse=vi;vi.options;vi.setOptions;vi.use;vi.walkTokens;vi.parseInline;ih.parse;nh.lex;const a7t=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function o7t(t){return t.flatMap((e,r)=>{var n;if(e.type==="space"||((n=t[r+1])===null||n===void 0?void 0:n.type)==="space")return[e];const i=(e.raw||"").match(a7t);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function l7t(t,e){const r=e.split(` `).flatMap(n=>[n,""]).map(n=>`${t}${n}`).join(` -`);return r.slice(0,r.length-1)}function Zce(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(s=>s.type===n&&KT(s.attrs,i.attrs))||r.push(n)}),r}function n7t(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const s=t.get(n);(!s||!KT(s.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function i7t(t,e,r,n){const i=!r,s=r&&(!r.marks||r.marks.length===0),a=r&&r.marks&&!n(e,new Map(r.marks.map(l=>[l.type,l]))),o=[];return(i||s||a)&&(r&&r.marks?Array.from(t.entries()).reverse().forEach(([l,u])=>{r.marks.find(h=>h.type===l&&KT(h.attrs,u.attrs))||o.push(l)}):(i||s)&&o.push(...Array.from(t.keys()).reverse())),o}function s7t(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=e(n,t.get(n));i&&(r=i+r)}),t.clear(),r}function a7t(t,e,r){let n="";return Array.from(t.entries()).forEach(([i,s])=>{const a=r(i,s);a&&(n+=a),e.set(i,s)}),n}function aB(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function BA(t,e){return typeof t!="string"?"json":e}const o7t=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),l7t=/<\/?([a-zA-Z][\w-]*)/g;function c7t(t){const e=[];let r;for(;(r=l7t.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function u7t(t){const e=t.toLowerCase();return e.includes("-")?!1:!o7t.has(e)}function h7t(t,e){return c7t(t).some(r=>u7t(r)?!e.has(r):!1)}var zG=class{constructor(t){var e,r,n,i,s;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t==null?void 0:t.marked)!==null&&e!==void 0?e:vi,this.indentStyle=(r=t==null||(n=t.indentation)===null||n===void 0?void 0:n.style)!==null&&r!==void 0?r:"space",this.indentSize=(i=t==null||(s=t.indentation)===null||s===void 0?void 0:s.size)!==null&&i!==void 0?i:2,this.baseExtensions=(t==null?void 0:t.extensions)||[],t!=null&&t.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t!=null&&t.extensions&&(this.baseExtensions=t.extensions,Cb(IN(t.extensions)).forEach(a=>this.registerExtension(a)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,r;this.extensions.push(t);const n=Qn(gr(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const s=gr(t,"markdownTokenName")||i,a=gr(t,"parseMarkdown"),o=gr(t,"renderMarkdown"),l=gr(t,"markdownTokenizer"),u=(e=gr(t,"markdownOptions"))!==null&&e!==void 0?e:null,h={tokenName:s,nodeName:i,parseMarkdown:a,renderMarkdown:o,isIndenting:(r=u==null?void 0:u.indentsContent)!==null&&r!==void 0?r:!1,htmlReopen:u==null?void 0:u.htmlReopen,tokenizer:l};if(s&&a){const d=this.registry.get(s)||[];d.push(h),this.registry.set(s,d)}if(o){const d=this.nodeTypeRegistry.get(i)||[];d.push(h),this.nodeTypeRegistry.set(i,d)}l&&this.hasMarked()&&this.registerTokenizer(l)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!==null&&e!==void 0?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:r,level:n="inline",tokenize:i}=t,s=this.createTokenizerHelpers.bind(this),a=this.createLexer.bind(this);let o;r?o=typeof r=="function"?r:u=>u.indexOf(r):o=u=>{const h=i(u,[],this.createTokenizerHelpers(this.createLexer()));return h&&h.raw?u.indexOf(h.raw):-1};const l={name:e,level:n,start:o,tokenizer(u,h){const d=this.lexer?s(this.lexer):s(a()),f=i(u,h,d);if(f&&f.type)return{...f,type:f.type||e,raw:f.raw||"",tokens:f.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const r=this.getHandlersForNodeType(t);return r.length>0?r[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,r=this.createLexer();this.activeParseLexer=r;try{const n=r.lex(t);return{type:"doc",content:this.parseTokens(n,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const r=e?t7t(t):t,n=r.reduce((a,o,l)=>(o.type!=="space"&&a.push(l),a),[]);let i=-1,s=0;return r.flatMap((a,o)=>{for(;s({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,` -`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const r=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(r.find(i=>{if(!i.parseMarkdown)return!1;const s=i.parseMarkdown(t,n),a=this.normalizeParseResult(s);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(o=>aB(o).isTask),r=t.items.some(o=>!aB(o).isTask);if(!e||!r||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const n=[];let i=[],s=null;for(let o=0;o{if(!e){r.push(n);return}(e.marks||[]).find(s=>s.type===n&&QT(s.attrs,i.attrs))||r.push(n)}),r}function c7t(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const s=t.get(n);(!s||!QT(s.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function u7t(t,e,r,n){const i=!r,s=r&&(!r.marks||r.marks.length===0),a=r&&r.marks&&!n(e,new Map(r.marks.map(l=>[l.type,l]))),o=[];return(i||s||a)&&(r&&r.marks?Array.from(t.entries()).reverse().forEach(([l,u])=>{r.marks.find(h=>h.type===l&&QT(h.attrs,u.attrs))||o.push(l)}):(i||s)&&o.push(...Array.from(t.keys()).reverse())),o}function h7t(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=e(n,t.get(n));i&&(r=i+r)}),t.clear(),r}function d7t(t,e,r){let n="";return Array.from(t.entries()).forEach(([i,s])=>{const a=r(i,s);a&&(n+=a),e.set(i,s)}),n}function cB(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function VA(t,e){return typeof t!="string"?"json":e}const f7t=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),p7t=/<\/?([a-zA-Z][\w-]*)/g;function g7t(t){const e=[];let r;for(;(r=p7t.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function m7t(t){const e=t.toLowerCase();return e.includes("-")?!1:!f7t.has(e)}function y7t(t,e){return g7t(t).some(r=>m7t(r)?!e.has(r):!1)}var WG=class{constructor(t){var e,r,n,i,s;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t==null?void 0:t.marked)!==null&&e!==void 0?e:vi,this.indentStyle=(r=t==null||(n=t.indentation)===null||n===void 0?void 0:n.style)!==null&&r!==void 0?r:"space",this.indentSize=(i=t==null||(s=t.indentation)===null||s===void 0?void 0:s.size)!==null&&i!==void 0?i:2,this.baseExtensions=(t==null?void 0:t.extensions)||[],t!=null&&t.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t!=null&&t.extensions&&(this.baseExtensions=t.extensions,Sb(ON(t.extensions)).forEach(a=>this.registerExtension(a)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,r;this.extensions.push(t);const n=Qn(gr(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const s=gr(t,"markdownTokenName")||i,a=gr(t,"parseMarkdown"),o=gr(t,"renderMarkdown"),l=gr(t,"markdownTokenizer"),u=(e=gr(t,"markdownOptions"))!==null&&e!==void 0?e:null,h={tokenName:s,nodeName:i,parseMarkdown:a,renderMarkdown:o,isIndenting:(r=u==null?void 0:u.indentsContent)!==null&&r!==void 0?r:!1,htmlReopen:u==null?void 0:u.htmlReopen,tokenizer:l};if(s&&a){const d=this.registry.get(s)||[];d.push(h),this.registry.set(s,d)}if(o){const d=this.nodeTypeRegistry.get(i)||[];d.push(h),this.nodeTypeRegistry.set(i,d)}l&&this.hasMarked()&&this.registerTokenizer(l)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!==null&&e!==void 0?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:r,level:n="inline",tokenize:i}=t,s=this.createTokenizerHelpers.bind(this),a=this.createLexer.bind(this);let o;r?o=typeof r=="function"?r:u=>u.indexOf(r):o=u=>{const h=i(u,[],this.createTokenizerHelpers(this.createLexer()));return h&&h.raw?u.indexOf(h.raw):-1};const l={name:e,level:n,start:o,tokenizer(u,h){const d=this.lexer?s(this.lexer):s(a()),f=i(u,h,d);if(f&&f.type)return{...f,type:f.type||e,raw:f.raw||"",tokens:f.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const r=this.getHandlersForNodeType(t);return r.length>0?r[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,r=this.createLexer();this.activeParseLexer=r;try{const n=r.lex(t);return{type:"doc",content:this.parseTokens(n,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const r=e?o7t(t):t,n=r.reduce((a,o,l)=>(o.type!=="space"&&a.push(l),a),[]);let i=-1,s=0;return r.flatMap((a,o)=>{for(;s({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,` +`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const r=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(r.find(i=>{if(!i.parseMarkdown)return!1;const s=i.parseMarkdown(t,n),a=this.normalizeParseResult(s);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(o=>cB(o).isTask),r=t.items.some(o=>!cB(o).isTask);if(!e||!r||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const n=[];let i=[],s=null;for(let o=0;o1&&g.slice(1).join(` `).trim()){const x=g.slice(1),b=x.filter(T=>T.trim());if(b.length>0){const T=Math.min(...b.map(S=>S.length-S.trimStart().length)),C=x.map(S=>S.trim()?S.slice(T):"").join(` `).trim();C&&(v=this.markedInstance.lexer(`${C} -`))}}f={type:"taskItem",raw:"",mainContent:y,indentLevel:d,checked:h??!1,text:y,tokens:this.tokenizeInline(y),nestedTokens:v}}const p=u?"taskList":"list";s!==p?(i.length>0&&n.push({type:s,items:i}),i=[f],s=p):i.push(f)}i.length>0&&n.push({type:s,items:i});const a=[];for(let o=0;o0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(e.find(n=>{if(!n.parseMarkdown)return!1;const i=n.parseMarkdown(t,r),s=this.normalizeParseResult(i);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!0):!1})&&this.lastParseResult){const n=this.lastParseResult;return this.lastParseResult=null,n}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,r)=>{const n={type:t,attrs:e||void 0,content:r||void 0};return(!e||Object.keys(e).length===0)&&delete n.attrs,n},applyMark:(t,e,r)=>({mark:t,content:e,attrs:r&&Object.keys(r).length>0?r:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let a=0;a|\/|$)/i);if(!u&&h&&!/\/>$/.test(l)){const f=h[1],p=this.escapeRegex(f),g=new RegExp(`^<\\/\\s*${p}\\b`,"i");let m=-1;const y=[l];for(let v=a+1;v0;a-=1){const o=e[a],l=e[a-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];q0t(u,h)&&(l.text=(l.text||"")+(o.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,r){return e.map(n=>{if(n.type==="text"){const i=n.marks||[],s=r?{type:t,attrs:r}:{type:t};return{...n,marks:[...i,s]}}return{...n,content:n.content?this.applyMarkToContent(t,n.content,r):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Toe(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const r=Dft(e,this.baseExtensions);if(r.type==="doc"&&r.content){if(t.block)return r.content;const n=this.toInlineContent(r.content);return n.length>0?n:null}return r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(r=>r.type&&e.has(r.type)?[r]:r.content?this.toInlineContent(r.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=SH(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return h7t(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=SH(this.baseExtensions),r=n=>{const i=n==null?void 0:n.parseDOM;Array.isArray(i)&&i.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const a=s.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(n=>r(n.spec)),Object.values(e.marks).forEach(n=>r(n.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const r=t.replace(/\s+$/,"");return r?e?{type:"paragraph",content:[{type:"text",text:r}]}:{type:"text",text:r}:null}encodeTextForMarkdown(t,e,r){return(r==null?void 0:r.type)!=null&&this.codeTypes.has(r.type)||(e.marks||[]).some(n=>this.codeTypes.has(typeof n=="string"?n:n.type))?t:this.escapeMarkdownSyntax(L0t(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,r=0,n=0,i={}){var s;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const o=Array.isArray(e==null?void 0:e.content)&&r>0?e.content[r-1]:void 0,l={renderChildren:(h,d)=>{const f=a.isIndenting?n+1:n;return!Array.isArray(h)&&h.content?this.renderNodes(h.content,t,d||"",r,f):this.renderNodes(h,t,d||"",r,f)},renderChild:(h,d)=>{const f=a.isIndenting?n+1:n;return this.renderNodeToMarkdown(h,t,d,f)},indent:h=>this.indentString+h,wrapInBlock:r7t},u={index:r,level:n,parentType:e==null?void 0:e.type,previousNode:o,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((s=a.renderMarkdown)===null||s===void 0?void 0:s.call(a,t,l,u))||""}renderNodes(t,e,r="",n=0,i=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,r,i):t.type?this.renderNodeToMarkdown(t,e,n,i):""}renderNodesWithMarkBoundaries(t,e,r="",n=0){const i=[],s=new Map,a=new Set,o=new Map;return t.forEach((l,u)=>{const h=u[C.type,C])),p=this.getMarksToOpenForSerialization(s,f,h),g=Zce(f,h);if(d.length>0&&d.trim().length===0&&f.size>0){const C=new Set(g.filter(S=>!s.has(S)));C.size>0&&(f=new Map(Array.from(f).filter(([S])=>!C.has(S))),p=this.getMarksToOpenForSerialization(s,f,h),g=Zce(f,h))}const m=g.filter(C=>s.has(C)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const C=d.match(/(\s+)$/);C&&(v=C[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(C=>{if(!s.has(C))return;const S=f.get(C),k=this.getMarkClosing(C,S,o.get(C));k&&(d+=k),s.has(C)&&(s.delete(C),o.delete(C))});let x="";if(p.length>0){const C=d.match(/^(\s+)/);C&&(x=C[1],d=d.slice(x.length))}p.forEach(({type:C,mark:S})=>{const k=a.has(C)?"html":"markdown",E=this.getMarkOpening(C,S,k);E&&(d=E+d),o.set(C,k),a.delete(C)}),y||p.slice().reverse().forEach(({type:C,mark:S})=>{s.set(C,S)}),d=x+d;let b;if(y){const C=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{C.has(E)&&this.getHtmlReopenTags(E)&&a.add(E)});const S=Array.from(s.keys()),k=m.slice().sort((E,A)=>S.indexOf(A)-S.indexOf(E));b=[...p.map(E=>E.type),...k]}else b=i7t(s,f,h,this.markSetsEqual.bind(this));let T="";if(b.length>0){const C=d.match(/(\s+)$/);C&&(T=C[1],d=d.slice(0,-T.length))}b.forEach(C=>{var S;const k=(S=s.get(C))!==null&&S!==void 0?S:f.get(C),E=this.getMarkClosing(C,k,o.get(C));E&&(d+=E),s.delete(C),o.delete(C)}),d+=T,d+=v,i.push(d)}else{const d=new Set((l.marks||[]).map(v=>v.type)),f=new Map,p=new Map;s.forEach((v,x)=>{if(d.has(x)){var b;f.set(x,v),p.set(x,(b=o.get(x))!==null&&b!==void 0?b:"markdown")}});const g=s7t(s,(v,x)=>this.getMarkClosing(v,x,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":a7t(f,s,(v,x)=>{var b;const T=(b=p.get(v))!==null&&b!==void 0?b:"markdown";return o.set(v,T),this.getMarkOpening(v,x,T)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?void 0:n.open)||""}const i=this.getHandlersForNodeType(t),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const l=s.renderMarkdown(o,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(a);return u>=0?l.substring(0,u):""}catch(l){throw new Error(`Failed to get mark opening for ${t}: ${l}`)}}getMarkClosing(t,e,r="markdown"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?void 0:n.close)||""}const i=this.getHandlersForNodeType(t),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const l=s.renderMarkdown(o,{renderChildren:()=>a,renderChild:()=>a,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(a),h=u+33;return u>=0?l.substring(h):""}catch(l){throw new Error(`Failed to get mark closing for ${t}: ${l}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),r=e.length>0?e[0]:void 0;return r==null?void 0:r.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([r,n])=>{const i=e.get(r);return i&&KT(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=n7t(t,e);if(n.length<=1)return n;const i=(r==null?void 0:r.marks)||[],s=(u,h)=>i.some(d=>d.type===u&&KT(d.attrs,h)),a=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!==null&&f!==void 0?f:Number.MAX_SAFE_INTEGER;return p!==g?g-p:u.type.localeCompare(h.type)},o=n.filter(u=>!s(u.type,u.mark.attrs)).sort(a),l=n.filter(u=>s(u.type,u.mark.attrs)).sort(a);return[...o,...l]}};const d7t=Wi.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||BA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Vh.setContent(t,e);const r=this.editor.markdown.parse(t);return Vh.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||BA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Vh.insertContent(t,e);const r=this.editor.markdown.parse(t);return Vh.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||BA(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Vh.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return Vh.insertContentAt(t,n,r)}}},addStorage(){return{manager:new zG({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new zG({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||BA(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}}),f7t="listItem",Qce="textStyle",Jce=/^\s*([-+*])\s$/,TEe=Zn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(f7t,this.editor.getAttributes(Qce)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=QT({find:Jce,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=QT({find:Jce,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Qce),editor:this.editor})),[t]}}),p7t=(t,e,r)=>{const{selection:n}=t;if(!n.empty)return null;const{$from:i}=n;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){s=p;break}if(s<0)return null;const a=i.node(s),o=i.index(s);if(o+1>=a.childCount)return null;const l=a.child(o+1);if(!r.includes(l.type.name))return null;const u=t.schema.nodes[e];let h=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(h=!0)}),!h)return null;const d=t.doc.resolve(i.after()).nodeAfter;if(!d||!r.includes(d.type.name))return null;const f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:s,nestedList:d,nestedListPos:i.after(),insertPos:i.after(s),items:f}},g7t=(t,e,r,n)=>{const i=p7t(t,r,n);if(!i)return!1;const{selection:s}=t,{nestedList:a,nestedListPos:o,insertPos:l,items:u}=i,h=t.tr;h.delete(o,o+a.nodeSize);const d=h.mapping.map(l);return h.insert(d,Mt.from(u)),h.setSelection(s.map(h.doc,h.mapping)),e&&e(h),!0},m7t=(t,e,r)=>g7t(t.state,t.view.dispatch,e,r),CEe=(t,e)=>Wi.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>m7t(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),kEe=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],FA="abcdefghijklmnopqrstuvwxyz",SEe=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function dD(t){let e=t,r="";for(const[n,i]of kEe)for(;e>=n;)r+=i,e-=n;return r}function VZ(t){return dD(t).toUpperCase()}function EEe(t){const e=t.toLowerCase();let r=0,n=0;for(;r0?n:1}const r=parseInt(t,10);return Number.isNaN(r)?1:r}function b7t(t,e){if(t==="numeric")return String(e);switch(t){case"a":return v_(e);case"A":return v_(e).toUpperCase();case"i":return dD(e);case"I":return VZ(e);default:return String(e)}}function x7t(t){var e;if(t.length===0)return!1;const r=(e=fD(t[0]))!==null&&e!==void 0?e:"numeric",n=HZ(t[0]);if(n<1)return!1;for(let i=0;i{var r;if(t.type!=="list_item")return[];const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(k7t(t))return{type:"listItem",content:[{type:"paragraph",content:S7t(t.text||"",e)}]};if(t.tokens.some(s=>s.type==="paragraph"))i=n(t.tokens);else{const s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){const a=n(t.tokens.slice(1));i.push(...a)}}else i=n(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,r)=>Swe(t,e,n=>{if(n.parentType==="bulletList")return"- ";if(n.parentType==="orderedList"){var i,s;const a=((i=n.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return C7t((s=n.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,a-1+(n.index||0),". ")}return"- "},r,{alignNestedToPrefix:(r==null?void 0:r.parentType)==="orderedList"}),addExtensions(){return[CEe(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),GZ=(t,e)=>{const{$from:r}=e.selection,n=Ma(t,e.schema);let i=null,s=r.depth,a=r.pos,o=null;for(;s>0&&o===null;)i=r.node(s),i.type===n?o=s:(s-=1,a-=1);return o===null?null:{$pos:e.doc.resolve(a),depth:o}},MEe=(t,e)=>{const r=GZ(t,e);if(!r)return!1;const[,n]=Fft(e,t,r.$pos.pos+4);return n},E7t=(t,e,r)=>{const{$anchor:n}=t.selection,i=Math.max(0,n.pos-2),s=t.doc.resolve(i).node();return!(!s||!r.includes(s.type.name))},eue=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!a0(t.state,e)&&E7t(t.state,e,r)){const{$anchor:s}=t.state.selection,a=t.state.doc.resolve(s.before()-1),o=[];a.node().descendants((h,d)=>{h.type.name===e&&o.push({node:h,pos:d})});const l=o.at(-1);if(!l)return!1;const u=t.state.doc.resolve(a.start()+l.pos+1);return t.chain().cut({from:s.start()-1,to:s.end()+1},u.end()).joinForward().run()}if(!a0(t.state,e)||!Gft(t.state))return!1;const{$from:n}=t.state.selection,i=n.depth-1;return n.node(i).type!==t.schema.nodes[e]||n.index(i)!==0?!1:t.chain().liftListItem(e).run()},A7t=(t,e)=>{const r=MEe(t,e),n=GZ(t,e);return!n||!r?!1:r>n.depth},M7t=(t,e)=>{const r=MEe(t,e),n=GZ(t,e);return!n||!r?!1:r{if(!a0(t.state,e)||!Hft(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:A7t(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():M7t(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},R7t=(t,e,r)=>{const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||a0(n,e))return!1;const a=zft(s);if(!a||!r.includes(a.type.name))return!1;const o=a.lastChild;if(!o||o.type.name!==e)return!1;const l=s.parent;if(!o.canReplace(o.childCount,o.childCount,Mt.from(l)))return!1;const u=s.before(),h=s.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,h).insert(d,Mt.from(l)),f.setSelection(xr.create(f.doc,d+1)),f.scrollIntoView()),!0))},REe=Wi.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&tue(t,r)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&tue(t,r)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&eue(t,r,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&eue(t,r,n)&&(e=!0)}),e},Tab:({editor:t})=>{for(const{itemName:e,wrapperNames:r}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&R7t(t,e,r))return!0;return!1}}}}),VG=new RegExp(`^(\\s*)(${SEe})([.)])\\s+(.*)$`),_7t=/^\s/,C2={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function L7t(t){return VG.test(t.trimStart())}function I7t(t){const e=t.trimStart();return C2.bulletItem.test(e)||L7t(e)||C2.heading.test(e)||C2.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||C2.codeFence.test(e)||C2.blockMath.test(e)}function N7t(t){return Object.values(C2).some(e=>e.test(t))}function D7t(t){const e=[],r=[];let n=!1;return t.forEach(i=>{if(n){r.push(i);return}if(i.trim()===""){n=!0,r.push(i);return}if(e.length>0&&I7t(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function O7t(t){const e=[];let r=0,n=0;for(;r0&&n.push({type:s,items:i}),i=[f],s=p):i.push(f)}i.length>0&&n.push({type:s,items:i});const a=[];for(let o=0;o0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(e.find(n=>{if(!n.parseMarkdown)return!1;const i=n.parseMarkdown(t,r),s=this.normalizeParseResult(i);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!0):!1})&&this.lastParseResult){const n=this.lastParseResult;return this.lastParseResult=null,n}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,r)=>{const n={type:t,attrs:e||void 0,content:r||void 0};return(!e||Object.keys(e).length===0)&&delete n.attrs,n},applyMark:(t,e,r)=>({mark:t,content:e,attrs:r&&Object.keys(r).length>0?r:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let a=0;a|\/|$)/i);if(!u&&h&&!/\/>$/.test(l)){const f=h[1],p=this.escapeRegex(f),g=new RegExp(`^<\\/\\s*${p}\\b`,"i");let m=-1;const y=[l];for(let v=a+1;v0;a-=1){const o=e[a],l=e[a-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];Z0t(u,h)&&(l.text=(l.text||"")+(o.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,r){return e.map(n=>{if(n.type==="text"){const i=n.marks||[],s=r?{type:t,attrs:r}:{type:t};return{...n,marks:[...i,s]}}return{...n,content:n.content?this.applyMarkToContent(t,n.content,r):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Eoe(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const r=zft(e,this.baseExtensions);if(r.type==="doc"&&r.content){if(t.block)return r.content;const n=this.toInlineContent(r.content);return n.length>0?n:null}return r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(r=>r.type&&e.has(r.type)?[r]:r.content?this.toInlineContent(r.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=RH(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return y7t(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=RH(this.baseExtensions),r=n=>{const i=n==null?void 0:n.parseDOM;Array.isArray(i)&&i.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const a=s.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(n=>r(n.spec)),Object.values(e.marks).forEach(n=>r(n.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const r=t.replace(/\s+$/,"");return r?e?{type:"paragraph",content:[{type:"text",text:r}]}:{type:"text",text:r}:null}encodeTextForMarkdown(t,e,r){return(r==null?void 0:r.type)!=null&&this.codeTypes.has(r.type)||(e.marks||[]).some(n=>this.codeTypes.has(typeof n=="string"?n:n.type))?t:this.escapeMarkdownSyntax($0t(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,r=0,n=0,i={}){var s;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const o=Array.isArray(e==null?void 0:e.content)&&r>0?e.content[r-1]:void 0,l={renderChildren:(h,d)=>{const f=a.isIndenting?n+1:n;return!Array.isArray(h)&&h.content?this.renderNodes(h.content,t,d||"",r,f):this.renderNodes(h,t,d||"",r,f)},renderChild:(h,d)=>{const f=a.isIndenting?n+1:n;return this.renderNodeToMarkdown(h,t,d,f)},indent:h=>this.indentString+h,wrapInBlock:l7t},u={index:r,level:n,parentType:e==null?void 0:e.type,previousNode:o,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((s=a.renderMarkdown)===null||s===void 0?void 0:s.call(a,t,l,u))||""}renderNodes(t,e,r="",n=0,i=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,r,i):t.type?this.renderNodeToMarkdown(t,e,n,i):""}renderNodesWithMarkBoundaries(t,e,r="",n=0){const i=[],s=new Map,a=new Set,o=new Map;return t.forEach((l,u)=>{const h=u[C.type,C])),p=this.getMarksToOpenForSerialization(s,f,h),g=tue(f,h);if(d.length>0&&d.trim().length===0&&f.size>0){const C=new Set(g.filter(S=>!s.has(S)));C.size>0&&(f=new Map(Array.from(f).filter(([S])=>!C.has(S))),p=this.getMarksToOpenForSerialization(s,f,h),g=tue(f,h))}const m=g.filter(C=>s.has(C)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const C=d.match(/(\s+)$/);C&&(v=C[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(C=>{if(!s.has(C))return;const S=f.get(C),k=this.getMarkClosing(C,S,o.get(C));k&&(d+=k),s.has(C)&&(s.delete(C),o.delete(C))});let x="";if(p.length>0){const C=d.match(/^(\s+)/);C&&(x=C[1],d=d.slice(x.length))}p.forEach(({type:C,mark:S})=>{const k=a.has(C)?"html":"markdown",E=this.getMarkOpening(C,S,k);E&&(d=E+d),o.set(C,k),a.delete(C)}),y||p.slice().reverse().forEach(({type:C,mark:S})=>{s.set(C,S)}),d=x+d;let b;if(y){const C=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{C.has(E)&&this.getHtmlReopenTags(E)&&a.add(E)});const S=Array.from(s.keys()),k=m.slice().sort((E,A)=>S.indexOf(A)-S.indexOf(E));b=[...p.map(E=>E.type),...k]}else b=u7t(s,f,h,this.markSetsEqual.bind(this));let T="";if(b.length>0){const C=d.match(/(\s+)$/);C&&(T=C[1],d=d.slice(0,-T.length))}b.forEach(C=>{var S;const k=(S=s.get(C))!==null&&S!==void 0?S:f.get(C),E=this.getMarkClosing(C,k,o.get(C));E&&(d+=E),s.delete(C),o.delete(C)}),d+=T,d+=v,i.push(d)}else{const d=new Set((l.marks||[]).map(v=>v.type)),f=new Map,p=new Map;s.forEach((v,x)=>{if(d.has(x)){var b;f.set(x,v),p.set(x,(b=o.get(x))!==null&&b!==void 0?b:"markdown")}});const g=h7t(s,(v,x)=>this.getMarkClosing(v,x,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":d7t(f,s,(v,x)=>{var b;const T=(b=p.get(v))!==null&&b!==void 0?b:"markdown";return o.set(v,T),this.getMarkOpening(v,x,T)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?void 0:n.open)||""}const i=this.getHandlersForNodeType(t),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const l=s.renderMarkdown(o,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(a);return u>=0?l.substring(0,u):""}catch(l){throw new Error(`Failed to get mark opening for ${t}: ${l}`)}}getMarkClosing(t,e,r="markdown"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?void 0:n.close)||""}const i=this.getHandlersForNodeType(t),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const l=s.renderMarkdown(o,{renderChildren:()=>a,renderChild:()=>a,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(a),h=u+33;return u>=0?l.substring(h):""}catch(l){throw new Error(`Failed to get mark closing for ${t}: ${l}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),r=e.length>0?e[0]:void 0;return r==null?void 0:r.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([r,n])=>{const i=e.get(r);return i&&QT(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=c7t(t,e);if(n.length<=1)return n;const i=(r==null?void 0:r.marks)||[],s=(u,h)=>i.some(d=>d.type===u&&QT(d.attrs,h)),a=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!==null&&f!==void 0?f:Number.MAX_SAFE_INTEGER;return p!==g?g-p:u.type.localeCompare(h.type)},o=n.filter(u=>!s(u.type,u.mark.attrs)).sort(a),l=n.filter(u=>s(u.type,u.mark.attrs)).sort(a);return[...o,...l]}};const v7t=Wi.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||VA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Wh.setContent(t,e);const r=this.editor.markdown.parse(t);return Wh.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||VA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Wh.insertContent(t,e);const r=this.editor.markdown.parse(t);return Wh.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||VA(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Wh.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return Wh.insertContentAt(t,n,r)}}},addStorage(){return{manager:new WG({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new WG({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||VA(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}}),b7t="listItem",rue="textStyle",nue=/^\s*([-+*])\s$/,MEe=Zn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(b7t,this.editor.getAttributes(rue)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=e5({find:nue,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=e5({find:nue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(rue),editor:this.editor})),[t]}}),x7t=(t,e,r)=>{const{selection:n}=t;if(!n.empty)return null;const{$from:i}=n;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){s=p;break}if(s<0)return null;const a=i.node(s),o=i.index(s);if(o+1>=a.childCount)return null;const l=a.child(o+1);if(!r.includes(l.type.name))return null;const u=t.schema.nodes[e];let h=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(h=!0)}),!h)return null;const d=t.doc.resolve(i.after()).nodeAfter;if(!d||!r.includes(d.type.name))return null;const f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:s,nestedList:d,nestedListPos:i.after(),insertPos:i.after(s),items:f}},w7t=(t,e,r,n)=>{const i=x7t(t,r,n);if(!i)return!1;const{selection:s}=t,{nestedList:a,nestedListPos:o,insertPos:l,items:u}=i,h=t.tr;h.delete(o,o+a.nodeSize);const d=h.mapping.map(l);return h.insert(d,Mt.from(u)),h.setSelection(s.map(h.doc,h.mapping)),e&&e(h),!0},T7t=(t,e,r)=>w7t(t.state,t.view.dispatch,e,r),REe=(t,e)=>Wi.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>T7t(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),_Ee=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],HA="abcdefghijklmnopqrstuvwxyz",LEe=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function gD(t){let e=t,r="";for(const[n,i]of _Ee)for(;e>=n;)r+=i,e-=n;return r}function qZ(t){return gD(t).toUpperCase()}function IEe(t){const e=t.toLowerCase();let r=0,n=0;for(;r0?n:1}const r=parseInt(t,10);return Number.isNaN(r)?1:r}function S7t(t,e){if(t==="numeric")return String(e);switch(t){case"a":return T_(e);case"A":return T_(e).toUpperCase();case"i":return gD(e);case"I":return qZ(e);default:return String(e)}}function E7t(t){var e;if(t.length===0)return!1;const r=(e=mD(t[0]))!==null&&e!==void 0?e:"numeric",n=UZ(t[0]);if(n<1)return!1;for(let i=0;i{var r;if(t.type!=="list_item")return[];const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(_7t(t))return{type:"listItem",content:[{type:"paragraph",content:L7t(t.text||"",e)}]};if(t.tokens.some(s=>s.type==="paragraph"))i=n(t.tokens);else{const s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){const a=n(t.tokens.slice(1));i.push(...a)}}else i=n(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,r)=>Lwe(t,e,n=>{if(n.parentType==="bulletList")return"- ";if(n.parentType==="orderedList"){var i,s;const a=((i=n.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return R7t((s=n.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,a-1+(n.index||0),". ")}return"- "},r,{alignNestedToPrefix:(r==null?void 0:r.parentType)==="orderedList"}),addExtensions(){return[REe(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),YZ=(t,e)=>{const{$from:r}=e.selection,n=Ma(t,e.schema);let i=null,s=r.depth,a=r.pos,o=null;for(;s>0&&o===null;)i=r.node(s),i.type===n?o=s:(s-=1,a-=1);return o===null?null:{$pos:e.doc.resolve(a),depth:o}},DEe=(t,e)=>{const r=YZ(t,e);if(!r)return!1;const[,n]=qft(e,t,r.$pos.pos+4);return n},I7t=(t,e,r)=>{const{$anchor:n}=t.selection,i=Math.max(0,n.pos-2),s=t.doc.resolve(i).node();return!(!s||!r.includes(s.type.name))},iue=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!u0(t.state,e)&&I7t(t.state,e,r)){const{$anchor:s}=t.state.selection,a=t.state.doc.resolve(s.before()-1),o=[];a.node().descendants((h,d)=>{h.type.name===e&&o.push({node:h,pos:d})});const l=o.at(-1);if(!l)return!1;const u=t.state.doc.resolve(a.start()+l.pos+1);return t.chain().cut({from:s.start()-1,to:s.end()+1},u.end()).joinForward().run()}if(!u0(t.state,e)||!Xft(t.state))return!1;const{$from:n}=t.state.selection,i=n.depth-1;return n.node(i).type!==t.schema.nodes[e]||n.index(i)!==0?!1:t.chain().liftListItem(e).run()},N7t=(t,e)=>{const r=DEe(t,e),n=YZ(t,e);return!n||!r?!1:r>n.depth},D7t=(t,e)=>{const r=DEe(t,e),n=YZ(t,e);return!n||!r?!1:r{if(!u0(t.state,e)||!jft(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:N7t(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():D7t(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},O7t=(t,e,r)=>{const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||u0(n,e))return!1;const a=Uft(s);if(!a||!r.includes(a.type.name))return!1;const o=a.lastChild;if(!o||o.type.name!==e)return!1;const l=s.parent;if(!o.canReplace(o.childCount,o.childCount,Mt.from(l)))return!1;const u=s.before(),h=s.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,h).insert(d,Mt.from(l)),f.setSelection(wr.create(f.doc,d+1)),f.scrollIntoView()),!0))},OEe=Wi.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&sue(t,r)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&sue(t,r)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&iue(t,r,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&iue(t,r,n)&&(e=!0)}),e},Tab:({editor:t})=>{for(const{itemName:e,wrapperNames:r}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&O7t(t,e,r))return!0;return!1}}}}),qG=new RegExp(`^(\\s*)(${LEe})([.)])\\s+(.*)$`),P7t=/^\s/,S2={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function $7t(t){return qG.test(t.trimStart())}function B7t(t){const e=t.trimStart();return S2.bulletItem.test(e)||$7t(e)||S2.heading.test(e)||S2.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||S2.codeFence.test(e)||S2.blockMath.test(e)}function F7t(t){return Object.values(S2).some(e=>e.test(t))}function z7t(t){const e=[],r=[];let n=!1;return t.forEach(i=>{if(n){r.push(i);return}if(i.trim()===""){n=!0,r.push(i);return}if(e.length>0&&B7t(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function V7t(t){const e=[];let r=0,n=0;for(;rn.trim().length>0);if(e.length===0)return null;const r=[];for(const n of e){const i=n.trim().match(P7t);if(!i)return null;r.push({marker:i[1],content:i[3]})}return x7t(r.map(n=>n.marker))?{type:"orderedList",attrs:T7t(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function _Ee(t,e,r){const n=[];let i=0;for(;in.trim().length>0);if(e.length===0)return null;const r=[];for(const n of e){const i=n.trim().match(H7t);if(!i)return null;r.push({marker:i[1],content:i[3]})}return E7t(r.map(n=>n.marker))?{type:"orderedList",attrs:M7t(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function PEe(t,e,r){const n=[];let i=0;for(;ie;)f.push(t[d]),d+=1;if(f.length>0){const p=_Ee(f,Math.min(...f.map(g=>g.indent)),r);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(g=>g.raw).join(` -`)})}n.push({type:"list_item",raw:s.raw,tokens:u}),i=d}else i+=1}return n}function B7t(t,e){return t.map(r=>{if(r.type!=="list_item")return e.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);n.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&n.push(...s)}}),{type:"listItem",content:n}})}const F7t="listItem",rue="textStyle",nue=/^(\d+)\.\s$/;function iue(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const LEe=Zn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const r=t.getAttribute("style");if(r){const i=iue(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const s=iue(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=xn(this.options.HTMLAttributes,n);return e!==1&&(i.start=e),r&&r!=="1"&&(i.type=r),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const r=t.start||1,n=t.typeMarker,i=t.items?B7t(t.items,e):[],s={};return r!==1&&(s.start=r),n&&(s.type=n),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`).trim();if(h){const p=r.blockTokens(h);u.push(...p)}let d=i+1;const f=[];for(;de;)f.push(t[d]),d+=1;if(f.length>0){const p=PEe(f,Math.min(...f.map(g=>g.indent)),r);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(g=>g.raw).join(` +`)})}n.push({type:"list_item",raw:s.raw,tokens:u}),i=d}else i+=1}return n}function W7t(t,e){return t.map(r=>{if(r.type!=="list_item")return e.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);n.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&n.push(...s)}}),{type:"listItem",content:n}})}const q7t="listItem",aue="textStyle",oue=/^(\d+)\.\s$/;function lue(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const $Ee=Zn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const r=t.getAttribute("style");if(r){const i=lue(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const s=lue(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=xn(this.options.HTMLAttributes,n);return e!==1&&(i.start=e),r&&r!=="1"&&(i.type=r),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const r=t.start||1,n=t.typeMarker,i=t.items?W7t(t.items,e):[],s={};return r!==1&&(s.start=r),n&&(s.type=n),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,r)=>{var n,i;const s=t.split(` -`),[a,o]=O7t(s);if(a.length===0)return;const l=_Ee(a,a[0].indent,r);if(l.length!==0)return{type:"list",ordered:!0,start:((n=a[0])===null||n===void 0?void 0:n.number)||1,typeMarker:(i=a[0])===null||i===void 0?void 0:i.type,items:l,raw:s.slice(0,o).join(` -`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(F7t,this.editor.getAttributes(rue)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ki({props:{handlePaste:(t,e)=>{var r,n;const i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/html");if(i!=null&&i.trim())return!1;const s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s)return!1;const a=$7t(s);if(!a)return!1;try{const o=t.state.schema.nodeFromJSON(a),l=t.state.tr.replaceSelectionWith(o);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(r,n)=>(!n.attrs.type||n.attrs.type==="1")&&n.childCount+n.attrs.start===+r[1];let e=QT({find:nue,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=QT({find:nue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(rue)}),joinPredicate:t,editor:this.editor})),[e]}}),z7t=/^\s*(\[([( |x])?\])\s$/,V7t="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",H7t=(t,e,r)=>{var n;return(r==null||(n=r.checkboxLabel)===null||n===void 0?void 0:n.call(r,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},IEe=Zn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",xn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const r=[];if(t.tokens&&t.tokens.length>0?r.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?r.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):r.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);r.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},r)},renderMarkdown:(t,e)=>{var r;const n=`- [${!((r=t.attrs)===null||r===void 0)&&r.checked?"x":" "}] `;return Swe(t,e,n)},addExtensions(){return this.options.nested?[CEe(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),o=document.createElement("input"),l=document.createElement("div");a.style.cssText=V7t;const u=d=>{const f=H7t(d,d.attrs.checked,this.options.a11y);o.setAttribute("aria-label",f),a.textContent=f};u(t),s.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",d=>d.preventDefault()),o.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:f}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=r();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,o.checked=t.attrs.checked,s.append(o,a),i.append(s,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let h=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,o.checked=d.attrs.checked,u(d);const f=n.extensionManager.attributes,p=XT(d,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return h.forEach(y=>{g.has(y)||(y in m?i.setAttribute(y,m[y]):i.removeAttribute(y))}),Object.entries(p).forEach(([y,v])=>{v==null?y in m?i.setAttribute(y,m[y]):i.removeAttribute(y):i.setAttribute(y,v)}),h=g,!0}}}},addInputRules(){return[QT({find:z7t,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),NEe=Zn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",xn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const r=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return r!==void 0?r:-1},tokenize(t,e,r){const n=s=>{const a=Coe(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,l)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:r.inlineTokens(o.mainContent),nestedTokens:l}),customNestedParser:n},r);if(a){const o={type:"taskList",raw:a.raw,items:a.items},l=s.slice(a.raw.length);return l.trim()?[o,...r.blockTokens(l)]:[o]}return r.blockTokens(s)},i=Coe(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:r.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:n},r);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Wi.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(TEe.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(AEe.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(REe.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(LEe.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(IEe.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(NEe.configure(this.options.taskList)),t}});let HG,GG;if(typeof WeakMap<"u"){let t=new WeakMap;HG=e=>t.get(e),GG=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;HG=n=>{for(let i=0;i(r==10&&(r=0),t[r++]=n,t[r++]=i)}var Ds=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e=r){(s||(s=[])).push({type:"overlong_rowspan",pos:h,n:v-b});break}const T=i+b*e;for(let C=0;Cn&&(s+=u.attrs.colspan)}}for(let a=0;a1&&(r=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function q7t(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Y7t(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function Nh(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function pD(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=Ey(e.$head)||j7t(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function j7t(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function WG(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function X7t(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function WZ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function DEe(t,e,r){const n=t.node(-1),i=Ds.get(n),s=t.start(-1),a=i.nextCell(t.pos-s,e,r);return a==null?null:t.node(0).resolve(s+a)}function Ay(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function OEe(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;ih!=r.pos-s);l.unshift(r.pos-s);const u=l.map(h=>{const d=n.nodeAt(h);if(!d)throw new RangeError(`No cell with offset ${h} found`);const f=s+h+1;return new e4e(o.resolve(f),o.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(WG(n)&&WG(i)&&WZ(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?bf.rowSelection(n,i):s&&this.isColSelection()?bf.colSelection(n,i):new bf(n,i)}return xr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=Ds.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},a=[];for(let l=i.top;l0||y>0){let v=g.attrs;if(m>0&&(v=Ay(v,0,m)),y>0&&(v=Ay(v,v.colspan-y,y)),p.lefti.bottom){const v={...g.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=Ds.get(n),s=e.start(-1),a=i.findCell(e.pos-s),o=i.findCell(r.pos-s),l=e.node(0);return a.top<=o.top?(a.top>0&&(e=l.resolve(s+i.map[a.left])),o.bottom0&&(r=l.resolve(s+i.map[o.left])),a.bottom0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,o=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==r.width}eq(e){return e instanceof bf&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=Ds.get(n),s=e.start(-1),a=i.findCell(e.pos-s),o=i.findCell(r.pos-s),l=e.node(0);return a.left<=o.left?(a.left>0&&(e=l.resolve(s+i.map[a.top*i.width])),o.right0&&(r=l.resolve(s+i.map[o.top*i.width])),a.right{e.push(Ga.node(n,n+r.nodeSize,{class:"selectedCell"}))}),zn.create(t.doc,e)}function J7t({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(s+1)>e.start(s));s--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function eAt({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}return r!==n&&e.parentOffset===0}function tAt(t,e,r){const n=(e||t).selection,i=(e||t).doc;let s,a;if(n instanceof Nr&&(a=n.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=zi.create(i,n.from);else if(a=="row"){const o=i.resolve(n.from+1);s=zi.rowSelection(o,o)}else if(!r){const o=Ds.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];s=zi.create(i,l+1,u)}}else n instanceof xr&&J7t(n)?s=xr.create(i,n.from):n instanceof xr&&eAt(n)&&(s=xr.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const rAt=new us("fix-tables");function $Ee(t,e,r,n){const i=t.childCount,s=e.childCount;e:for(let a=0,o=0;a{i.type.spec.tableRole=="table"&&(r=nAt(t,i,s,r))};return e?e.doc!=t.doc&&$Ee(e.doc,t.doc,0,n):t.doc.descendants(n),r}function nAt(t,e,r,n){const i=Ds.get(e);if(!i.problems)return n;n||(n=t.tr);const s=[];for(let l=0;l0){let p="cell";h.firstChild&&(p=h.firstChild.type.spec.tableRole);const g=[];for(let y=0;y0?-1:0;K7t(e,n,i+s)&&(s=i==0||i==e.width?null:0);for(let a=0;a0&&i0&&e.map[o-1]==l||i0?-1:0;lAt(e,n,i+o)&&(o=i==0||i==e.height?null:0);for(let u=0,h=e.width*i;u0&&i0&&d==e.map[h-e.width]){const f=r.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(o).map(d+n),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(i0&&r[s]==r[s-1]||n.right0&&r[i]==r[i-t]||n.bottom0){const h=l+1+u.content.size,d=sue(u)?l+1:h;s.replaceWith(d+n.tableStart,h+n.tableStart,o)}s.setSelection(new zi(s.doc.resolve(l+n.tableStart))),e(s)}return!0}function oue(t,e){const r=Wo(t.schema);return pAt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function pAt(t){return(e,r)=>{const n=e.selection;let i,s;if(n instanceof zi){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,s=n.$anchorCell.pos}else{var a;if(i=Y7t(n.$from),!i)return!1;s=(a=Ey(n.$from))===null||a===void 0?void 0:a.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(r){let o=i.attrs;const l=[],u=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const h=Hd(e),d=e.tr;for(let p=0;p{a.attrs[t]!==e&&s.setNodeMarkup(o,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(s)}return!0}}function mAt(t){return function(e,r){if(!Nh(e))return!1;if(r){const n=Wo(e.schema),i=Hd(e),s=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),o=a.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=f+s.tableStart,g=a.doc.nodeAt(p);g&&a.setNodeMarkup(p,d,g.attrs)}),n(a)}return!0}}S6("row",{useDeprecatedLogic:!0});S6("column",{useDeprecatedLogic:!0});const yAt=S6("cell",{useDeprecatedLogic:!0});function vAt(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const s=t.node(-1).child(n),a=s.lastChild;if(a)return i-1-a.nodeSize;i-=s.nodeSize}}else{if(t.index()0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function zA(t,e){const r=t.selection;if(!(r instanceof zi))return!1;if(e){const n=t.tr,i=Wo(t.schema).cell.createAndFill().content;r.forEachCell((s,a)=>{s.content.eq(i)||n.replace(n.mapping.map(a+1),n.mapping.map(a+s.nodeSize-1),new Jt(i,0,0))}),n.docChanged&&e(n)}return!0}function xAt(t){if(t.size===0)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,a=i.type.schema,o=[];if(s=="row")for(let l=0;l=0;a--){const{rowspan:o,colspan:l}=s.child(a).attrs;for(let u=i;u=e.length&&e.push(Mt.empty),r[i]n&&(f=f.type.createChecked(Ay(f.attrs,f.attrs.colspan,h+f.attrs.colspan-n),f.content)),u.push(f),h+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}s.push(Mt.from(l))}r=s,e=i}return{width:t,height:e,rows:r}}function CAt(t,e,r,n,i,s,a){const o=t.doc.type.schema,l=Wo(o);let u,h;if(i>e.width)for(let d=0,f=0;de.height){const d=[];for(let g=0,m=(e.height-1)*e.width;g=e.width?!1:r.nodeAt(e.map[m+g]).type==l.header_cell;d.push(y?h||(h=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const f=l.row.create(null,Mt.from(d)),p=[];for(let g=e.height;g{if(!i)return!1;const s=r.selection;if(s instanceof zi)return OM(r,n,Xr.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=VEe(i,t,e);if(a==null)return!1;if(t=="horiz")return OM(r,n,Xr.near(r.doc.resolve(s.head+e),e));{const o=r.doc.resolve(a),l=DEe(o,t,e);let u;return l?u=Xr.near(l,1):e<0?u=Xr.near(r.doc.resolve(o.before(-1)),-1):u=Xr.near(r.doc.resolve(o.after(-1)),1),OM(r,n,u)}}}function HA(t,e){return(r,n,i)=>{if(!i)return!1;const s=r.selection;let a;if(s instanceof zi)a=s;else{const l=VEe(i,t,e);if(l==null)return!1;a=new zi(r.doc.resolve(l))}const o=DEe(a.$headCell,t,e);return o?OM(r,n,new zi(a.$anchorCell,o)):!1}}function SAt(t,e){const r=t.state.doc,n=Ey(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new zi(n))),!0):!1}function EAt(t,e,r){if(!Nh(t.state))return!1;let n=xAt(r);const i=t.state.selection;if(i instanceof zi){n||(n={width:1,height:1,rows:[Mt.from(qG(Wo(t.state.schema).cell,r))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=Ds.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return n=TAt(n,o.right-o.left,o.bottom-o.top),due(t.state,t.dispatch,a,o,n),!0}else if(n){const s=pD(t.state),a=s.start(-1);return due(t.state,t.dispatch,a,Ds.get(s.node(-1)).findCell(s.pos-a),n),!0}else return!1}function AAt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=fue(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof zi)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=Ey(t.state.selection.$anchor))!=null&&((r=oB(t,e))===null||r===void 0?void 0:r.pos)!=i.pos)s(i,e),e.preventDefault();else if(!n)return;function s(l,u){let h=oB(t,u);const d=Ip.getState(t.state)==null;if(!h||!WZ(l,h))if(d)h=l;else return;const f=new zi(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(Ip,l.pos),t.dispatch(p)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",o),Ip.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Ip,-1))}function o(l){const u=l,h=Ip.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(fue(t,u.target)!=n&&(d=oB(t,e),!d))return a();d&&s(d,u)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",o)}function VEe(t,e,r){if(!(t.state.selection instanceof xr))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const a=n.before(i),o=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(o)?a:null}}return null}function fue(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function oB(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return null;let{inside:n,pos:i}=r;return n>=0&&Ey(t.state.doc.resolve(n))||Ey(t.state.doc.resolve(i))}var MAt=class{constructor(e,r){this.node=e,this.defaultCellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${r}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),UG(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,UG(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function UG(t,e,r,n,i,s){let a=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;dnew n(d,r,f)),new _At(-1,!1)},apply(a,o){return o.apply(a)}},props:{attributes:a=>{const o=_c.getState(a);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,o)=>{LAt(a,o,t,i)},mouseleave:a=>{IAt(a)},mousedown:(a,o)=>{NAt(a,o,e,r)}},decorations:a=>{const o=_c.getState(a);if(o&&o.activeHandle>-1)return BAt(a,o.activeHandle)},nodeViews:{}}});return s}var _At=class PM{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(_c);if(n&&n.setHandle!=null)return new PM(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new PM(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return WG(e.doc.resolve(i))||(i=-1),new PM(i,r.dragging)}return r}};function LAt(t,e,r,n){if(!t.editable)return;const i=_c.getState(t.state);if(i&&!i.dragging){const s=OAt(e.target);let a=-1;if(s){const{left:o,right:l}=s.getBoundingClientRect();e.clientX-o<=r?a=pue(t,e,"left",r):l-e.clientX<=r&&(a=pue(t,e,"right",r))}if(a!=i.activeHandle){if(!n&&a!==-1){const o=t.state.doc.resolve(a),l=o.node(-1),u=Ds.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}HEe(t,a)}}}function IAt(t){if(!t.editable)return;const e=_c.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&HEe(t,-1)}function NAt(t,e,r,n){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,a=_c.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const o=t.state.doc.nodeAt(a.activeHandle),l=DAt(t,a.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(_c,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",h);const f=_c.getState(t.state);f!=null&&f.dragging&&(PAt(t,f.activeHandle,gue(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(_c,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=_c.getState(t.state);if(f&&f.dragging){const p=gue(f.dragging,d,r);mue(t,f.activeHandle,p,n)}}return mue(t,a.activeHandle,l,n),s.addEventListener("mouseup",u),s.addEventListener("mousemove",h),e.preventDefault(),!0}function DAt(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const s=t.domAtPos(e);let a=s.node.childNodes[s.offset].offsetWidth,o=r;if(n)for(let l=0;lzAt(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function HAt(t){var e;const r=t.parentElement,n=t.closest("table");if(!r||!n)return null;const i=Array.from(r.children).indexOf(t),s=(e=n.querySelectorAll("colgroup > col")[i])===null||e===void 0?void 0:e.getAttribute("width");return s?[parseInt(s,10)]:null}function WEe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):HAt(t)}const GAt=/[ \t\r\n\f]+/g;function qEe(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(GAt,"")===""}function UEe(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const WAt=Zn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:WEe},align:GEe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>qEe(t)?{}:!1,getContent:(t,e)=>UEe(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",xn(this.options.HTMLAttributes,t),0]}}),qAt=Zn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:WEe},align:GEe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>qEe(t)?{}:!1,getContent:(t,e)=>UEe(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",xn(this.options.HTMLAttributes,t),0]}}),UAt=Zn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",xn(this.options.HTMLAttributes,t),0]}});function YG(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function yue(t,e,r,n,i,s){let a=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u!==null)for(let f=0,p=0;f{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function KAt(t,e,r,n,i){const s=XAt(t),a=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!ZAt(e))return!1;let r=0;const n=s6(e.ranges[0].$from,i=>i.type.name==="table");return n==null||n.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(r+=1)}),r!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function bue(t,e){const r=t.mapping.map(e),n=s6(t.selection.$from,a=>a.type.name==="table");if((n==null?void 0:n.pos)===r)return;const i=t.doc.nodeAt(r);if(!i)return;const s=r+i.nodeSize-1;t.setSelection(xr.near(t.doc.resolve(s),-1))}function QAt(t){let e="",r=0;for(;rl==="|"?"\\|":l)+t.slice(i,i+n),r=i+n,s=!0;break}i+=a}s||(e+=t.slice(r,r+n),r+=n)}return e}function JAt(t){return t.split(` -`).map(e=>!e.includes("|")||!e.includes("`")?e:QAt(e)).join(` -`)}function e8t(t){return(t||"").replace(/\s+/g," ").trim()}function t8t(t,e,r={}){var n;const i=(n=r.cellLineSeparator)!==null&&n!==void 0?n:"";if(!t||!t.content||t.content.length===0)return"";const s=[];t.content.forEach(g=>{const m=[];g.content&&g.content.forEach(y=>{let v="";y.content&&Array.isArray(y.content)&&y.content.length>1?v=y.content.map(C=>e.renderChildren(C)).join(i):v=y.content?e.renderChildren(y.content):"";const x=e8t(v.split(i).join(` -`).replace(/[ \t]*\r?\n[ \t]*/g,"
    ")),b=y.type==="tableHeader",T=VAt(y.attrs);m.push({text:x,isHeader:b,align:T})}),s.push(m)});const a=s.reduce((g,m)=>Math.max(g,m.length),0);if(a===0)return"";const o=Array.from({length:a}).fill(0);s.forEach(g=>{for(let y=0;yo[y]&&(o[y]=v),o[y]<3&&(o[y]=3)}});const l=(g,m)=>g+" ".repeat(Math.max(0,m-g.length)),u=s[0],h=u.some(g=>g.isHeader),d=Array.from({length:a}).fill(null);s.forEach(g=>{for(let y=0;y({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(q7t,this.editor.getAttributes(aue)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ki({props:{handlePaste:(t,e)=>{var r,n;const i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/html");if(i!=null&&i.trim())return!1;const s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s)return!1;const a=G7t(s);if(!a)return!1;try{const o=t.state.schema.nodeFromJSON(a),l=t.state.tr.replaceSelectionWith(o);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(r,n)=>(!n.attrs.type||n.attrs.type==="1")&&n.childCount+n.attrs.start===+r[1];let e=e5({find:oue,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=e5({find:oue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(aue)}),joinPredicate:t,editor:this.editor})),[e]}}),U7t=/^\s*(\[([( |x])?\])\s$/,Y7t="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",j7t=(t,e,r)=>{var n;return(r==null||(n=r.checkboxLabel)===null||n===void 0?void 0:n.call(r,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},BEe=Zn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",xn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const r=[];if(t.tokens&&t.tokens.length>0?r.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?r.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):r.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);r.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},r)},renderMarkdown:(t,e)=>{var r;const n=`- [${!((r=t.attrs)===null||r===void 0)&&r.checked?"x":" "}] `;return Lwe(t,e,n)},addExtensions(){return this.options.nested?[REe(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),o=document.createElement("input"),l=document.createElement("div");a.style.cssText=Y7t;const u=d=>{const f=j7t(d,d.attrs.checked,this.options.a11y);o.setAttribute("aria-label",f),a.textContent=f};u(t),s.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",d=>d.preventDefault()),o.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:f}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=r();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,o.checked=t.attrs.checked,s.append(o,a),i.append(s,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let h=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,o.checked=d.attrs.checked,u(d);const f=n.extensionManager.attributes,p=ZT(d,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return h.forEach(y=>{g.has(y)||(y in m?i.setAttribute(y,m[y]):i.removeAttribute(y))}),Object.entries(p).forEach(([y,v])=>{v==null?y in m?i.setAttribute(y,m[y]):i.removeAttribute(y):i.setAttribute(y,v)}),h=g,!0}}}},addInputRules(){return[e5({find:U7t,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),FEe=Zn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",xn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const r=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return r!==void 0?r:-1},tokenize(t,e,r){const n=s=>{const a=Aoe(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,l)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:r.inlineTokens(o.mainContent),nestedTokens:l}),customNestedParser:n},r);if(a){const o={type:"taskList",raw:a.raw,items:a.items},l=s.slice(a.raw.length);return l.trim()?[o,...r.blockTokens(l)]:[o]}return r.blockTokens(s)},i=Aoe(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:r.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:n},r);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Wi.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(MEe.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(NEe.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(OEe.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push($Ee.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(BEe.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(FEe.configure(this.options.taskList)),t}});let UG,YG;if(typeof WeakMap<"u"){let t=new WeakMap;UG=e=>t.get(e),YG=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;UG=n=>{for(let i=0;i(r==10&&(r=0),t[r++]=n,t[r++]=i)}var Ds=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e=r){(s||(s=[])).push({type:"overlong_rowspan",pos:h,n:v-b});break}const T=i+b*e;for(let C=0;Cn&&(s+=u.attrs.colspan)}}for(let a=0;a1&&(r=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function Z7t(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function J7t(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function Ph(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function yD(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=My(e.$head)||eAt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function eAt(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function jG(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function tAt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function jZ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function zEe(t,e,r){const n=t.node(-1),i=Ds.get(n),s=t.start(-1),a=i.nextCell(t.pos-s,e,r);return a==null?null:t.node(0).resolve(s+a)}function Ry(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function VEe(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;ih!=r.pos-s);l.unshift(r.pos-s);const u=l.map(h=>{const d=n.nodeAt(h);if(!d)throw new RangeError(`No cell with offset ${h} found`);const f=s+h+1;return new a4e(o.resolve(f),o.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(jG(n)&&jG(i)&&jZ(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?Tf.rowSelection(n,i):s&&this.isColSelection()?Tf.colSelection(n,i):new Tf(n,i)}return wr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=Ds.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},a=[];for(let l=i.top;l0||y>0){let v=g.attrs;if(m>0&&(v=Ry(v,0,m)),y>0&&(v=Ry(v,v.colspan-y,y)),p.lefti.bottom){const v={...g.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=Ds.get(n),s=e.start(-1),a=i.findCell(e.pos-s),o=i.findCell(r.pos-s),l=e.node(0);return a.top<=o.top?(a.top>0&&(e=l.resolve(s+i.map[a.left])),o.bottom0&&(r=l.resolve(s+i.map[o.left])),a.bottom0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,o=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==r.width}eq(e){return e instanceof Tf&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=Ds.get(n),s=e.start(-1),a=i.findCell(e.pos-s),o=i.findCell(r.pos-s),l=e.node(0);return a.left<=o.left?(a.left>0&&(e=l.resolve(s+i.map[a.top*i.width])),o.right0&&(r=l.resolve(s+i.map[o.top*i.width])),a.right{e.push(Ga.node(n,n+r.nodeSize,{class:"selectedCell"}))}),zn.create(t.doc,e)}function sAt({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(s+1)>e.start(s));s--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function aAt({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}return r!==n&&e.parentOffset===0}function oAt(t,e,r){const n=(e||t).selection,i=(e||t).doc;let s,a;if(n instanceof Nr&&(a=n.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=zi.create(i,n.from);else if(a=="row"){const o=i.resolve(n.from+1);s=zi.rowSelection(o,o)}else if(!r){const o=Ds.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];s=zi.create(i,l+1,u)}}else n instanceof wr&&sAt(n)?s=wr.create(i,n.from):n instanceof wr&&aAt(n)&&(s=wr.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const lAt=new us("fix-tables");function GEe(t,e,r,n){const i=t.childCount,s=e.childCount;e:for(let a=0,o=0;a{i.type.spec.tableRole=="table"&&(r=cAt(t,i,s,r))};return e?e.doc!=t.doc&&GEe(e.doc,t.doc,0,n):t.doc.descendants(n),r}function cAt(t,e,r,n){const i=Ds.get(e);if(!i.problems)return n;n||(n=t.tr);const s=[];for(let l=0;l0){let p="cell";h.firstChild&&(p=h.firstChild.type.spec.tableRole);const g=[];for(let y=0;y0?-1:0;rAt(e,n,i+s)&&(s=i==0||i==e.width?null:0);for(let a=0;a0&&i0&&e.map[o-1]==l||i0?-1:0;pAt(e,n,i+o)&&(o=i==0||i==e.height?null:0);for(let u=0,h=e.width*i;u0&&i0&&d==e.map[h-e.width]){const f=r.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(o).map(d+n),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(i0&&r[s]==r[s-1]||n.right0&&r[i]==r[i-t]||n.bottom0){const h=l+1+u.content.size,d=cue(u)?l+1:h;s.replaceWith(d+n.tableStart,h+n.tableStart,o)}s.setSelection(new zi(s.doc.resolve(l+n.tableStart))),e(s)}return!0}function hue(t,e){const r=Wo(t.schema);return xAt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function xAt(t){return(e,r)=>{const n=e.selection;let i,s;if(n instanceof zi){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,s=n.$anchorCell.pos}else{var a;if(i=J7t(n.$from),!i)return!1;s=(a=My(n.$from))===null||a===void 0?void 0:a.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(r){let o=i.attrs;const l=[],u=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const h=qd(e),d=e.tr;for(let p=0;p{a.attrs[t]!==e&&s.setNodeMarkup(o,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(s)}return!0}}function TAt(t){return function(e,r){if(!Ph(e))return!1;if(r){const n=Wo(e.schema),i=qd(e),s=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),o=a.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=f+s.tableStart,g=a.doc.nodeAt(p);g&&a.setNodeMarkup(p,d,g.attrs)}),n(a)}return!0}}M6("row",{useDeprecatedLogic:!0});M6("column",{useDeprecatedLogic:!0});const CAt=M6("cell",{useDeprecatedLogic:!0});function kAt(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const s=t.node(-1).child(n),a=s.lastChild;if(a)return i-1-a.nodeSize;i-=s.nodeSize}}else{if(t.index()0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function GA(t,e){const r=t.selection;if(!(r instanceof zi))return!1;if(e){const n=t.tr,i=Wo(t.schema).cell.createAndFill().content;r.forEachCell((s,a)=>{s.content.eq(i)||n.replace(n.mapping.map(a+1),n.mapping.map(a+s.nodeSize-1),new Jt(i,0,0))}),n.docChanged&&e(n)}return!0}function EAt(t){if(t.size===0)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,a=i.type.schema,o=[];if(s=="row")for(let l=0;l=0;a--){const{rowspan:o,colspan:l}=s.child(a).attrs;for(let u=i;u=e.length&&e.push(Mt.empty),r[i]n&&(f=f.type.createChecked(Ry(f.attrs,f.attrs.colspan,h+f.attrs.colspan-n),f.content)),u.push(f),h+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}s.push(Mt.from(l))}r=s,e=i}return{width:t,height:e,rows:r}}function RAt(t,e,r,n,i,s,a){const o=t.doc.type.schema,l=Wo(o);let u,h;if(i>e.width)for(let d=0,f=0;de.height){const d=[];for(let g=0,m=(e.height-1)*e.width;g=e.width?!1:r.nodeAt(e.map[m+g]).type==l.header_cell;d.push(y?h||(h=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const f=l.row.create(null,Mt.from(d)),p=[];for(let g=e.height;g{if(!i)return!1;const s=r.selection;if(s instanceof zi)return FM(r,n,Xr.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=YEe(i,t,e);if(a==null)return!1;if(t=="horiz")return FM(r,n,Xr.near(r.doc.resolve(s.head+e),e));{const o=r.doc.resolve(a),l=zEe(o,t,e);let u;return l?u=Xr.near(l,1):e<0?u=Xr.near(r.doc.resolve(o.before(-1)),-1):u=Xr.near(r.doc.resolve(o.after(-1)),1),FM(r,n,u)}}}function qA(t,e){return(r,n,i)=>{if(!i)return!1;const s=r.selection;let a;if(s instanceof zi)a=s;else{const l=YEe(i,t,e);if(l==null)return!1;a=new zi(r.doc.resolve(l))}const o=zEe(a.$headCell,t,e);return o?FM(r,n,new zi(a.$anchorCell,o)):!1}}function LAt(t,e){const r=t.state.doc,n=My(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new zi(n))),!0):!1}function IAt(t,e,r){if(!Ph(t.state))return!1;let n=EAt(r);const i=t.state.selection;if(i instanceof zi){n||(n={width:1,height:1,rows:[Mt.from(XG(Wo(t.state.schema).cell,r))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=Ds.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return n=MAt(n,o.right-o.left,o.bottom-o.top),mue(t.state,t.dispatch,a,o,n),!0}else if(n){const s=yD(t.state),a=s.start(-1);return mue(t.state,t.dispatch,a,Ds.get(s.node(-1)).findCell(s.pos-a),n),!0}else return!1}function NAt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=yue(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof zi)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=My(t.state.selection.$anchor))!=null&&((r=uB(t,e))===null||r===void 0?void 0:r.pos)!=i.pos)s(i,e),e.preventDefault();else if(!n)return;function s(l,u){let h=uB(t,u);const d=Pp.getState(t.state)==null;if(!h||!jZ(l,h))if(d)h=l;else return;const f=new zi(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(Pp,l.pos),t.dispatch(p)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",o),Pp.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Pp,-1))}function o(l){const u=l,h=Pp.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(yue(t,u.target)!=n&&(d=uB(t,e),!d))return a();d&&s(d,u)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",o)}function YEe(t,e,r){if(!(t.state.selection instanceof wr))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const a=n.before(i),o=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(o)?a:null}}return null}function yue(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function uB(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return null;let{inside:n,pos:i}=r;return n>=0&&My(t.state.doc.resolve(n))||My(t.state.doc.resolve(i))}var DAt=class{constructor(e,r){this.node=e,this.defaultCellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${r}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),KG(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,KG(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function KG(t,e,r,n,i,s){let a=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;dnew n(d,r,f)),new PAt(-1,!1)},apply(a,o){return o.apply(a)}},props:{attributes:a=>{const o=Nc.getState(a);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,o)=>{$At(a,o,t,i)},mouseleave:a=>{BAt(a)},mousedown:(a,o)=>{FAt(a,o,e,r)}},decorations:a=>{const o=Nc.getState(a);if(o&&o.activeHandle>-1)return WAt(a,o.activeHandle)},nodeViews:{}}});return s}var PAt=class zM{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(Nc);if(n&&n.setHandle!=null)return new zM(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new zM(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return jG(e.doc.resolve(i))||(i=-1),new zM(i,r.dragging)}return r}};function $At(t,e,r,n){if(!t.editable)return;const i=Nc.getState(t.state);if(i&&!i.dragging){const s=VAt(e.target);let a=-1;if(s){const{left:o,right:l}=s.getBoundingClientRect();e.clientX-o<=r?a=vue(t,e,"left",r):l-e.clientX<=r&&(a=vue(t,e,"right",r))}if(a!=i.activeHandle){if(!n&&a!==-1){const o=t.state.doc.resolve(a),l=o.node(-1),u=Ds.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}jEe(t,a)}}}function BAt(t){if(!t.editable)return;const e=Nc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&jEe(t,-1)}function FAt(t,e,r,n){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,a=Nc.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const o=t.state.doc.nodeAt(a.activeHandle),l=zAt(t,a.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(Nc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",h);const f=Nc.getState(t.state);f!=null&&f.dragging&&(HAt(t,f.activeHandle,bue(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(Nc,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=Nc.getState(t.state);if(f&&f.dragging){const p=bue(f.dragging,d,r);xue(t,f.activeHandle,p,n)}}return xue(t,a.activeHandle,l,n),s.addEventListener("mouseup",u),s.addEventListener("mousemove",h),e.preventDefault(),!0}function zAt(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const s=t.domAtPos(e);let a=s.node.childNodes[s.offset].offsetWidth,o=r;if(n)for(let l=0;lUAt(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function jAt(t){var e;const r=t.parentElement,n=t.closest("table");if(!r||!n)return null;const i=Array.from(r.children).indexOf(t),s=(e=n.querySelectorAll("colgroup > col")[i])===null||e===void 0?void 0:e.getAttribute("width");return s?[parseInt(s,10)]:null}function KEe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):jAt(t)}const XAt=/[ \t\r\n\f]+/g;function ZEe(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(XAt,"")===""}function QEe(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const KAt=Zn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:KEe},align:XEe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>ZEe(t)?{}:!1,getContent:(t,e)=>QEe(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",xn(this.options.HTMLAttributes,t),0]}}),ZAt=Zn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:KEe},align:XEe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>ZEe(t)?{}:!1,getContent:(t,e)=>QEe(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",xn(this.options.HTMLAttributes,t),0]}}),QAt=Zn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",xn(this.options.HTMLAttributes,t),0]}});function ZG(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function wue(t,e,r,n,i,s){let a=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u!==null)for(let f=0,p=0;f{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function r8t(t,e,r,n,i){const s=t8t(t),a=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!n8t(e))return!1;let r=0;const n=l6(e.ranges[0].$from,i=>i.type.name==="table");return n==null||n.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(r+=1)}),r!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Cue(t,e){const r=t.mapping.map(e),n=l6(t.selection.$from,a=>a.type.name==="table");if((n==null?void 0:n.pos)===r)return;const i=t.doc.nodeAt(r);if(!i)return;const s=r+i.nodeSize-1;t.setSelection(wr.near(t.doc.resolve(s),-1))}function i8t(t){let e="",r=0;for(;rl==="|"?"\\|":l)+t.slice(i,i+n),r=i+n,s=!0;break}i+=a}s||(e+=t.slice(r,r+n),r+=n)}return e}function s8t(t){return t.split(` +`).map(e=>!e.includes("|")||!e.includes("`")?e:i8t(e)).join(` +`)}function a8t(t){return(t||"").replace(/\s+/g," ").trim()}function o8t(t,e,r={}){var n;const i=(n=r.cellLineSeparator)!==null&&n!==void 0?n:"";if(!t||!t.content||t.content.length===0)return"";const s=[];t.content.forEach(g=>{const m=[];g.content&&g.content.forEach(y=>{let v="";y.content&&Array.isArray(y.content)&&y.content.length>1?v=y.content.map(C=>e.renderChildren(C)).join(i):v=y.content?e.renderChildren(y.content):"";const x=a8t(v.split(i).join(` +`).replace(/[ \t]*\r?\n[ \t]*/g,"
    ")),b=y.type==="tableHeader",T=YAt(y.attrs);m.push({text:x,isHeader:b,align:T})}),s.push(m)});const a=s.reduce((g,m)=>Math.max(g,m.length),0);if(a===0)return"";const o=Array.from({length:a}).fill(0);s.forEach(g=>{for(let y=0;yo[y]&&(o[y]=v),o[y]<3&&(o[y]=3)}});const l=(g,m)=>g+" ".repeat(Math.max(0,m-g.length)),u=s[0],h=u.some(g=>g.isHeader),d=Array.from({length:a}).fill(null);s.forEach(g=>{for(let y=0;yh&&u[m]&&u[m].text||"");return f+=`| ${p.map((g,m)=>l(g,o[m])).join(" | ")} | `,f+=`| ${o.map((g,m)=>{const y=Math.max(3,g),v=d[m];return v==="left"?`:${"-".repeat(y)}`:v==="right"?`${"-".repeat(y)}:`:v==="center"?`:${"-".repeat(y)}:`:"-".repeat(y)}).join(" | ")} | `,(h?s.slice(1):s).forEach(g=>{f+=`| ${Array.from({length:a}).fill(0).map((m,y)=>l(g[y]&&g[y].text||"",o[y])).join(" | ")} | -`}),f}const r8t=Zn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:YAt,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:r,tableWidth:n,tableMinWidth:i}=jAt(t,this.options.cellMinWidth),s=e.style;function a(){return s||(n?`width: ${n}`:`min-width: ${i}`)}const o=["table",xn(this.options.HTMLAttributes,e,{style:a()}),r,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},o]:o},parseMarkdown:(t,e)=>{const r=[],n=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((s,a)=>{var o;const l=b_((o=n[a])!==null&&o!==void 0?o:s.align),u=l?{align:l}:{};i.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),r.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{const s=[];i.forEach((a,o)=>{var l;const u=b_((l=n[o])!==null&&l!==void 0?l:a.align),h=u?{align:u}:{};s.push(e.createNode("tableCell",h,[{type:"paragraph",content:e.parseInline(a.tokens)}]))}),r.push(e.createNode("tableRow",{},s))}),e.createNode("table",void 0,r)},renderMarkdown:(t,e)=>t8t(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(` +`}),f}const l8t=Zn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:JAt,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:r,tableWidth:n,tableMinWidth:i}=e8t(t,this.options.cellMinWidth),s=e.style;function a(){return s||(n?`width: ${n}`:`min-width: ${i}`)}const o=["table",xn(this.options.HTMLAttributes,e,{style:a()}),r,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},o]:o},parseMarkdown:(t,e)=>{const r=[],n=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((s,a)=>{var o;const l=C_((o=n[a])!==null&&o!==void 0?o:s.align),u=l?{align:l}:{};i.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),r.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{const s=[];i.forEach((a,o)=>{var l;const u=C_((l=n[o])!==null&&l!==void 0?l:a.align),h=u?{align:u}:{};s.push(e.createNode("tableCell",h,[{type:"paragraph",content:e.parseInline(a.tokens)}]))}),r.push(e.createNode("tableRow",{},s))}),e.createNode("table",void 0,r)},renderMarkdown:(t,e)=>o8t(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(` `);if(e.length<2)return-1;const r=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(r)||!r.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,r){const n=t.indexOf(` `),i=n>=0?t.slice(0,n):t,s=i.split(` -`);if(s.length<2)return;const a=s[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const o=JAt(i);if(o===i)return;const l=r.blockTokens(o)[0];if((l==null?void 0:l.type)!=="table"||!l.raw)return;const u=l.raw.split(` +`);if(s.length<2)return;const a=s[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const o=s8t(i);if(o===i)return;const l=r.blockTokens(o)[0];if((l==null?void 0:l.type)!=="table"||!l.raw)return;const u=l.raw.split(` `).length,h=t.split(` `).slice(0,u).join(` -`);return{...l,raw:h}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:s})=>{const a=KAt(s.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(a).scrollIntoView().setSelection(xr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>iAt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>sAt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=s6(t.selection.$from,n=>n.type.name==="table");return oAt(t,e&&(n=>{r&&bue(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>cAt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>uAt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=s6(t.selection.$from,n=>n.type.name==="table");return dAt(t,e&&(n=>{r&&bue(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>bAt(t,e),mergeCells:()=>({state:t,dispatch:e})=>aue(t,e),splitCell:()=>({state:t,dispatch:e})=>oue(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>S6("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>S6("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>yAt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>aue(t,e)?!0:oue(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>gAt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>cue(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>cue(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&BEe(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=zi.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:GA,"Mod-Backspace":GA,Delete:GA,"Mod-Delete":GA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[RAt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],FAt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:r,view:n,HTMLAttributes:i})=>{const s=xn(this.options.HTMLAttributes,i);return new e(r,this.options.cellMinWidth,n,s)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Qn(gr(t,"tableRole",e))}}}),xue=Wi.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(r8t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(WAt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(qAt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(UAt.configure(this.options.tableRow)),t}}),YEe=new WeakSet,jEe=new WeakSet;function Sm(t){const e=t;return YEe.add(e),e}function jG(t){return Array.isArray(t)&&YEe.has(t)}function XEe(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&jEe.has(e)&&!jG(e)?XEe(e):[e])}function n8t(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!jG(i)&&!jEe.has(i)?Sm(i):i}const{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(r)){if(jG(r))return Sm([t,n,r]);if(r.length===0)return Sm([t,n]);const i=XEe(r);return i.length===0?Sm([t,n]):Sm([t,n,...i])}return r!=null?Sm([t,n,r]):Sm([t,n])}const x_=(t,e)=>n8t(t,e),i8t=(t,e)=>{var r;const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const a=s.depth-1;if(a<0)return!1;const o=s.node(a),l=s.index(a);if(l===0)return!1;if(o.type===e)return t.commands.lift(e.name);const u=o.child(l-1);if(u.type!==e||!(!((r=u.lastChild)===null||r===void 0)&&r.isTextblock))return!1;const h=s.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const p=s.parent.content,g=new Jt(p,0,0);return d.replace(h,s.after(),g),d.setSelection(xr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},s8t=/^\s*>\s$/,a8t=Zn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return x_("blockquote",{...xn(this.options.HTMLAttributes,t),children:x_("slot",{})})},parseMarkdown:(t,e)=>{var r;const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const r=">",n=[];return t.content.forEach((i,s)=>{var a,o;const l=((a=(o=e.renderChild)===null||o===void 0?void 0:o.call(e,i,s))!==null&&a!==void 0?a:e.renderChildren([i])).split(` +`);return{...l,raw:h}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:s})=>{const a=r8t(s.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(a).scrollIntoView().setSelection(wr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>uAt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hAt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=l6(t.selection.$from,n=>n.type.name==="table");return fAt(t,e&&(n=>{r&&Cue(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>gAt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>mAt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=l6(t.selection.$from,n=>n.type.name==="table");return vAt(t,e&&(n=>{r&&Cue(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>SAt(t,e),mergeCells:()=>({state:t,dispatch:e})=>uue(t,e),splitCell:()=>({state:t,dispatch:e})=>hue(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>M6("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>M6("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>CAt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>uue(t,e)?!0:hue(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>wAt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>fue(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>fue(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&WEe(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=zi.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:UA,"Mod-Backspace":UA,Delete:UA,"Mod-Delete":UA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[OAt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],qAt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:r,view:n,HTMLAttributes:i})=>{const s=xn(this.options.HTMLAttributes,i);return new e(r,this.options.cellMinWidth,n,s)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Qn(gr(t,"tableRole",e))}}}),kue=Wi.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(l8t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(KAt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(ZAt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(QAt.configure(this.options.tableRow)),t}}),JEe=new WeakSet,e7e=new WeakSet;function Mm(t){const e=t;return JEe.add(e),e}function QG(t){return Array.isArray(t)&&JEe.has(t)}function t7e(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&e7e.has(e)&&!QG(e)?t7e(e):[e])}function c8t(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!QG(i)&&!e7e.has(i)?Mm(i):i}const{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(r)){if(QG(r))return Mm([t,n,r]);if(r.length===0)return Mm([t,n]);const i=t7e(r);return i.length===0?Mm([t,n]):Mm([t,n,...i])}return r!=null?Mm([t,n,r]):Mm([t,n])}const k_=(t,e)=>c8t(t,e),u8t=(t,e)=>{var r;const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const a=s.depth-1;if(a<0)return!1;const o=s.node(a),l=s.index(a);if(l===0)return!1;if(o.type===e)return t.commands.lift(e.name);const u=o.child(l-1);if(u.type!==e||!(!((r=u.lastChild)===null||r===void 0)&&r.isTextblock))return!1;const h=s.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const p=s.parent.content,g=new Jt(p,0,0);return d.replace(h,s.after(),g),d.setSelection(wr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},h8t=/^\s*>\s$/,d8t=Zn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return k_("blockquote",{...xn(this.options.HTMLAttributes,t),children:k_("slot",{})})},parseMarkdown:(t,e)=>{var r;const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const r=">",n=[];return t.content.forEach((i,s)=>{var a,o;const l=((a=(o=e.renderChild)===null||o===void 0?void 0:o.call(e,i,s))!==null&&a!==void 0?a:e.renderChildren([i])).split(` `).map(u=>u.trim()===""?r:`${r} ${u}`);n.push(l.join(` `))}),n.join(` ${r} -`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>i8t(this.editor,this.type)}},addInputRules(){return[QT({find:s8t,type:this.type})]}}),o8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,l8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,c8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,u8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,h8t=Yg.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return x_("strong",{...xn(this.options.HTMLAttributes,t),children:x_("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[py({find:o8t,type:this.type}),py({find:c8t,type:this.type})]},addPasteRules(){return[dg({find:l8t,type:this.type}),dg({find:u8t,type:this.type})]}}),d8t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},f8t=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},p8t=Yg.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[py({find:d8t,type:this.type})]},addPasteRules(){return[dg({find:f8t,type:this.type})]}}),g8t=Zn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>u8t(this.editor,this.type)}},addInputRules(){return[e5({find:h8t,type:this.type})]}}),f8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,p8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,g8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,m8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,y8t=Kg.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return k_("strong",{...xn(this.options.HTMLAttributes,t),children:k_("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[my({find:f8t,type:this.type}),my({find:g8t,type:this.type})]},addPasteRules(){return[gg({find:p8t,type:this.type}),gg({find:m8t,type:this.type})]}}),v8t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},b8t=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},x8t=Kg.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[my({find:v8t,type:this.type})]},addPasteRules(){return[gg({find:b8t,type:this.type})]}}),w8t=Zn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):""}),m8t=Zn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",xn(this.options.HTMLAttributes,t)]},renderText(){return` +`):""}),T8t=Zn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",xn(this.options.HTMLAttributes,t)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&a){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),y8t=Zn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,xn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=!((r=t.attrs)===null||r===void 0)&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>MH({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),v8t=Zn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!R0t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return mwe(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(xr.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(Nr.create(a.doc,l.pos)):a.setSelection(xr.create(a.doc,l.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(a.insert(u,d),a.setSelection(xr.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_we({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),b8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,x8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,w8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,T8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,C8t=Yg.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",xn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[py({find:b8t,type:this.type}),py({find:w8t,type:this.type})]},addPasteRules(){return[dg({find:x8t,type:this.type}),dg({find:T8t,type:this.type})]}}),k8t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",S8t="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",XG="numeric",KG="ascii",ZG="alpha",Qk="asciinumeric",KC="alphanumeric",QG="domain",KEe="emoji",E8t="scheme",A8t="slashscheme",lB="whitespace";function M8t(t,e){return t in e||(e[t]=[]),e[t]}function O1(t,e,r){e[XG]&&(e[Qk]=!0,e[KC]=!0),e[KG]&&(e[Qk]=!0,e[ZG]=!0),e[Qk]&&(e[KC]=!0),e[ZG]&&(e[KC]=!0),e[KC]&&(e[QG]=!0),e[KEe]&&(e[QG]=!0);for(const n in e){const i=M8t(n,r);i.indexOf(t)<0&&i.push(t)}}function R8t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function rc(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}rc.groups={};rc.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;nt.ta(e,r,n,i),Ms=(t,e,r,n,i)=>t.tr(e,r,n,i),wue=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),xf="WORD",JG="UWORD",ZEe="ASCIINUMERICAL",QEe="ALPHANUMERICAL",E6="LOCALHOST",eW="TLD",tW="UTLD",$M="SCHEME",k2="SLASH_SCHEME",qZ="NUM",rW="WS",UZ="NL",Jk="OPENBRACE",eS="CLOSEBRACE",w_="OPENBRACKET",T_="CLOSEBRACKET",C_="OPENPAREN",k_="CLOSEPAREN",S_="OPENANGLEBRACKET",E_="CLOSEANGLEBRACKET",A_="FULLWIDTHLEFTPAREN",M_="FULLWIDTHRIGHTPAREN",R_="LEFTCORNERBRACKET",__="RIGHTCORNERBRACKET",L_="LEFTWHITECORNERBRACKET",I_="RIGHTWHITECORNERBRACKET",N_="FULLWIDTHLESSTHAN",D_="FULLWIDTHGREATERTHAN",O_="AMPERSAND",P_="APOSTROPHE",$_="ASTERISK",wp="AT",B_="BACKSLASH",F_="BACKTICK",z_="CARET",P1="COLON",YZ="COMMA",V_="DOLLAR",Xh="DOT",H_="EQUALS",jZ="EXCLAMATION",su="HYPHEN",tS="PERCENT",G_="PIPE",W_="PLUS",q_="POUND",rS="QUERY",XZ="QUOTE",JEe="FULLWIDTHMIDDLEDOT",KZ="SEMI",Kh="SLASH",nS="TILDE",U_="UNDERSCORE",e7e="EMOJI",Y_="SYM";var t7e=Object.freeze({__proto__:null,ALPHANUMERICAL:QEe,AMPERSAND:O_,APOSTROPHE:P_,ASCIINUMERICAL:ZEe,ASTERISK:$_,AT:wp,BACKSLASH:B_,BACKTICK:F_,CARET:z_,CLOSEANGLEBRACKET:E_,CLOSEBRACE:eS,CLOSEBRACKET:T_,CLOSEPAREN:k_,COLON:P1,COMMA:YZ,DOLLAR:V_,DOT:Xh,EMOJI:e7e,EQUALS:H_,EXCLAMATION:jZ,FULLWIDTHGREATERTHAN:D_,FULLWIDTHLEFTPAREN:A_,FULLWIDTHLESSTHAN:N_,FULLWIDTHMIDDLEDOT:JEe,FULLWIDTHRIGHTPAREN:M_,HYPHEN:su,LEFTCORNERBRACKET:R_,LEFTWHITECORNERBRACKET:L_,LOCALHOST:E6,NL:UZ,NUM:qZ,OPENANGLEBRACKET:S_,OPENBRACE:Jk,OPENBRACKET:w_,OPENPAREN:C_,PERCENT:tS,PIPE:G_,PLUS:W_,POUND:q_,QUERY:rS,QUOTE:XZ,RIGHTCORNERBRACKET:__,RIGHTWHITECORNERBRACKET:I_,SCHEME:$M,SEMI:KZ,SLASH:Kh,SLASH_SCHEME:k2,SYM:Y_,TILDE:nS,TLD:eW,UNDERSCORE:U_,UTLD:tW,UWORD:JG,WORD:xf,WS:rW});const of=/[a-z]/,iC=new RegExp("\\p{L}","u"),cB=new RegExp("\\p{Emoji}","u"),lf=/\d/,uB=/\s/,Tue="\r",hB=` -`,_8t="️",L8t="‍",dB="";let WA=null,qA=null;function I8t(t=[]){const e={};rc.groups=e;const r=new rc;WA==null&&(WA=Cue(k8t)),qA==null&&(qA=Cue(S8t)),Wt(r,"'",P_),Wt(r,"{",Jk),Wt(r,"}",eS),Wt(r,"[",w_),Wt(r,"]",T_),Wt(r,"(",C_),Wt(r,")",k_),Wt(r,"<",S_),Wt(r,">",E_),Wt(r,"(",A_),Wt(r,")",M_),Wt(r,"「",R_),Wt(r,"」",__),Wt(r,"『",L_),Wt(r,"』",I_),Wt(r,"<",N_),Wt(r,">",D_),Wt(r,"&",O_),Wt(r,"*",$_),Wt(r,"@",wp),Wt(r,"`",F_),Wt(r,"^",z_),Wt(r,":",P1),Wt(r,",",YZ),Wt(r,"$",V_),Wt(r,".",Xh),Wt(r,"=",H_),Wt(r,"!",jZ),Wt(r,"-",su),Wt(r,"%",tS),Wt(r,"|",G_),Wt(r,"+",W_),Wt(r,"#",q_),Wt(r,"?",rS),Wt(r,'"',XZ),Wt(r,"/",Kh),Wt(r,";",KZ),Wt(r,"~",nS),Wt(r,"_",U_),Wt(r,"\\",B_),Wt(r,"・",JEe);const n=Ms(r,lf,qZ,{[XG]:!0});Ms(n,lf,n);const i=Ms(n,of,ZEe,{[Qk]:!0}),s=Ms(n,iC,QEe,{[KC]:!0}),a=Ms(r,of,xf,{[KG]:!0});Ms(a,lf,i),Ms(a,of,a),Ms(i,lf,i),Ms(i,of,i);const o=Ms(r,iC,JG,{[ZG]:!0});Ms(o,of),Ms(o,lf,s),Ms(o,iC,o),Ms(s,lf,s),Ms(s,of),Ms(s,iC,s);const l=Wt(r,hB,UZ,{[lB]:!0}),u=Wt(r,Tue,rW,{[lB]:!0}),h=Ms(r,uB,rW,{[lB]:!0});Wt(r,dB,h),Wt(u,hB,l),Wt(u,dB,h),Ms(u,uB,h),Wt(h,Tue),Wt(h,hB),Ms(h,uB,h),Wt(h,dB,h);const d=Ms(r,cB,e7e,{[KEe]:!0});Wt(d,"#"),Ms(d,cB,d),Wt(d,_8t,d);const f=Wt(d,L8t);Wt(f,"#"),Ms(f,cB,d);const p=[[of,a],[lf,i]],g=[[of,null],[iC,o],[lf,s]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?x[QG]=!0:of.test(y)?lf.test(y)?x[Qk]=!0:x[KG]=!0:x[XG]=!0,wue(r,y,y,x)}return wue(r,"localhost",E6,{ascii:!0}),r.jd=new rc(Y_),{start:r,tokens:Object.assign({groups:e},t7e)}}function r7e(t,e){const r=N8t(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let s=0,a=0;for(;a=0&&(d+=r[a].length,f++),u+=r[a].length,s+=r[a].length,a++;s-=d,a-=f,u-=d,i.push({t:h.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function N8t(t){const e=[],r=t.length;let n=0;for(;n56319||n+1===r||(s=t.charCodeAt(n+1))<56320||s>57343?t[n]:t.slice(n,n+2);e.push(a),n+=a.length}return e}function sp(t,e,r,n,i){let s;const a=e.length;for(let o=0;o=0;)s++;if(s>0){e.push(r.join(""));for(let a=parseInt(t.substring(n,n+s),10);a>0;a--)r.pop();n+=s}else r.push(t[n]),n++}return e}const A6={defaultProtocol:"http",events:null,format:kue,formatHref:kue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ZZ(t,e=null){let r=Object.assign({},A6);t&&(r=Object.assign(r,t instanceof ZZ?t.o:t));const n=r.ignoreTags,i=[];for(let s=0;sr?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=A6.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),s=this.toFormattedString(t),a={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return a.href=n,o&&(a.class=o),l&&(a.target=l),u&&(a.rel=u),h&&Object.assign(a,h),{tagName:i,attributes:a,content:s,eventListeners:d}}};function gD(t,e){class r extends n7e{constructor(i,s){super(i,s),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const D8t=gD("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Sue=gD("text"),O8t=gD("nl"),UA=gD("url",{isLink:!0,toHref(t=A6.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==E6&&t[1].t===P1}}),eu=t=>new rc(t);function P8t({groups:t}){const e=t.domain.concat([O_,$_,wp,B_,F_,z_,V_,H_,su,qZ,tS,G_,W_,q_,Kh,Y_,nS,U_]),r=[P_,P1,YZ,Xh,jZ,tS,rS,XZ,KZ,S_,E_,Jk,eS,T_,w_,C_,k_,A_,M_,R_,__,L_,I_,N_,D_],n=[O_,P_,$_,B_,F_,z_,V_,H_,su,Jk,eS,tS,G_,W_,q_,rS,Kh,Y_,nS,U_],i=eu(),s=Wt(i,nS);Tn(s,n,s),Tn(s,t.domain,s);const a=eu(),o=eu(),l=eu();Tn(i,t.domain,a),Tn(i,t.scheme,o),Tn(i,t.slashscheme,l),Tn(a,n,s),Tn(a,t.domain,a);const u=Wt(a,wp);Wt(s,wp,u),Wt(o,wp,u),Wt(l,wp,u);const h=Wt(s,Xh);Tn(h,n,s),Tn(h,t.domain,s);const d=eu();Tn(u,t.domain,d),Tn(d,t.domain,d);const f=Wt(d,Xh);Tn(f,t.domain,d);const p=eu(D8t);Tn(f,t.tld,p),Tn(f,t.utld,p),Wt(u,E6,p);const g=Wt(d,su);Wt(g,su,g),Tn(g,t.domain,d),Tn(p,t.domain,d),Wt(p,Xh,f),Wt(p,su,g);const m=Wt(a,su),y=Wt(a,Xh);Wt(m,su,m),Tn(m,t.domain,a),Tn(y,n,s),Tn(y,t.domain,a);const v=eu(UA);Tn(y,t.tld,v),Tn(y,t.utld,v),Tn(v,t.domain,a),Tn(v,n,s),Wt(v,Xh,y),Wt(v,su,m),Wt(v,wp,u);const x=Wt(v,P1),b=eu(UA);Tn(x,t.numeric,b);const T=eu(UA),C=eu();Tn(T,e,T),Tn(T,r,C),Tn(C,e,T),Tn(C,r,C),Wt(v,Kh,T),Wt(b,Kh,T);const S=Wt(o,P1),k=Wt(l,P1),E=Wt(k,Kh),A=Wt(E,Kh);Tn(o,t.domain,a),Wt(o,Xh,y),Wt(o,su,m),Tn(l,t.domain,a),Wt(l,Xh,y),Wt(l,su,m),Tn(S,t.domain,T),Wt(S,Kh,T),Wt(S,rS,T),Tn(A,t.domain,T),Tn(A,e,T),Wt(A,Kh,T);const R=[[Jk,eS],[w_,T_],[C_,k_],[S_,E_],[A_,M_],[R_,__],[L_,I_],[N_,D_]];for(let _=0;_=0&&f++,i++,h++;if(f<0)i-=h,i0&&(s.push(fB(Sue,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(fB(p,e,g))}}return a.length>0&&s.push(fB(Sue,e,a)),s}function fB(t,e,r){const n=r[0].s,i=r[r.length-1].e,s=e.slice(n,i);return new t(s,r)}const B8t=typeof console<"u"&&console&&console.warn||(()=>{}),F8t="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Xi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function z8t(){return rc.groups={},Xi.scanner=null,Xi.parser=null,Xi.tokenQueue=[],Xi.pluginQueue=[],Xi.customSchemes=[],Xi.initialized=!1,Xi}function Eue(t,e=!1){if(Xi.initialized&&B8t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${F8t}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&a){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),C8t=Zn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,xn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=!((r=t.attrs)===null||r===void 0)&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>IH({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),k8t=Zn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!O0t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return Twe(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(wr.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(Nr.create(a.doc,l.pos)):a.setSelection(wr.create(a.doc,l.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(a.insert(u,d),a.setSelection(wr.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Pwe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),S8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,E8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,A8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,M8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,R8t=Kg.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",xn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[my({find:S8t,type:this.type}),my({find:A8t,type:this.type})]},addPasteRules(){return[gg({find:E8t,type:this.type}),gg({find:M8t,type:this.type})]}}),_8t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",L8t="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",JG="numeric",eW="ascii",tW="alpha",tS="asciinumeric",JC="alphanumeric",rW="domain",r7e="emoji",I8t="scheme",N8t="slashscheme",hB="whitespace";function D8t(t,e){return t in e||(e[t]=[]),e[t]}function $1(t,e,r){e[JG]&&(e[tS]=!0,e[JC]=!0),e[eW]&&(e[tS]=!0,e[tW]=!0),e[tS]&&(e[JC]=!0),e[tW]&&(e[JC]=!0),e[JC]&&(e[rW]=!0),e[r7e]&&(e[rW]=!0);for(const n in e){const i=D8t(n,r);i.indexOf(t)<0&&i.push(t)}}function O8t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function sc(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}sc.groups={};sc.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;nt.ta(e,r,n,i),Ms=(t,e,r,n,i)=>t.tr(e,r,n,i),Sue=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),Cf="WORD",nW="UWORD",n7e="ASCIINUMERICAL",i7e="ALPHANUMERICAL",R6="LOCALHOST",iW="TLD",sW="UTLD",VM="SCHEME",E2="SLASH_SCHEME",XZ="NUM",aW="WS",KZ="NL",rS="OPENBRACE",nS="CLOSEBRACE",S_="OPENBRACKET",E_="CLOSEBRACKET",A_="OPENPAREN",M_="CLOSEPAREN",R_="OPENANGLEBRACKET",__="CLOSEANGLEBRACKET",L_="FULLWIDTHLEFTPAREN",I_="FULLWIDTHRIGHTPAREN",N_="LEFTCORNERBRACKET",D_="RIGHTCORNERBRACKET",O_="LEFTWHITECORNERBRACKET",P_="RIGHTWHITECORNERBRACKET",$_="FULLWIDTHLESSTHAN",B_="FULLWIDTHGREATERTHAN",F_="AMPERSAND",z_="APOSTROPHE",V_="ASTERISK",Sp="AT",H_="BACKSLASH",G_="BACKTICK",W_="CARET",B1="COLON",ZZ="COMMA",q_="DOLLAR",Qh="DOT",U_="EQUALS",QZ="EXCLAMATION",lu="HYPHEN",iS="PERCENT",Y_="PIPE",j_="PLUS",X_="POUND",sS="QUERY",JZ="QUOTE",s7e="FULLWIDTHMIDDLEDOT",eQ="SEMI",Jh="SLASH",aS="TILDE",K_="UNDERSCORE",a7e="EMOJI",Z_="SYM";var o7e=Object.freeze({__proto__:null,ALPHANUMERICAL:i7e,AMPERSAND:F_,APOSTROPHE:z_,ASCIINUMERICAL:n7e,ASTERISK:V_,AT:Sp,BACKSLASH:H_,BACKTICK:G_,CARET:W_,CLOSEANGLEBRACKET:__,CLOSEBRACE:nS,CLOSEBRACKET:E_,CLOSEPAREN:M_,COLON:B1,COMMA:ZZ,DOLLAR:q_,DOT:Qh,EMOJI:a7e,EQUALS:U_,EXCLAMATION:QZ,FULLWIDTHGREATERTHAN:B_,FULLWIDTHLEFTPAREN:L_,FULLWIDTHLESSTHAN:$_,FULLWIDTHMIDDLEDOT:s7e,FULLWIDTHRIGHTPAREN:I_,HYPHEN:lu,LEFTCORNERBRACKET:N_,LEFTWHITECORNERBRACKET:O_,LOCALHOST:R6,NL:KZ,NUM:XZ,OPENANGLEBRACKET:R_,OPENBRACE:rS,OPENBRACKET:S_,OPENPAREN:A_,PERCENT:iS,PIPE:Y_,PLUS:j_,POUND:X_,QUERY:sS,QUOTE:JZ,RIGHTCORNERBRACKET:D_,RIGHTWHITECORNERBRACKET:P_,SCHEME:VM,SEMI:eQ,SLASH:Jh,SLASH_SCHEME:E2,SYM:Z_,TILDE:aS,TLD:iW,UNDERSCORE:K_,UTLD:sW,UWORD:nW,WORD:Cf,WS:aW});const uf=/[a-z]/,oC=new RegExp("\\p{L}","u"),dB=new RegExp("\\p{Emoji}","u"),hf=/\d/,fB=/\s/,Eue="\r",pB=` +`,P8t="️",$8t="‍",gB="";let YA=null,jA=null;function B8t(t=[]){const e={};sc.groups=e;const r=new sc;YA==null&&(YA=Aue(_8t)),jA==null&&(jA=Aue(L8t)),Wt(r,"'",z_),Wt(r,"{",rS),Wt(r,"}",nS),Wt(r,"[",S_),Wt(r,"]",E_),Wt(r,"(",A_),Wt(r,")",M_),Wt(r,"<",R_),Wt(r,">",__),Wt(r,"(",L_),Wt(r,")",I_),Wt(r,"「",N_),Wt(r,"」",D_),Wt(r,"『",O_),Wt(r,"』",P_),Wt(r,"<",$_),Wt(r,">",B_),Wt(r,"&",F_),Wt(r,"*",V_),Wt(r,"@",Sp),Wt(r,"`",G_),Wt(r,"^",W_),Wt(r,":",B1),Wt(r,",",ZZ),Wt(r,"$",q_),Wt(r,".",Qh),Wt(r,"=",U_),Wt(r,"!",QZ),Wt(r,"-",lu),Wt(r,"%",iS),Wt(r,"|",Y_),Wt(r,"+",j_),Wt(r,"#",X_),Wt(r,"?",sS),Wt(r,'"',JZ),Wt(r,"/",Jh),Wt(r,";",eQ),Wt(r,"~",aS),Wt(r,"_",K_),Wt(r,"\\",H_),Wt(r,"・",s7e);const n=Ms(r,hf,XZ,{[JG]:!0});Ms(n,hf,n);const i=Ms(n,uf,n7e,{[tS]:!0}),s=Ms(n,oC,i7e,{[JC]:!0}),a=Ms(r,uf,Cf,{[eW]:!0});Ms(a,hf,i),Ms(a,uf,a),Ms(i,hf,i),Ms(i,uf,i);const o=Ms(r,oC,nW,{[tW]:!0});Ms(o,uf),Ms(o,hf,s),Ms(o,oC,o),Ms(s,hf,s),Ms(s,uf),Ms(s,oC,s);const l=Wt(r,pB,KZ,{[hB]:!0}),u=Wt(r,Eue,aW,{[hB]:!0}),h=Ms(r,fB,aW,{[hB]:!0});Wt(r,gB,h),Wt(u,pB,l),Wt(u,gB,h),Ms(u,fB,h),Wt(h,Eue),Wt(h,pB),Ms(h,fB,h),Wt(h,gB,h);const d=Ms(r,dB,a7e,{[r7e]:!0});Wt(d,"#"),Ms(d,dB,d),Wt(d,P8t,d);const f=Wt(d,$8t);Wt(f,"#"),Ms(f,dB,d);const p=[[uf,a],[hf,i]],g=[[uf,null],[oC,o],[hf,s]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?x[rW]=!0:uf.test(y)?hf.test(y)?x[tS]=!0:x[eW]=!0:x[JG]=!0,Sue(r,y,y,x)}return Sue(r,"localhost",R6,{ascii:!0}),r.jd=new sc(Z_),{start:r,tokens:Object.assign({groups:e},o7e)}}function l7e(t,e){const r=F8t(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let s=0,a=0;for(;a=0&&(d+=r[a].length,f++),u+=r[a].length,s+=r[a].length,a++;s-=d,a-=f,u-=d,i.push({t:h.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function F8t(t){const e=[],r=t.length;let n=0;for(;n56319||n+1===r||(s=t.charCodeAt(n+1))<56320||s>57343?t[n]:t.slice(n,n+2);e.push(a),n+=a.length}return e}function cp(t,e,r,n,i){let s;const a=e.length;for(let o=0;o=0;)s++;if(s>0){e.push(r.join(""));for(let a=parseInt(t.substring(n,n+s),10);a>0;a--)r.pop();n+=s}else r.push(t[n]),n++}return e}const _6={defaultProtocol:"http",events:null,format:Mue,formatHref:Mue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function tQ(t,e=null){let r=Object.assign({},_6);t&&(r=Object.assign(r,t instanceof tQ?t.o:t));const n=r.ignoreTags,i=[];for(let s=0;sr?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=_6.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),s=this.toFormattedString(t),a={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return a.href=n,o&&(a.class=o),l&&(a.target=l),u&&(a.rel=u),h&&Object.assign(a,h),{tagName:i,attributes:a,content:s,eventListeners:d}}};function vD(t,e){class r extends c7e{constructor(i,s){super(i,s),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const z8t=vD("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Rue=vD("text"),V8t=vD("nl"),XA=vD("url",{isLink:!0,toHref(t=_6.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==R6&&t[1].t===B1}}),nu=t=>new sc(t);function H8t({groups:t}){const e=t.domain.concat([F_,V_,Sp,H_,G_,W_,q_,U_,lu,XZ,iS,Y_,j_,X_,Jh,Z_,aS,K_]),r=[z_,B1,ZZ,Qh,QZ,iS,sS,JZ,eQ,R_,__,rS,nS,E_,S_,A_,M_,L_,I_,N_,D_,O_,P_,$_,B_],n=[F_,z_,V_,H_,G_,W_,q_,U_,lu,rS,nS,iS,Y_,j_,X_,sS,Jh,Z_,aS,K_],i=nu(),s=Wt(i,aS);Tn(s,n,s),Tn(s,t.domain,s);const a=nu(),o=nu(),l=nu();Tn(i,t.domain,a),Tn(i,t.scheme,o),Tn(i,t.slashscheme,l),Tn(a,n,s),Tn(a,t.domain,a);const u=Wt(a,Sp);Wt(s,Sp,u),Wt(o,Sp,u),Wt(l,Sp,u);const h=Wt(s,Qh);Tn(h,n,s),Tn(h,t.domain,s);const d=nu();Tn(u,t.domain,d),Tn(d,t.domain,d);const f=Wt(d,Qh);Tn(f,t.domain,d);const p=nu(z8t);Tn(f,t.tld,p),Tn(f,t.utld,p),Wt(u,R6,p);const g=Wt(d,lu);Wt(g,lu,g),Tn(g,t.domain,d),Tn(p,t.domain,d),Wt(p,Qh,f),Wt(p,lu,g);const m=Wt(a,lu),y=Wt(a,Qh);Wt(m,lu,m),Tn(m,t.domain,a),Tn(y,n,s),Tn(y,t.domain,a);const v=nu(XA);Tn(y,t.tld,v),Tn(y,t.utld,v),Tn(v,t.domain,a),Tn(v,n,s),Wt(v,Qh,y),Wt(v,lu,m),Wt(v,Sp,u);const x=Wt(v,B1),b=nu(XA);Tn(x,t.numeric,b);const T=nu(XA),C=nu();Tn(T,e,T),Tn(T,r,C),Tn(C,e,T),Tn(C,r,C),Wt(v,Jh,T),Wt(b,Jh,T);const S=Wt(o,B1),k=Wt(l,B1),E=Wt(k,Jh),A=Wt(E,Jh);Tn(o,t.domain,a),Wt(o,Qh,y),Wt(o,lu,m),Tn(l,t.domain,a),Wt(l,Qh,y),Wt(l,lu,m),Tn(S,t.domain,T),Wt(S,Jh,T),Wt(S,sS,T),Tn(A,t.domain,T),Tn(A,e,T),Wt(A,Jh,T);const R=[[rS,nS],[S_,E_],[A_,M_],[R_,__],[L_,I_],[N_,D_],[O_,P_],[$_,B_]];for(let _=0;_=0&&f++,i++,h++;if(f<0)i-=h,i0&&(s.push(mB(Rue,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(mB(p,e,g))}}return a.length>0&&s.push(mB(Rue,e,a)),s}function mB(t,e,r){const n=r[0].s,i=r[r.length-1].e,s=e.slice(n,i);return new t(s,r)}const W8t=typeof console<"u"&&console&&console.warn||(()=>{}),q8t="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Xi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function U8t(){return sc.groups={},Xi.scanner=null,Xi.parser=null,Xi.tokenQueue=[],Xi.pluginQueue=[],Xi.customSchemes=[],Xi.initialized=!1,Xi}function _ue(t,e=!1){if(Xi.initialized&&W8t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${q8t}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);Xi.customSchemes.push([t,e])}function V8t(){Xi.scanner=I8t(Xi.customSchemes);for(let t=0;t{const i=e.some(l=>l.docChanged)&&!r.doc.eq(n.doc),s=e.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=n,o=lwe(r.doc,[...e]);if(NN(o).forEach(({newRange:l})=>{const u=Rft(n.doc,l,f=>f.isTextblock);let h,d;if(u.length>1)h=u[0],d=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const f=n.doc.textBetween(l.from,l.to," "," ");if(!G8t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(H8t).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],g=h.pos+d.lastIndexOf(p);if(!p)return!1;const m=QZ(p).map(y=>y.toObject(t.defaultProtocol));if(!q8t(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{hK(y.from,y.to,n.doc).some(v=>v.mark.type===t.type)||a.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function Y8t(t){return new ki({key:new us("handleClickLink"),props:{handleClick:(e,r,n)=>{if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{const l=n.target;if(!l)return!1;const u=t.editor.view.dom;i=l.closest("a"),i&&!u.contains(i)&&(i=null)}if(!i)return!1;let s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var a,o;const l=pwe(e.state,t.type.name),u=(a=i.href)!==null&&a!==void 0?a:l.href,h=(o=i.target)!==null&&o!==void 0?o:l.target;u&&(window.open(u,h),s=!0)}return s}}})}const j8t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,X8t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function s7e(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function K8t(t,e){let r=0,n=0;for(;n0}function a7e(t,e,r){var n,i;const[,s,a]=e;return(e.index?t[e.index-1]:void 0)==="!"||s7e(t,(n=e.index)!==null&&n!==void 0?n:0)||K8t(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&r(a)}function o7e(t){var e,r;const[n,i,s,,a,o,l]=t,u=(e=a??o)!==null&&e!==void 0?e:l;return{index:(r=t.index)!==null&&r!==void 0?r:0,text:n,replaceWith:i,data:{href:s,title:u||null,markdown:!0}}}function Z8t(t,e){return t.index{const n=j8t.exec(r);return!n||!a7e(r,n,t.isAllowedHref)?null:o7e(n)},type:t.type,getAttributes:l7e});return new qy({find:e.find,handler:r=>{const n=e.handler(r);return n!==null&&r.state.tr.steps.length&&r.state.tr.setMeta("preventAutolink",!0),n}})}function J8t(t){const e=dg({find:r=>{var n,i;const s=[];for(const o of r.matchAll(X8t))a7e(r,o,t.isAllowedHref)&&s.push(o7e(o));const a=((n=(i=t.findPlainUrls)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:[]).filter(o=>!s.some(l=>Z8t(l,o)));return[...s,...a]},type:t.type,getAttributes:l7e});return new Mwe({find:e.find,handler:r=>{var n;const i=e.handler(r);return i!==null&&r.state.tr.steps.length&&(!((n=r.match.data)===null||n===void 0)&&n.markdown)&&r.state.tr.setMeta("preventAutolink",!0),i}})}function eMt(t){return new ki({key:new us("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:a}=s,{empty:o}=a;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=i7e(l,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function cf(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(W8t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const c7e=Yg.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Eue(t);return}Eue(t.scheme,t.optionalSlashes)})},onDestroy(){z8t()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!cf(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),r=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||r&&!t.includes("@"))return!0;const n=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(n)||!/\./.test(n))}}},addAttributes(){var t,e,r;return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(r=this.options.HTMLAttributes.class)!==null&&r!==void 0?r:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!cf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!cf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",xn(this.options.HTMLAttributes,t),0]:["a",xn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var r,n,i,s;const a=(r=(n=t.attrs)===null||n===void 0?void 0:n.href)!==null&&r!==void 0?r:"",o=(i=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",l=e.renderChildren(t);return o?`[${l}](${a} "${o}")`:`[${l}](${a})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!cf(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!cf(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[Q8t({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!cf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const r=[];if(e){const{protocols:n,defaultProtocol:i}=this.options;i7e(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!cf(a,n),protocols:n,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&r.push({text:s.value,data:{href:s.href},index:s.start})})}return r};return this.options.markdownLinks?[J8t({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!cf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[dg({find:t,type:this.type,getAttributes:e=>{var r;return{href:(r=e.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(U8t({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!cf(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(Y8t({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(eMt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var tMt=c7e;const YA=" ",pB=" ",rMt=Zn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",xn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const r=t.tokens||[];if(r.length===1&&r[0].type==="image")return e.parseChildren([r[0]]);const n=e.parseInline(r);return r.length===1&&r[0].type==="text"&&(r[0].raw===YA||r[0].text===YA||r[0].raw===pB||r[0].text===pB)&&n.length===1&&n[0].type==="text"&&(n[0].text===YA||n[0].text===pB)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,n)},renderMarkdown:(t,e,r)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];if(n.length===0){var i,s;const a=Array.isArray(r==null||(i=r.previousNode)===null||i===void 0?void 0:i.content)?r.previousNode.content:[];return(r==null||(s=r.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&a.length===0?YA:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,iMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,sMt=Yg.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[py({find:nMt,type:this.type})]},addPasteRules(){return[dg({find:iMt,type:this.type})]}}),aMt=Zn.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),oMt=Yg.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",xn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,r){const n=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!n)return;const i=n[2].trim();return{type:"underline",raw:n[0],text:i,tokens:r.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),lMt=Wi.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(h8t.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(a8t.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(TEe.configure(this.options.bulletList)),this.options.code!==!1&&t.push(p8t.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(Wwe.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(g8t.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(Ppt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push($pt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(m8t.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(y8t.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(Qpt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(v8t.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(C8t.configure(this.options.italic)),this.options.listItem!==!1&&t.push(AEe.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(REe.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(c7e.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(LEe.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(rMt.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(sMt.configure(this.options.strike)),this.options.text!==!1&&t.push(aMt.configure(this.options.text)),this.options.underline!==!1){var n;t.push(oMt.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(Zpt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var gB=lMt;const j_=(t,e)=>{const r=e.view.domAtPos(t).node,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;return n?n.offsetParent!==null:!1},cMt=(t,e,r)=>{for(let n=t.depth;n>0;n-=1){const i=t.node(n),s=e(i),a=j_(t.start(n),r);if(s&&a)return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}},Aue=(t,e)=>{const{state:r,view:n,extensionManager:i}=t,{schema:s,selection:a}=r,{empty:o,$anchor:l}=a,u=!!i.extensions.find(y=>y.name==="gapCursor");if(!o||l.parent.type!==s.nodes.detailsSummary||!u||e==="right"&&l.parentOffset!==l.parent.nodeSize-2)return!1;const h=Wy(y=>y.type===s.nodes.details)(a);if(!h)return!1;const d=mM(h.node,y=>y.type===s.nodes.detailsContent);if(!d.length||j_(h.start+d[0].pos+1,t))return!1;const f=r.doc.resolve(h.pos+h.node.nodeSize),p=ss.findFrom(f,1,!1);if(!p)return!1;const{tr:g}=r,m=new ss(p);return g.setSelection(m),g.scrollIntoView(),n.dispatch(g),!0},uMt=Zn.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",xn(this.options.HTMLAttributes,t),0]},...fK({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:r,HTMLAttributes:n})=>{const i=document.createElement("div"),s=xn(this.options.HTMLAttributes,n,{"data-type":this.name});Object.entries(s).forEach(([h,d])=>i.setAttribute(h,d));const a=document.createElement("button");a.type="button";const o=h=>{this.options.renderToggleButton({element:a,...h})};i.append(a);const l=document.createElement("div");i.append(l);const u=h=>{const{setToValue:d,node:f=r}=h||{};if(d!==void 0)if(d){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);const p=i.classList.contains(this.options.openClassName);o({isOpen:p,node:f});const g=new Event("toggleDetailsContent"),m=l.querySelector(':scope > div[data-type="detailsContent"]');m==null||m.dispatchEvent(g)};return o({isOpen:!!r.attrs.open,node:r}),r.attrs.open&&setTimeout(()=>u()),a.addEventListener("click",()=>{if(u(),!this.options.persist){t.commands.focus(void 0,{scrollIntoView:!1});return}if(t.isEditable&&typeof e=="function"){const{from:h,to:d}=t.state.selection;t.chain().command(({tr:f})=>{const p=e();if(typeof p!="number")return!1;const g=f.doc.nodeAt(p);return(g==null?void 0:g.type)!==this.type?!1:(f.setNodeMarkup(p,void 0,{open:!g.attrs.open}),!0)}).setTextSelection({from:h,to:d}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:l,ignoreMutation(h){if(h.type==="selection")return!1;const d=h.target,f=i.contains(d);return a.contains(d)||!f||i===d},update:h=>h.type!==this.type?!1:(h.attrs.open!==void 0?u({setToValue:h.attrs.open,node:h}):o({isOpen:i.classList.contains(this.options.openClassName),node:h}),!0)}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var r;const{schema:n,selection:i}=t,{$from:s,$to:a}=i,o=s.blockRange(a);if(!o)return!1;const l=t.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;const u=((r=l.toJSON())===null||r===void 0?void 0:r.content)||[];return e().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:u}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{const{selection:r,schema:n}=t,i=Wy(m=>m.type===this.type)(r);if(!i)return!1;const s=mM(i.node,m=>m.type===n.nodes.detailsSummary),a=mM(i.node,m=>m.type===n.nodes.detailsContent);if(!s.length||!a.length)return!1;const o=s[0],l=a[0],u=i.pos,h=t.doc.resolve(u),d={from:u,to:u+i.node.nodeSize},f=l.node.content.toJSON()||[],p=h.parent.type.contentMatch.defaultType,g=[p==null?void 0:p.create(null,o.node.content).toJSON(),...f];return e().insertContentAt(d,g).setTextSelection(u+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{const{schema:t,selection:e}=this.editor.state,{empty:r,$anchor:n}=e;return!r||n.parent.type!==t.nodes.detailsSummary?!1:n.parentOffset!==0?this.editor.commands.command(({tr:i})=>{const s=n.pos-1,a=n.pos;return i.delete(s,a),!0}):this.editor.commands.unsetDetails()},Enter:({editor:t})=>{const{state:e,view:r}=t,{schema:n,selection:i}=e,{$head:s}=i;if(s.parent.type!==n.nodes.detailsSummary)return!1;const a=j_(s.after()+1,t),o=a?e.doc.nodeAt(s.after()):s.node(-2);if(!o)return!1;const l=a?0:s.indexAfter(-1),u=_N(o.contentMatchAt(l));if(!u||!o.canReplaceWith(l,l,u))return!1;const h=u.createAndFill();if(!h)return!1;const d=a?s.after()+1:s.after(-1),f=e.tr.replaceWith(d,d,h),p=f.doc.resolve(d),g=Xr.near(p,1);return f.setSelection(g),f.scrollIntoView(),r.dispatch(f),!0},ArrowRight:({editor:t})=>Aue(t,"right"),ArrowDown:({editor:t})=>Aue(t,"down")}},addProseMirrorPlugins(){return[new ki({key:new us("detailsSelection"),appendTransaction:(t,e,r)=>{const{editor:n,type:i}=this;if(n.view.composing||!t.some(d=>d.selectionSet)||!e.selection.empty||!r.selection.empty||!gwe(r,i.name))return;const{$from:s}=r.selection;if(j_(s.pos,n))return;const a=cMt(s,d=>d.type===i,n);if(!a)return;const o=mM(a.node,d=>d.type===r.schema.nodes.detailsSummary);if(!o.length)return;const l=o[0],u=(e.selection.from{const e=document.createElement("div"),r=xn(this.options.HTMLAttributes,t,{"data-type":this.name,hidden:"hidden"});return Object.entries(r).forEach(([n,i])=>e.setAttribute(n,i)),e.addEventListener("toggleDetailsContent",()=>{e.toggleAttribute("hidden")}),{dom:e,contentDOM:e,ignoreMutation(n){return n.type==="selection"?!1:!e.contains(n.target)||e===n.target},update:n=>n.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{state:e,view:r}=t,{selection:n}=e,{$from:i,empty:s}=n,a=Wy(A=>A.type===this.type)(n);if(!s||!a||!a.node.childCount)return!1;const o=i.index(a.depth),{childCount:l}=a.node;if(l!==o+1)return!1;const u=a.node.type.contentMatch.defaultType,h=u==null?void 0:u.createAndFill();if(!h)return!1;const d=e.doc.resolve(a.pos+1),f=l-1,p=a.node.child(f),g=d.posAtIndex(f,a.depth);if(!p.eq(h))return!1;const m=i.node(-3);if(!m)return!1;const y=i.indexAfter(-3),v=_N(m.contentMatchAt(y));if(!v||!m.canReplaceWith(y,y,v))return!1;const x=v.createAndFill();if(!x)return!1;const{tr:b}=e,T=i.after(-2);b.replaceWith(T,T,x);const C=b.doc.resolve(T),S=Xr.near(C,1);b.setSelection(S);const k=g,E=g+p.nodeSize;return b.delete(k,E),b.scrollIntoView(),r.dispatch(b),!0}}},...fK({nodeName:"detailsContent"})}),dMt=Zn.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",xn(this.options.HTMLAttributes,t),0]},...fK({nodeName:"detailsSummary",content:"inline"})}),eQ=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},fMt={aac:"audio/aac",aiff:"audio/aiff",ape:"audio/x-ape",flac:"audio/flac",m4a:"audio/mp4",mp3:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg",wav:"audio/wav",weba:"audio/webm",wma:"audio/x-ms-wma"},pMt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:fMt[eQ(e)]??null},gMt={m4v:"video/mp4",mov:"video/quicktime",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},tQ=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("video/")?r:gMt[eQ(e)]??null},J1=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=eQ(e);return r.startsWith("image/")?"image":pMt(r,e)?"audio":tQ(r,e)?"video":r==="application/pdf"||n==="pdf"?"pdf":r.includes("spreadsheet")||r.includes("excel")||["xls","xlsx","xlsm","ods","csv"].includes(n)?"spreadsheet":r.includes("word")||r.includes("wordprocessingml")||["doc","docx","odt","rtf"].includes(n)?"document":r.includes("presentation")||r.includes("powerpoint")||["ppt","pptx","odp","key"].includes(n)?"presentation":r.includes("zip")||r.includes("compressed")||r.includes("tar")||r.includes("rar")||r.includes("gzip")||["zip","rar","7z","tar","gz","bz2","xz"].includes(n)?"archive":r.includes("javascript")||r.includes("typescript")||r.includes("json")||r.includes("xml")||r.includes("yaml")||["js","jsx","ts","tsx","json","xml","yaml","yml","html","css","sh","py","java","go","rs"].includes(n)?"code":r.startsWith("text/")||["txt","md","log"].includes(n)?"text":"file"},mMt=/\/api\/v1\/resources\/([^/]+)\/blob(?:$|[?#])/,yMt=t=>{if(t.startsWith("edgeever-resource://"))try{const e=new URL(t);return decodeURIComponent(e.pathname.replace(/^\//,""))||null}catch{return null}try{const r=new URL(t,"http://edgeever.local").pathname.match(mMt);return r!=null&&r[1]?decodeURIComponent(r[1]):null}catch{return null}},rQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),vMt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",text:"TXT",file:"FILE"},yg=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},bMt=t=>{const e=yg(t);if(e===null)return null;const r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1),i=e/1024**n;return`${n===0?i.toFixed(0):i.toFixed(i>=10?1:2)} ${r[n]}`},xMt=(t,e)=>vMt[J1(t,e)],wMt=(t,e,r)=>[xMt(t,e),bMt(r)].filter(Boolean).join(" · "),zf="edgeeverFileAttachment",Mue=t=>t==="compact"?"compact":"inline",TMt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,CMt=/^\s*(?:附件[::]|Attachment:)\s*/i,kMt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,SMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),EMt=(t,e)=>{const r=rQ(t)||t||e;return J1(null,r)==="pdf"||J1(null,e)==="pdf"?!1:CMt.test(t)||kMt.test(e)||J1(null,r)!=="file"},AMt=Zn.create({name:zf,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-file-url")||"",renderHTML:t=>({"data-file-url":t.url||""})},label:{default:"Attachment",parseHTML:t=>t.getAttribute("data-file-label")||"Attachment",renderHTML:t=>({"data-file-label":t.label||"Attachment"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-file-name")||"",renderHTML:t=>({"data-file-name":t.filename||""})},mimeType:{default:"",parseHTML:t=>t.getAttribute("data-file-mime-type")||"",renderHTML:t=>({"data-file-mime-type":t.mimeType||""})},byteSize:{default:null,parseHTML:t=>yg(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=yg(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}},displayMode:{default:"inline",parseHTML:t=>Mue(t.getAttribute("data-file-display-mode")),renderHTML:t=>{const e=Mue(t.displayMode);return e==="compact"?{"data-file-display-mode":e}:{}}}}},parseHTML(){return[{tag:'span[data-type="edgeever-file-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"edgeever-file-attachment",class:"edgeever-file-attachment"})]},parseMarkdown:t=>{const e=t.label||"Attachment";return{type:zf,attrs:{url:t.url||"",label:e,filename:rQ(e),mimeType:"",byteSize:null,displayMode:"inline"}}},renderMarkdown:t=>{var e,r;return`[${SMt(String(((e=t.attrs)==null?void 0:e.label)||"Attachment"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:zf,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=TMt.exec(t);if(!(!e||!EMt(e[1],e[2])))return{type:zf,raw:e[0],label:e[1],url:e[2]}}}}),MMt=25,RMt=100,_Mt=[{id:"small",width:35,labelKey:"editor.imageSizeSmall"},{id:"medium",width:50,labelKey:"editor.imageSizeMedium"},{id:"large",width:72,labelKey:"editor.imageSizeLarge"},{id:"full",width:100,labelKey:"editor.imageSizeFull"}],Rue=_Mt[0].width,_ue=t=>Math.min(RMt,Math.max(MMt,Math.round(t))),u7e=t=>{if(typeof t=="number"&&Number.isFinite(t))return _ue(t);if(typeof t!="string")return null;const e=/(\d+(?:\.\d+)?)/.exec(t);return e?_ue(Number(e[1])):null},nW="details",h7e="detailsSummary",d7e="detailsContent",LMt=/^]*)>/i,IMt=/^\s*]*>([\s\S]*?)<\/summary\s*>\s*/i,NMt=/^\s*]*data-type=["']detailsContent["'][^>]*>([\s\S]*)<\/div>\s*$/i,f7e=t=>t?typeof t.text=="string"?t.text:Array.isArray(t.content)?t.content.map(e=>f7e(e)).join(""):"":"",nQ=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),p7e=t=>t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),DMt=t=>p7e(t.replace(/<[^>]+>/g,"")).trim(),OMt=(t,e)=>{const r=new RegExp(`^<${e}\\b([^>]*)>`,"i").exec(t);if(!r)return null;const n=r[0];let i=1,s=n.length;const a=new RegExp(`<${e}\\b`,"ig"),o=new RegExp(``,"ig");for(;s0;){a.lastIndex=s,o.lastIndex=s;const l=a.exec(t),u=o.exec(t);if(!u)return null;if(l&&l.index{const e=NMt.exec(t.trim());return e?e[1]:t},$Mt=t=>new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"),sC=(t,e)=>{const r=$Mt(e).exec(t);return p7e(((r==null?void 0:r[1])??(r==null?void 0:r[2])??(r==null?void 0:r[3])??"").trim())},BMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),g7e=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t)||yMt(t))return!1;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},FMt=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t))return!1;if(t.startsWith("edgeever-resource://")||t.startsWith("edgeever-staged://")||t.startsWith("/")&&!t.startsWith("//"))return!0;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},zMt=t=>{const e=t.trim();return/^\d+(?:\.\d+)?%$/.test(e)?u7e(e):null},m7e=t=>{const e=t.trim();if(!g7e(e))return null;let r="";try{r=decodeURIComponent(new URL(e).pathname.split("/").filter(Boolean).pop()||"").trim()}catch{r=""}(!r||r.length>120||/[\\/\[\]()<>]/.test(r))&&(r="");const n=r||"video";return{src:e,label:`附件:${n}`,filename:n,mimeType:tQ(null,n)??"video/mp4"}},Lue=(t,e,r)=>t.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/g).map(n=>n.startsWith("```")||n.startsWith("~~~")?n:(e.lastIndex=0,n.replace(e,r))).join(""),VMt=t=>{const e=[],r=[],n=Lue(t,/]*)>([\s\S]*?)<\/video\s*>|]*)\/>/gi,(s,a,o,l)=>{const u=m7e(sC(a||l||"","src"));return u?(r.push(u.src),` +3. "-" cannot repeat`);Xi.customSchemes.push([t,e])}function Y8t(){Xi.scanner=B8t(Xi.customSchemes);for(let t=0;t{const i=e.some(l=>l.docChanged)&&!r.doc.eq(n.doc),s=e.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=n,o=pwe(r.doc,[...e]);if(PN(o).forEach(({newRange:l})=>{const u=Oft(n.doc,l,f=>f.isTextblock);let h,d;if(u.length>1)h=u[0],d=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const f=n.doc.textBetween(l.from,l.to," "," ");if(!X8t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(j8t).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],g=h.pos+d.lastIndexOf(p);if(!p)return!1;const m=rQ(p).map(y=>y.toObject(t.defaultProtocol));if(!Z8t(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{gK(y.from,y.to,n.doc).some(v=>v.mark.type===t.type)||a.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function J8t(t){return new ki({key:new us("handleClickLink"),props:{handleClick:(e,r,n)=>{if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{const l=n.target;if(!l)return!1;const u=t.editor.view.dom;i=l.closest("a"),i&&!u.contains(i)&&(i=null)}if(!i)return!1;let s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var a,o;const l=xwe(e.state,t.type.name),u=(a=i.href)!==null&&a!==void 0?a:l.href,h=(o=i.target)!==null&&o!==void 0?o:l.target;u&&(window.open(u,h),s=!0)}return s}}})}const eMt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,tMt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function h7e(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function rMt(t,e){let r=0,n=0;for(;n0}function d7e(t,e,r){var n,i;const[,s,a]=e;return(e.index?t[e.index-1]:void 0)==="!"||h7e(t,(n=e.index)!==null&&n!==void 0?n:0)||rMt(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&r(a)}function f7e(t){var e,r;const[n,i,s,,a,o,l]=t,u=(e=a??o)!==null&&e!==void 0?e:l;return{index:(r=t.index)!==null&&r!==void 0?r:0,text:n,replaceWith:i,data:{href:s,title:u||null,markdown:!0}}}function nMt(t,e){return t.index{const n=eMt.exec(r);return!n||!d7e(r,n,t.isAllowedHref)?null:f7e(n)},type:t.type,getAttributes:p7e});return new Yy({find:e.find,handler:r=>{const n=e.handler(r);return n!==null&&r.state.tr.steps.length&&r.state.tr.setMeta("preventAutolink",!0),n}})}function sMt(t){const e=gg({find:r=>{var n,i;const s=[];for(const o of r.matchAll(tMt))d7e(r,o,t.isAllowedHref)&&s.push(f7e(o));const a=((n=(i=t.findPlainUrls)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:[]).filter(o=>!s.some(l=>nMt(l,o)));return[...s,...a]},type:t.type,getAttributes:p7e});return new Dwe({find:e.find,handler:r=>{var n;const i=e.handler(r);return i!==null&&r.state.tr.steps.length&&(!((n=r.match.data)===null||n===void 0)&&n.markdown)&&r.state.tr.setMeta("preventAutolink",!0),i}})}function aMt(t){return new ki({key:new us("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:a}=s,{empty:o}=a;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=u7e(l,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function df(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(K8t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const g7e=Kg.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){_ue(t);return}_ue(t.scheme,t.optionalSlashes)})},onDestroy(){U8t()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!df(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),r=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||r&&!t.includes("@"))return!0;const n=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(n)||!/\./.test(n))}}},addAttributes(){var t,e,r;return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(r=this.options.HTMLAttributes.class)!==null&&r!==void 0?r:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!df(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!df(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",xn(this.options.HTMLAttributes,t),0]:["a",xn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var r,n,i,s;const a=(r=(n=t.attrs)===null||n===void 0?void 0:n.href)!==null&&r!==void 0?r:"",o=(i=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",l=e.renderChildren(t);return o?`[${l}](${a} "${o}")`:`[${l}](${a})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!df(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!df(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[iMt({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!df(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const r=[];if(e){const{protocols:n,defaultProtocol:i}=this.options;u7e(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!df(a,n),protocols:n,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&r.push({text:s.value,data:{href:s.href},index:s.start})})}return r};return this.options.markdownLinks?[sMt({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!df(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[gg({find:t,type:this.type,getAttributes:e=>{var r;return{href:(r=e.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(Q8t({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!df(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(J8t({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(aMt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var oMt=g7e;const KA=" ",yB=" ",lMt=Zn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",xn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const r=t.tokens||[];if(r.length===1&&r[0].type==="image")return e.parseChildren([r[0]]);const n=e.parseInline(r);return r.length===1&&r[0].type==="text"&&(r[0].raw===KA||r[0].text===KA||r[0].raw===yB||r[0].text===yB)&&n.length===1&&n[0].type==="text"&&(n[0].text===KA||n[0].text===yB)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,n)},renderMarkdown:(t,e,r)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];if(n.length===0){var i,s;const a=Array.isArray(r==null||(i=r.previousNode)===null||i===void 0?void 0:i.content)?r.previousNode.content:[];return(r==null||(s=r.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&a.length===0?KA:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),cMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,uMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,hMt=Kg.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[my({find:cMt,type:this.type})]},addPasteRules(){return[gg({find:uMt,type:this.type})]}}),dMt=Zn.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),fMt=Kg.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",xn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,r){const n=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!n)return;const i=n[2].trim();return{type:"underline",raw:n[0],text:i,tokens:r.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),pMt=Wi.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(y8t.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(d8t.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(MEe.configure(this.options.bulletList)),this.options.code!==!1&&t.push(x8t.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(Kwe.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(w8t.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(Hpt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(Gpt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(T8t.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(C8t.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(igt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(k8t.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(R8t.configure(this.options.italic)),this.options.listItem!==!1&&t.push(NEe.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(OEe.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(g7e.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push($Ee.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(lMt.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(hMt.configure(this.options.strike)),this.options.text!==!1&&t.push(dMt.configure(this.options.text)),this.options.underline!==!1){var n;t.push(fMt.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(ngt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var vB=pMt;const Q_=(t,e)=>{const r=e.view.domAtPos(t).node,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;return n?n.offsetParent!==null:!1},gMt=(t,e,r)=>{for(let n=t.depth;n>0;n-=1){const i=t.node(n),s=e(i),a=Q_(t.start(n),r);if(s&&a)return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}},Lue=(t,e)=>{const{state:r,view:n,extensionManager:i}=t,{schema:s,selection:a}=r,{empty:o,$anchor:l}=a,u=!!i.extensions.find(y=>y.name==="gapCursor");if(!o||l.parent.type!==s.nodes.detailsSummary||!u||e==="right"&&l.parentOffset!==l.parent.nodeSize-2)return!1;const h=Uy(y=>y.type===s.nodes.details)(a);if(!h)return!1;const d=xM(h.node,y=>y.type===s.nodes.detailsContent);if(!d.length||Q_(h.start+d[0].pos+1,t))return!1;const f=r.doc.resolve(h.pos+h.node.nodeSize),p=ss.findFrom(f,1,!1);if(!p)return!1;const{tr:g}=r,m=new ss(p);return g.setSelection(m),g.scrollIntoView(),n.dispatch(g),!0},mMt=Zn.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",xn(this.options.HTMLAttributes,t),0]},...yK({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:r,HTMLAttributes:n})=>{const i=document.createElement("div"),s=xn(this.options.HTMLAttributes,n,{"data-type":this.name});Object.entries(s).forEach(([h,d])=>i.setAttribute(h,d));const a=document.createElement("button");a.type="button";const o=h=>{this.options.renderToggleButton({element:a,...h})};i.append(a);const l=document.createElement("div");i.append(l);const u=h=>{const{setToValue:d,node:f=r}=h||{};if(d!==void 0)if(d){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);const p=i.classList.contains(this.options.openClassName);o({isOpen:p,node:f});const g=new Event("toggleDetailsContent"),m=l.querySelector(':scope > div[data-type="detailsContent"]');m==null||m.dispatchEvent(g)};return o({isOpen:!!r.attrs.open,node:r}),r.attrs.open&&setTimeout(()=>u()),a.addEventListener("click",()=>{if(u(),!this.options.persist){t.commands.focus(void 0,{scrollIntoView:!1});return}if(t.isEditable&&typeof e=="function"){const{from:h,to:d}=t.state.selection;t.chain().command(({tr:f})=>{const p=e();if(typeof p!="number")return!1;const g=f.doc.nodeAt(p);return(g==null?void 0:g.type)!==this.type?!1:(f.setNodeMarkup(p,void 0,{open:!g.attrs.open}),!0)}).setTextSelection({from:h,to:d}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:l,ignoreMutation(h){if(h.type==="selection")return!1;const d=h.target,f=i.contains(d);return a.contains(d)||!f||i===d},update:h=>h.type!==this.type?!1:(h.attrs.open!==void 0?u({setToValue:h.attrs.open,node:h}):o({isOpen:i.classList.contains(this.options.openClassName),node:h}),!0)}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var r;const{schema:n,selection:i}=t,{$from:s,$to:a}=i,o=s.blockRange(a);if(!o)return!1;const l=t.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;const u=((r=l.toJSON())===null||r===void 0?void 0:r.content)||[];return e().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:u}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{const{selection:r,schema:n}=t,i=Uy(m=>m.type===this.type)(r);if(!i)return!1;const s=xM(i.node,m=>m.type===n.nodes.detailsSummary),a=xM(i.node,m=>m.type===n.nodes.detailsContent);if(!s.length||!a.length)return!1;const o=s[0],l=a[0],u=i.pos,h=t.doc.resolve(u),d={from:u,to:u+i.node.nodeSize},f=l.node.content.toJSON()||[],p=h.parent.type.contentMatch.defaultType,g=[p==null?void 0:p.create(null,o.node.content).toJSON(),...f];return e().insertContentAt(d,g).setTextSelection(u+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{const{schema:t,selection:e}=this.editor.state,{empty:r,$anchor:n}=e;return!r||n.parent.type!==t.nodes.detailsSummary?!1:n.parentOffset!==0?this.editor.commands.command(({tr:i})=>{const s=n.pos-1,a=n.pos;return i.delete(s,a),!0}):this.editor.commands.unsetDetails()},Enter:({editor:t})=>{const{state:e,view:r}=t,{schema:n,selection:i}=e,{$head:s}=i;if(s.parent.type!==n.nodes.detailsSummary)return!1;const a=Q_(s.after()+1,t),o=a?e.doc.nodeAt(s.after()):s.node(-2);if(!o)return!1;const l=a?0:s.indexAfter(-1),u=NN(o.contentMatchAt(l));if(!u||!o.canReplaceWith(l,l,u))return!1;const h=u.createAndFill();if(!h)return!1;const d=a?s.after()+1:s.after(-1),f=e.tr.replaceWith(d,d,h),p=f.doc.resolve(d),g=Xr.near(p,1);return f.setSelection(g),f.scrollIntoView(),r.dispatch(f),!0},ArrowRight:({editor:t})=>Lue(t,"right"),ArrowDown:({editor:t})=>Lue(t,"down")}},addProseMirrorPlugins(){return[new ki({key:new us("detailsSelection"),appendTransaction:(t,e,r)=>{const{editor:n,type:i}=this;if(n.view.composing||!t.some(d=>d.selectionSet)||!e.selection.empty||!r.selection.empty||!wwe(r,i.name))return;const{$from:s}=r.selection;if(Q_(s.pos,n))return;const a=gMt(s,d=>d.type===i,n);if(!a)return;const o=xM(a.node,d=>d.type===r.schema.nodes.detailsSummary);if(!o.length)return;const l=o[0],u=(e.selection.from{const e=document.createElement("div"),r=xn(this.options.HTMLAttributes,t,{"data-type":this.name,hidden:"hidden"});return Object.entries(r).forEach(([n,i])=>e.setAttribute(n,i)),e.addEventListener("toggleDetailsContent",()=>{e.toggleAttribute("hidden")}),{dom:e,contentDOM:e,ignoreMutation(n){return n.type==="selection"?!1:!e.contains(n.target)||e===n.target},update:n=>n.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{state:e,view:r}=t,{selection:n}=e,{$from:i,empty:s}=n,a=Uy(A=>A.type===this.type)(n);if(!s||!a||!a.node.childCount)return!1;const o=i.index(a.depth),{childCount:l}=a.node;if(l!==o+1)return!1;const u=a.node.type.contentMatch.defaultType,h=u==null?void 0:u.createAndFill();if(!h)return!1;const d=e.doc.resolve(a.pos+1),f=l-1,p=a.node.child(f),g=d.posAtIndex(f,a.depth);if(!p.eq(h))return!1;const m=i.node(-3);if(!m)return!1;const y=i.indexAfter(-3),v=NN(m.contentMatchAt(y));if(!v||!m.canReplaceWith(y,y,v))return!1;const x=v.createAndFill();if(!x)return!1;const{tr:b}=e,T=i.after(-2);b.replaceWith(T,T,x);const C=b.doc.resolve(T),S=Xr.near(C,1);b.setSelection(S);const k=g,E=g+p.nodeSize;return b.delete(k,E),b.scrollIntoView(),r.dispatch(b),!0}}},...yK({nodeName:"detailsContent"})}),vMt=Zn.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",xn(this.options.HTMLAttributes,t),0]},...yK({nodeName:"detailsSummary",content:"inline"})}),iQ=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},bMt={aac:"audio/aac",aiff:"audio/aiff",ape:"audio/x-ape",flac:"audio/flac",m4a:"audio/mp4",mp3:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg",wav:"audio/wav",weba:"audio/webm",wma:"audio/x-ms-wma"},xMt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:bMt[iQ(e)]??null},wMt={m4v:"video/mp4",mov:"video/quicktime",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},sQ=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("video/")?r:wMt[iQ(e)]??null},ty=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=iQ(e);return r.startsWith("image/")?"image":xMt(r,e)?"audio":sQ(r,e)?"video":r==="application/pdf"||n==="pdf"?"pdf":r.includes("spreadsheet")||r.includes("excel")||["xls","xlsx","xlsm","ods","csv"].includes(n)?"spreadsheet":r.includes("word")||r.includes("wordprocessingml")||["doc","docx","odt","rtf"].includes(n)?"document":r.includes("presentation")||r.includes("powerpoint")||["ppt","pptx","odp","key"].includes(n)?"presentation":r.includes("zip")||r.includes("compressed")||r.includes("tar")||r.includes("rar")||r.includes("gzip")||["zip","rar","7z","tar","gz","bz2","xz"].includes(n)?"archive":r.includes("javascript")||r.includes("typescript")||r.includes("json")||r.includes("xml")||r.includes("yaml")||["js","jsx","ts","tsx","json","xml","yaml","yml","html","css","sh","py","java","go","rs"].includes(n)?"code":r.startsWith("text/")||["txt","md","log"].includes(n)?"text":"file"},TMt=/\/api\/v1\/resources\/([^/]+)\/blob(?:$|[?#])/,CMt=t=>{if(t.startsWith("edgeever-resource://"))try{const e=new URL(t);return decodeURIComponent(e.pathname.replace(/^\//,""))||null}catch{return null}try{const r=new URL(t,"http://edgeever.local").pathname.match(TMt);return r!=null&&r[1]?decodeURIComponent(r[1]):null}catch{return null}},aQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),kMt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",text:"TXT",file:"FILE"},xg=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},SMt=t=>{const e=xg(t);if(e===null)return null;const r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1),i=e/1024**n;return`${n===0?i.toFixed(0):i.toFixed(i>=10?1:2)} ${r[n]}`},EMt=(t,e)=>kMt[ty(t,e)],AMt=(t,e,r)=>[EMt(t,e),SMt(r)].filter(Boolean).join(" · "),Wf="edgeeverFileAttachment",Iue=t=>t==="compact"?"compact":"inline",MMt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,RMt=/^\s*(?:附件[::]|Attachment:)\s*/i,_Mt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,LMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),IMt=(t,e)=>{const r=aQ(t)||t||e;return ty(null,r)==="pdf"||ty(null,e)==="pdf"?!1:RMt.test(t)||_Mt.test(e)||ty(null,r)!=="file"},NMt=Zn.create({name:Wf,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-file-url")||"",renderHTML:t=>({"data-file-url":t.url||""})},label:{default:"Attachment",parseHTML:t=>t.getAttribute("data-file-label")||"Attachment",renderHTML:t=>({"data-file-label":t.label||"Attachment"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-file-name")||"",renderHTML:t=>({"data-file-name":t.filename||""})},mimeType:{default:"",parseHTML:t=>t.getAttribute("data-file-mime-type")||"",renderHTML:t=>({"data-file-mime-type":t.mimeType||""})},byteSize:{default:null,parseHTML:t=>xg(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=xg(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}},displayMode:{default:"inline",parseHTML:t=>Iue(t.getAttribute("data-file-display-mode")),renderHTML:t=>{const e=Iue(t.displayMode);return e==="compact"?{"data-file-display-mode":e}:{}}}}},parseHTML(){return[{tag:'span[data-type="edgeever-file-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"edgeever-file-attachment",class:"edgeever-file-attachment"})]},parseMarkdown:t=>{const e=t.label||"Attachment";return{type:Wf,attrs:{url:t.url||"",label:e,filename:aQ(e),mimeType:"",byteSize:null,displayMode:"inline"}}},renderMarkdown:t=>{var e,r;return`[${LMt(String(((e=t.attrs)==null?void 0:e.label)||"Attachment"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:Wf,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=MMt.exec(t);if(!(!e||!IMt(e[1],e[2])))return{type:Wf,raw:e[0],label:e[1],url:e[2]}}}}),DMt=25,OMt=100,PMt=[{id:"small",width:35,labelKey:"editor.imageSizeSmall"},{id:"medium",width:50,labelKey:"editor.imageSizeMedium"},{id:"large",width:72,labelKey:"editor.imageSizeLarge"},{id:"full",width:100,labelKey:"editor.imageSizeFull"}],Nue=PMt[0].width,$Mt=640,BMt=` +@media screen and (max-width: ${$Mt}px) { + :is(.edgeever-image-node, .edgeever-image-upload-result, .edgeever-image-upload-placeholder, .ProseMirror img[data-width]):not(.edgeever-image-card *) { + width: 100% !important; + max-width: 100% !important; + } +} +`,FMt=()=>{if(typeof document>"u"||document.head.querySelector("style[data-edgeever-phone-image-fill]"))return;const t=document.createElement("style");t.dataset.edgeeverPhoneImageFill="true",t.textContent=BMt,document.head.appendChild(t)},Due=t=>Math.min(OMt,Math.max(DMt,Math.round(t))),m7e=t=>{if(typeof t=="number"&&Number.isFinite(t))return Due(t);if(typeof t!="string")return null;const e=/(\d+(?:\.\d+)?)/.exec(t);return e?Due(Number(e[1])):null},oW="details",y7e="detailsSummary",v7e="detailsContent",zMt=/^]*)>/i,VMt=/^\s*]*>([\s\S]*?)<\/summary\s*>\s*/i,HMt=/^\s*]*data-type=["']detailsContent["'][^>]*>([\s\S]*)<\/div>\s*$/i,b7e=t=>t?typeof t.text=="string"?t.text:Array.isArray(t.content)?t.content.map(e=>b7e(e)).join(""):"":"",oQ=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),x7e=t=>t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),GMt=t=>x7e(t.replace(/<[^>]+>/g,"")).trim(),WMt=(t,e)=>{const r=new RegExp(`^<${e}\\b([^>]*)>`,"i").exec(t);if(!r)return null;const n=r[0];let i=1,s=n.length;const a=new RegExp(`<${e}\\b`,"ig"),o=new RegExp(``,"ig");for(;s0;){a.lastIndex=s,o.lastIndex=s;const l=a.exec(t),u=o.exec(t);if(!u)return null;if(l&&l.index{const e=HMt.exec(t.trim());return e?e[1]:t},UMt=t=>new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"),lC=(t,e)=>{const r=UMt(e).exec(t);return x7e(((r==null?void 0:r[1])??(r==null?void 0:r[2])??(r==null?void 0:r[3])??"").trim())},YMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),w7e=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t)||CMt(t))return!1;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},jMt=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t))return!1;if(t.startsWith("edgeever-resource://")||t.startsWith("edgeever-staged://")||t.startsWith("/")&&!t.startsWith("//"))return!0;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},XMt=t=>{const e=t.trim();return/^\d+(?:\.\d+)?%$/.test(e)?m7e(e):null},T7e=t=>{const e=t.trim();if(!w7e(e))return null;let r="";try{r=decodeURIComponent(new URL(e).pathname.split("/").filter(Boolean).pop()||"").trim()}catch{r=""}(!r||r.length>120||/[\\/\[\]()<>]/.test(r))&&(r="");const n=r||"video";return{src:e,label:`附件:${n}`,filename:n,mimeType:sQ(null,n)??"video/mp4"}},Oue=(t,e,r)=>t.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/g).map(n=>n.startsWith("```")||n.startsWith("~~~")?n:(e.lastIndex=0,n.replace(e,r))).join(""),KMt=t=>{const e=[],r=[],n=Oue(t,/]*)>([\s\S]*?)<\/video\s*>|]*)\/>/gi,(s,a,o,l)=>{const u=T7e(lC(a||l||"","src"));return u?(r.push(u.src),` -[${BMt(u.label)}](${u.src}) +[${YMt(u.label)}](${u.src}) -`):""});return{markdown:Lue(n,/]*)\/?>/gi,(s,a)=>{const o=sC(a||"","src");if(!o)return s;const l=sC(a||"","alt"),u=sC(a||"","title");return e.push({src:o,width:zMt(sC(a||"","width"))}),u?`![${l}](${o} "${u}")`:`![${l}](${o})`}),images:e,videoUrls:r}},HMt=(t,e,r)=>{const n=new Set(r);let i=0;const s=a=>{var o,l,u;if(a.type==="image"){const h=e[i],d=typeof((o=a.attrs)==null?void 0:o.src)=="string"?a.attrs.src:"";return h&&h.src===d&&(i+=1,h.width!=null)?{...a,attrs:{...a.attrs,width:h.width}}:a}if(a.type===zf&&n.has(String(((l=a.attrs)==null?void 0:l.url)||""))){const h=typeof((u=a.attrs)==null?void 0:u.filename)=="string"?a.attrs.filename:"";return{...a,attrs:{...a.attrs,mimeType:tQ(null,h)??"video/mp4"}}}return Array.isArray(a.content)?{...a,content:a.content.map(s)}:a};return t.map(s)},jA=(t,e)=>`${t}="${nQ(e)}"`,GMt=t=>{var a,o,l,u;const e=typeof((a=t.attrs)==null?void 0:a.src)=="string"?t.attrs.src.trim():"";if(!FMt(e))return null;const r=typeof((o=t.attrs)==null?void 0:o.alt)=="string"?t.attrs.alt.trim():"",n=typeof((l=t.attrs)==null?void 0:l.title)=="string"?t.attrs.title.trim():"",i=((u=t.attrs)==null?void 0:u.width)==null||t.attrs.width===""?null:u7e(t.attrs.width),s=[jA("src",e)];return r&&s.push(jA("alt",r)),n&&s.push(jA("title",n)),i!=null&&s.push(jA("width",`${i}%`)),``},WMt=t=>{var e,r;return t.type===zf?t:t.type==="paragraph"&&((e=t.content)==null?void 0:e.length)===1&&((r=t.content[0])==null?void 0:r.type)===zf?t.content[0]:null},qMt=t=>{var s,a,o;const e=WMt(t);if(!e)return null;const r=typeof((s=e.attrs)==null?void 0:s.url)=="string"?e.attrs.url.trim():"";if(!g7e(r))return null;const n=typeof((a=e.attrs)==null?void 0:a.filename)=="string"?e.attrs.filename:"",i=typeof((o=e.attrs)==null?void 0:o.mimeType)=="string"?e.attrs.mimeType:"";return J1(i,n||r)!=="video"?null:``},UMt=(t,e)=>{const r=[],n=[],i=()=>{if(n.length===0)return;const s=e.renderChildren(n,` +`):""});return{markdown:Oue(n,/]*)\/?>/gi,(s,a)=>{const o=lC(a||"","src");if(!o)return s;const l=lC(a||"","alt"),u=lC(a||"","title");return e.push({src:o,width:XMt(lC(a||"","width"))}),u?`![${l}](${o} "${u}")`:`![${l}](${o})`}),images:e,videoUrls:r}},ZMt=(t,e,r)=>{const n=new Set(r);let i=0;const s=a=>{var o,l,u;if(a.type==="image"){const h=e[i],d=typeof((o=a.attrs)==null?void 0:o.src)=="string"?a.attrs.src:"";return h&&h.src===d&&(i+=1,h.width!=null)?{...a,attrs:{...a.attrs,width:h.width}}:a}if(a.type===Wf&&n.has(String(((l=a.attrs)==null?void 0:l.url)||""))){const h=typeof((u=a.attrs)==null?void 0:u.filename)=="string"?a.attrs.filename:"";return{...a,attrs:{...a.attrs,mimeType:sQ(null,h)??"video/mp4"}}}return Array.isArray(a.content)?{...a,content:a.content.map(s)}:a};return t.map(s)},ZA=(t,e)=>`${t}="${oQ(e)}"`,QMt=t=>{var a,o,l,u;const e=typeof((a=t.attrs)==null?void 0:a.src)=="string"?t.attrs.src.trim():"";if(!jMt(e))return null;const r=typeof((o=t.attrs)==null?void 0:o.alt)=="string"?t.attrs.alt.trim():"",n=typeof((l=t.attrs)==null?void 0:l.title)=="string"?t.attrs.title.trim():"",i=((u=t.attrs)==null?void 0:u.width)==null||t.attrs.width===""?null:m7e(t.attrs.width),s=[ZA("src",e)];return r&&s.push(ZA("alt",r)),n&&s.push(ZA("title",n)),i!=null&&s.push(ZA("width",`${i}%`)),``},JMt=t=>{var e,r;return t.type===Wf?t:t.type==="paragraph"&&((e=t.content)==null?void 0:e.length)===1&&((r=t.content[0])==null?void 0:r.type)===Wf?t.content[0]:null},eRt=t=>{var s,a,o;const e=JMt(t);if(!e)return null;const r=typeof((s=e.attrs)==null?void 0:s.url)=="string"?e.attrs.url.trim():"";if(!w7e(r))return null;const n=typeof((a=e.attrs)==null?void 0:a.filename)=="string"?e.attrs.filename:"",i=typeof((o=e.attrs)==null?void 0:o.mimeType)=="string"?e.attrs.mimeType:"";return ty(i,n||r)!=="video"?null:``},tRt=(t,e)=>{const r=[],n=[],i=()=>{if(n.length===0)return;const s=e.renderChildren(n,` -`).trim();s&&r.push(s),n.length=0};for(const s of t){const a=s.type==="image"?GMt(s):qMt(s);if(!a){n.push(s);continue}i(),r.push(a)}return i(),r.join(` +`).trim();s&&r.push(s),n.length=0};for(const s of t){const a=s.type==="image"?QMt(s):eRt(s);if(!a){n.push(s);continue}i(),r.push(a)}return i(),r.join(` -`)},YMt=(t,e)=>{const r=t.createElement("p"),n=t.createElement("span");return n.setAttribute("data-type","edgeever-file-attachment"),n.setAttribute("data-file-url",e.src),n.setAttribute("data-file-label",e.label),n.setAttribute("data-file-name",e.filename),n.setAttribute("data-file-mime-type",e.mimeType),r.appendChild(n),r},jMt=t=>{if(typeof DOMParser>"u"||!t.includes(" [data-type="detailsContent"]'))continue;const i=e.createElement("div");i.setAttribute("data-type","detailsContent");for(const a of[...n.childNodes])a.nodeName!=="SUMMARY"&&i.appendChild(a);i.hasChildNodes()||i.appendChild(e.createElement("p"));const s=n.querySelector(":scope > summary");s!=null&&s.nextSibling?n.insertBefore(i,s.nextSibling):n.appendChild(i)}return e.body.innerHTML},XMt=` +`)},rRt=(t,e)=>{const r=t.createElement("p"),n=t.createElement("span");return n.setAttribute("data-type","edgeever-file-attachment"),n.setAttribute("data-file-url",e.src),n.setAttribute("data-file-label",e.label),n.setAttribute("data-file-name",e.filename),n.setAttribute("data-file-mime-type",e.mimeType),r.appendChild(n),r},nRt=t=>{if(typeof DOMParser>"u"||!t.includes(" [data-type="detailsContent"]'))continue;const i=e.createElement("div");i.setAttribute("data-type","detailsContent");for(const a of[...n.childNodes])a.nodeName!=="SUMMARY"&&i.appendChild(a);i.hasChildNodes()||i.appendChild(e.createElement("p"));const s=n.querySelector(":scope > summary");s!=null&&s.nextSibling?n.insertBefore(i,s.nextSibling):n.appendChild(i)}return e.body.innerHTML},iRt=` .ProseMirror [data-type="details"], .edgeever-editor-content [data-type="details"] { display: flex; @@ -1437,22 +1444,22 @@ ${r} .edgeever-editor-content [data-type="details"].is-open [data-type="detailsContent"] { margin-top: 0.15em; } -`,KMt=(t,e)=>{const r=typeof t.summary=="string"?t.summary:"",n=t,i=HMt(e.parseChildren(t.tokens||[]),n.detailImages||[],n.detailVideoUrls||[]),s=i.length>0?i:[{type:"paragraph"}];return e.createNode(nW,void 0,[e.createNode(h7e,void 0,r?[e.createTextNode(r)]:[]),e.createNode(d7e,void 0,s)])},ZMt=(t,e)=>{const r=Array.isArray(t.content)?t.content:[],n=r.find(o=>o.type===h7e),i=r.find(o=>o.type===d7e),s=nQ(f7e(n).trim()),a=Array.isArray(i==null?void 0:i.content)&&i.content.length>0?UMt(i.content,e):"";return`
    +`,sRt=(t,e)=>{const r=typeof t.summary=="string"?t.summary:"",n=t,i=ZMt(e.parseChildren(t.tokens||[]),n.detailImages||[],n.detailVideoUrls||[]),s=i.length>0?i:[{type:"paragraph"}];return e.createNode(oW,void 0,[e.createNode(y7e,void 0,r?[e.createTextNode(r)]:[]),e.createNode(v7e,void 0,s)])},aRt=(t,e)=>{const r=Array.isArray(t.content)?t.content:[],n=r.find(o=>o.type===y7e),i=r.find(o=>o.type===v7e),s=oQ(b7e(n).trim()),a=Array.isArray(i==null?void 0:i.content)&&i.content.length>0?tRt(i.content,e):"";return`
    ${s} ${a} -
    `},QMt=uMt.extend({addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{class:"edgeever-details"},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details":"Expand details")}}},parseMarkdown:KMt,renderMarkdown:ZMt,markdownTokenizer:{name:nW,level:"block",start(t){const e=/[QMt,JMt,eRt],Jp="edgeeverImageGallery",y7e=["auto","2","3","1"],iW=t=>y7e.includes(t)?t:"auto",v7e=Zn.create({name:Jp,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>iW(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":iW(t.layout)})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",xn(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]},renderMarkdown(t,e){return e.renderChildren(t.content??[],` +
    `},oRt=mMt.extend({addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{class:"edgeever-details"},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details":"Expand details")}}},parseMarkdown:sRt,renderMarkdown:aRt,markdownTokenizer:{name:oW,level:"block",start(t){const e=/[oRt,lRt,cRt],y0="edgeeverImageGallery",C7e=["auto","2","3","1"],hRt="edgeever-image-upload://",dRt=t=>typeof t=="string"&&t.startsWith(hRt),lW=t=>C7e.includes(t)?t:"auto",k7e=Zn.create({name:y0,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>lW(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":lW(t.layout)})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",xn(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]},renderMarkdown(t,e){return e.renderChildren(t.content??[],` -`)}}),XA="edgeeverMergeDivider",rRt="\x3C!-- edgeever:merge-divider -->",nRt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,iRt=Zn.create({name:XA,group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",xn(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${rRt} +`)}}),QA="edgeeverMergeDivider",fRt="\x3C!-- edgeever:merge-divider -->",pRt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,gRt=Zn.create({name:QA,group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",xn(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${fRt} ----`},parseMarkdown(t,e){return e.createNode(XA)},markdownTokenizer:{name:XA,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=nRt.exec(t);if(e)return{type:XA,raw:e[0],text:""}}}}),J2="edgeeverPdfAttachment",Iue=t=>t==="inline"?"inline":"compact",sRt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,Nue=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,aRt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),oRt=Zn.create({name:J2,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-pdf-url")||"",renderHTML:t=>({"data-pdf-url":t.url||""})},label:{default:"PDF",parseHTML:t=>t.getAttribute("data-pdf-label")||"PDF",renderHTML:t=>({"data-pdf-label":t.label||"PDF"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-pdf-name")||"",renderHTML:t=>({"data-pdf-name":t.filename||""})},mimeType:{default:"application/pdf",parseHTML:t=>t.getAttribute("data-pdf-mime-type")||"application/pdf",renderHTML:t=>({"data-pdf-mime-type":t.mimeType||"application/pdf"})},byteSize:{default:null,parseHTML:t=>yg(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=yg(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>Iue(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":Iue(t.displayMode)})}}},parseHTML(){return[{tag:'span[data-type="edgeever-pdf-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"edgeever-pdf-attachment",class:"edgeever-pdf-attachment"})]},parseMarkdown:t=>({type:J2,attrs:{url:t.url||"",label:t.label||"PDF",filename:rQ(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${aRt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:J2,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=sRt.exec(t);if(!(!e||!Nue(null,e[1])&&!Nue(null,e[2])))return{type:J2,raw:e[0],label:e[1],url:e[2]}}}}),ZC="edgeeverPluginEmbed",b7e="edgeever-plugin-embed",Hv=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",Due=t=>{if(!t||typeof t!="object")return null;const e=t,r=Hv(e.id,160),n=Hv(e.pluginId,160),i=Hv(e.type,120),s=Hv(e.resourceId,200);if(!r||!n||!i||!s)return null;const a=typeof e.dataJson=="string"?e.dataJson:"null";try{JSON.parse(a)}catch{return null}return{id:r,pluginId:n,type:i,resourceId:s,previewResourceId:Hv(e.previewResourceId,200),title:Hv(e.title,500),dataJson:a}},lRt=t=>`\`\`\`${b7e} +---`},parseMarkdown(t,e){return e.createNode(QA)},markdownTokenizer:{name:QA,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=pRt.exec(t);if(e)return{type:QA,raw:e[0],text:""}}}}),tb="edgeeverPdfAttachment",Pue=t=>t==="inline"?"inline":"compact",mRt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,$ue=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,yRt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),vRt=Zn.create({name:tb,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-pdf-url")||"",renderHTML:t=>({"data-pdf-url":t.url||""})},label:{default:"PDF",parseHTML:t=>t.getAttribute("data-pdf-label")||"PDF",renderHTML:t=>({"data-pdf-label":t.label||"PDF"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-pdf-name")||"",renderHTML:t=>({"data-pdf-name":t.filename||""})},mimeType:{default:"application/pdf",parseHTML:t=>t.getAttribute("data-pdf-mime-type")||"application/pdf",renderHTML:t=>({"data-pdf-mime-type":t.mimeType||"application/pdf"})},byteSize:{default:null,parseHTML:t=>xg(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=xg(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>Pue(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":Pue(t.displayMode)})}}},parseHTML(){return[{tag:'span[data-type="edgeever-pdf-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"edgeever-pdf-attachment",class:"edgeever-pdf-attachment"})]},parseMarkdown:t=>({type:tb,attrs:{url:t.url||"",label:t.label||"PDF",filename:aQ(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${yRt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:tb,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=mRt.exec(t);if(!(!e||!$ue(null,e[1])&&!$ue(null,e[2])))return{type:tb,raw:e[0],label:e[1],url:e[2]}}}}),ek="edgeeverPluginEmbed",S7e="edgeever-plugin-embed",Wv=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",Bue=t=>{if(!t||typeof t!="object")return null;const e=t,r=Wv(e.id,160),n=Wv(e.pluginId,160),i=Wv(e.type,120),s=Wv(e.resourceId,200);if(!r||!n||!i||!s)return null;const a=typeof e.dataJson=="string"?e.dataJson:"null";try{JSON.parse(a)}catch{return null}return{id:r,pluginId:n,type:i,resourceId:s,previewResourceId:Wv(e.previewResourceId,200),title:Wv(e.title,500),dataJson:a}},bRt=t=>`\`\`\`${S7e} ${JSON.stringify(t)} -\`\`\``,cRt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,uRt=Zn.create({name:ZC,group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{id:{default:""},pluginId:{default:""},type:{default:""},resourceId:{default:""},previewResourceId:{default:""},title:{default:""},dataJson:{default:"null"}}},parseHTML(){return[{tag:'figure[data-type="edgeever-plugin-embed"]'}]},renderHTML({HTMLAttributes:t}){const e=typeof t.title=="string"&&t.title?t.title:"Plugin embed";return["figure",xn(t,{"data-type":"edgeever-plugin-embed",class:"edgeever-plugin-embed",contenteditable:"false"}),["figcaption",{},e]]},parseMarkdown:t=>({type:ZC,attrs:t.attrs}),renderMarkdown:t=>{const e=Due(t.attrs);return e?lRt(e):""},markdownTokenizer:{name:ZC,level:"block",start(t){return t.indexOf(`\`\`\`${b7e}`)},tokenize(t){const e=cRt.exec(t);if(e)try{const r=Due(JSON.parse(e[1]));return r?{type:ZC,raw:e[0],attrs:r}:void 0}catch{return}}}}),iQ="edgeeverEmptyExternalLink",Oue=t=>{if(typeof t!="string")return"";const e=t.trim();return/^(?:https?:\/\/|\/|#)/i.test(e)?e:""},hRt=Zn.create({name:iQ,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{href:{default:""},title:{default:null}}},parseHTML(){return[{tag:"a[data-edgeever-empty-link]"}]},renderHTML({HTMLAttributes:t}){const e=Oue(t.href);return["a",xn(t,{href:e||void 0,target:"_blank",rel:"noopener noreferrer","data-edgeever-empty-link":"true","aria-label":e?`Open link: ${e}`:"Open link",class:"edgeever-empty-external-link"}),"↗"]},renderMarkdown(t){var n,i;const e=Oue((n=t.attrs)==null?void 0:n.href);if(!e)return"";const r=typeof((i=t.attrs)==null?void 0:i.title)=="string"&&t.attrs.title?` "${t.attrs.title.replaceAll('"','\\"')}"`:"";return`[](${e}${r})`}}),dRt=tMt.extend({inclusive:!1,parseMarkdown(t,e){var r;return!((r=t.tokens)!=null&&r.length)&&t.text===""&&typeof t.href=="string"&&t.href?{type:iQ,attrs:{href:t.href,title:t.title||null}}:e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})}}),aC=(t,e)=>t===!1?[]:[t??e],x7e=t=>[t.markdown?gB.configure({...t.starterKit,link:!1}):t.starterKit===void 0?gB:gB.configure(t.starterKit),...t.markdown?[dRt]:[],hRt,NEe,IEe.configure({nested:!0}),t.table===void 0?xue:xue.configure(t.table),...aC(t.image,Iwe),...aC(t.gallery,v7e),...aC(t.pdf,oRt),...aC(t.file,AMt),iRt,...tRt(),...aC(t.pluginEmbed,uRt),...t.mathematics,...t.markdown?[d7t.configure({markedOptions:{gfm:!0}})]:[]],X_="blockMath",K_="inlineMath",fRt=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},w7e=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!fRt(t,n))return n;return-1},T7e={name:K_,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=w7e(t,"$",1);if(e<0||t[e+1]==="$")return;const r=t.slice(0,e+1),n=t.slice(1,e).trim();if(!(!n||n.includes(` -`)))return/^\d+(?:[.,]\d+)?$/u.test(n)?{type:"text",raw:r,text:r}:{type:K_,raw:r,latex:n}}},C7e={name:X_,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=w7e(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:X_,raw:t.slice(0,e+2),latex:r}}},pRt=Zn.create({name:K_,group:"inline",inline:!0,atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:K_,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:T7e}),gRt=Zn.create({name:X_,group:"block",atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",xn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:X_,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` -`)},markdownTokenizer:C7e}),mRt=()=>[gRt.configure(),pRt.configure()],sQ="edgeeverUnsupportedBlock",M6="edgeeverUnsupportedInline",s7="edgeeverUnsupportedMark",R6=new Set([sQ,M6]),k7e=new Set(["doc","text","paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","hardBreak","horizontalRule","image","details","detailsSummary","detailsContent","edgeeverImageGallery","table","tableRow","tableHeader","tableCell","edgeeverMergeDivider",iQ,"inlineMath","blockMath",...R6]),sW=new Set(["bold","italic","strike","underline","code","link",s7]),yRt=new Set([...k7e,zf,J2,ZC]),S7e=new Set(["paragraph","heading"]),mD=t=>t.type==="text"&&"text"in t,_6=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",h5=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:e==="ja"?`未対応のコンテンツ: ${t}`:`Unsupported content: ${t}`,vRt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:h5(t.type,e)}),E7e=t=>{if(typeof(t==null?void 0:t.originalJson)!="string")return null;try{const e=JSON.parse(t.originalJson);return e&&typeof e.type=="string"?e:null}catch{return null}},bRt=t=>{if(typeof(t==null?void 0:t.originalMarksJson)!="string")return[];try{const e=JSON.parse(t.originalMarksJson);return Array.isArray(e)?e.filter(r=>!!(r&&typeof r=="object"&&typeof r.type=="string")):[]}catch{return[]}},xRt=Zn.create({name:sQ,group:"block",atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"div[data-edgeever-unsupported-block]"}]},renderHTML({node:t}){const e=_6(t.attrs);return["div",{"data-edgeever-unsupported-block":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--block",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:h5(e)]}}),wRt=Zn.create({name:M6,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-inline]"}]},renderHTML({node:t}){const e=_6(t.attrs);return["span",{"data-edgeever-unsupported-inline":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--inline",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:h5(e)]}}),TRt=Yg.create({name:s7,addAttributes(){return{originalMarksJson:{default:"[]"}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-mark]"}]},renderHTML(){return["span",{"data-edgeever-unsupported-mark":"true",class:"edgeever-unsupported-mark"},0]}}),CRt=()=>[xRt,wRt,TRt],kRt=t=>{const e=t.marks??[],r=e.filter(i=>sW.has(i.type));return e.filter(i=>!sW.has(i.type)).length?{...t,marks:[...r,{type:s7,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},SRt=(t,e)=>{const r=(n,i)=>{if(mD(n))return kRt(n);if(!k7e.has(n.type))return{type:S7e.has(i)?M6:sQ,attrs:vRt(n,e)};const s=n;return R6.has(s.type)?s:s.content?{...s,content:s.content.map(a=>r(a,s.type))}:s};return{...t,content:t.content.map(n=>r(n,"doc"))}},aQ=t=>{const e=r=>{var i;if(R6.has(r.type)){const s=r;return E7e(s.attrs)??{type:r.type===M6?"text":"paragraph",...r.type===M6?{text:h5(_6(s.attrs))}:{content:[{type:"text",text:h5(_6(s.attrs))}]}}}if(mD(r)){const s=r,a=(i=s.marks)==null?void 0:i.find(l=>l.type===s7),o=a?bRt(a.attrs):s.marks??[];return o.length?{...s,marks:o}:{type:"text",text:s.text}}const n=r;return n.content?{...n,content:n.content.map(e)}:n};return{...t,content:t.content.map(r=>e(r))}},A7e=t=>{var e;return mD(t)?t.text:((e=t.content)==null?void 0:e.map(A7e).filter(Boolean).join(" "))??""},ERt=t=>{const e=(r,n)=>{var s;if(mD(r)){const a=r;return{...a,marks:(s=a.marks)==null?void 0:s.filter(o=>sW.has(o.type)&&o.type!==s7)}}if(!yRt.has(r.type)||R6.has(r.type)){const a=r,o=R6.has(r.type)?E7e(a.attrs):a,l=(o==null?void 0:o.type)??_6(a.attrs),h=(o?A7e(o):"")||h5(l);return S7e.has(n)?{type:"text",text:h}:{type:"paragraph",content:[{type:"text",text:h}]}}const i=r;return i.content?{...i,content:i.content.map(a=>e(a,i.type))}:i};return{...t,content:t.content.map(r=>e(r,"doc"))}},ARt=t=>new zG({extensions:x7e({...t,markdown:!0})}),MRt=ARt({mathematics:mRt()}),RRt=t=>{if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=R7e(ERt(aW(t)));return MRt.serialize(r).replaceAll(M7e,"\\$")},M7e="edgeever-dollar",R7e=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",M7e)}:t:Array.isArray(e.content)?{...e,content:e.content.map(R7e)}:t},aW=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=_Rt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(aW)]}}return Array.isArray(e.content)?{...e,content:e.content.map(aW)}:t},_Rt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""};var Pue;function Ct(t,e,r){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),o._zod.traits.has(t))return;o._zod.traits.add(t),e(o,l);const u=a.prototype,h=Object.keys(u);for(let d=0;d{var l,u;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(t)}}),Object.defineProperty(a,"name",{value:t}),a}class _b extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _7e extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Pue=globalThis).__zod_globalConfig??(Pue.__zod_globalConfig={});const oQ=globalThis.__zod_globalConfig;function f0(t){return oQ}function L7e(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function oW(t,e){return typeof e=="bigint"?e.toString():e}function yD(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function lQ(t){return t==null}function cQ(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function LRt(t,e){const r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){};function L6(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const NRt=yD(()=>{var t;if(oQ.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function d5(t){if(L6(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(L6(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function N7e(t){return d5(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const DRt=new Set(["string","number","symbol"]);function f5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kg(t,e,r){const n=new t._zod.constr(e??t._zod.def);return(!e||r!=null&&r.parent)&&(n._zod.parent=t),n}function _r(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function ORt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const PRt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $Rt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Xg(t._zod.def,{get shape(){const a={};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(a[o]=r.shape[o])}return Jy(this,"shape",a),a},checks:[]});return Kg(t,s)}function BRt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Xg(t._zod.def,{get shape(){const a={...t._zod.def.shape};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete a[o]}return Jy(this,"shape",a),a},checks:[]});return Kg(t,s)}function FRt(t,e){if(!d5(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const s=t._zod.def.shape;for(const a in e)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Xg(t._zod.def,{get shape(){const s={...t._zod.def.shape,...e};return Jy(this,"shape",s),s}});return Kg(t,i)}function zRt(t,e){if(!d5(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Xg(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return Jy(this,"shape",n),n}});return Kg(t,r)}function VRt(t,e){var n;if((n=t._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Xg(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return Jy(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Kg(t,r)}function HRt(t,e,r){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Xg(e._zod.def,{get shape(){const o=e._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=t?new t({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=t?new t({type:"optional",innerType:o[u]}):o[u];return Jy(this,"shape",l),l},checks:[]});return Kg(e,a)}function GRt(t,e,r){const n=Xg(e._zod.def,{get shape(){const i=e._zod.def.shape,s={...i};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new t({type:"nonoptional",innerType:i[a]}))}else for(const a in i)s[a]=new t({type:"nonoptional",innerType:i[a]});return Jy(this,"shape",s),s}});return Kg(e,n)}function eb(t,e=0){var r;if(t.aborted===!0)return!0;for(let n=e;n{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function KA(t){return typeof t=="string"?t:t==null?void 0:t.message}function p0(t,e,r){var l,u,h,d,f,p;const n=t.message?t.message:KA((h=(u=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:h.call(u,t))??KA((d=e==null?void 0:e.error)==null?void 0:d.call(e,t))??KA((f=r.customError)==null?void 0:f.call(r,t))??KA((p=r.localeError)==null?void 0:p.call(r,t))??"Invalid input",{inst:i,continue:s,input:a,...o}=t;return o.path??(o.path=[]),o.message=n,e!=null&&e.reportInput&&(o.input=a),o}function uQ(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function I6(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const D7e=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,oW,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},O7e=Ct("$ZodError",D7e),P7e=Ct("$ZodError",D7e,{Parent:Error});function qRt(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function URt(t,e=r=>r.message){const r={_errors:[]},n=(i,s=[])=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o},[...s,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...s,...a.path]);else{const o=[...s,...a.path];if(o.length===0)r._errors.push(e(a));else{let l=r,u=0;for(;u(e,r,n,i)=>{const s=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new _b;if(a.issues.length){const o=new((i==null?void 0:i.Err)??t)(a.issues.map(l=>p0(l,s,f0())));throw I7e(o,i==null?void 0:i.callee),o}return a.value},dQ=t=>async(e,r,n,i)=>{const s=n?{...n,async:!0}:{async:!0};let a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((i==null?void 0:i.Err)??t)(a.issues.map(l=>p0(l,s,f0())));throw I7e(o,i==null?void 0:i.callee),o}return a.value},vD=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new _b;return s.issues.length?{success:!1,error:new(t??O7e)(s.issues.map(a=>p0(a,i,f0())))}:{success:!0,data:s.value}},YRt=vD(P7e),bD=t=>async(e,r,n)=>{const i=n?{...n,async:!0}:{async:!0};let s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(a=>p0(a,i,f0())))}:{success:!0,data:s.value}},jRt=bD(P7e),XRt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return hQ(t)(e,r,i)},KRt=t=>(e,r,n)=>hQ(t)(e,r,n),ZRt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return dQ(t)(e,r,i)},QRt=t=>async(e,r,n)=>dQ(t)(e,r,n),JRt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return vD(t)(e,r,i)},e9t=t=>(e,r,n)=>vD(t)(e,r,n),t9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return bD(t)(e,r,i)},r9t=t=>async(e,r,n)=>bD(t)(e,r,n),n9t=/^[cC][0-9a-z]{6,}$/,i9t=/^[0-9a-z]+$/,s9t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a9t=/^[0-9a-vA-V]{20}$/,o9t=/^[A-Za-z0-9]{27}$/,l9t=/^[a-zA-Z0-9_-]{21}$/,c9t=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u9t=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fue=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,h9t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d9t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function f9t(){return new RegExp(d9t,"u")}const p9t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,g9t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,m9t=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,y9t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,v9t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$7e=/^[A-Za-z0-9_-]*$/,b9t=/^https?$/,x9t=/^\+[1-9]\d{6,14}$/,B7e="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",w9t=new RegExp(`^${B7e}$`);function F7e(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function T9t(t){return new RegExp(`^${F7e(t)}$`)}function C9t(t){const e=F7e({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${r.join("|")})`;return new RegExp(`^${B7e}T(?:${n})$`)}const k9t=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},S9t=/^-?\d+$/,z7e=/^-?\d+(?:\.\d+)?$/,E9t=/^(?:true|false)$/i,A9t=/^[^A-Z]*$/,M9t=/^[^a-z]*$/,mc=Ct("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),V7e={number:"number",bigint:"bigint",object:"date"},H7e=Ct("$ZodCheckLessThan",(t,e)=>{mc.init(t,e);const r=V7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{mc.init(t,e);const r=V7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),R9t=Ct("$ZodCheckMultipleOf",(t,e)=>{mc.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):LRt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),_9t=Ct("$ZodCheckNumberFormat",(t,e)=>{var a;mc.init(t,e),e.format=e.format||"float64";const r=(a=e.format)==null?void 0:a.includes("int"),n=r?"int":"number",[i,s]=PRt[e.format];t._zod.onattach.push(o=>{const l=o._zod.bag;l.format=e.format,l.minimum=i,l.maximum=s,r&&(l.pattern=S9t)}),t._zod.check=o=>{const l=o.value;if(r){if(!Number.isInteger(l)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}ls&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),L9t=Ct("$ZodCheckMaxLength",(t,e)=>{var r;mc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!lQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const i=n.value;if(i.length<=e.maximum)return;const a=uQ(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),I9t=Ct("$ZodCheckMinLength",(t,e)=>{var r;mc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!lQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const i=n.value;if(i.length>=e.minimum)return;const a=uQ(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),N9t=Ct("$ZodCheckLengthEquals",(t,e)=>{var r;mc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!lQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{const i=n.value,s=i.length;if(s===e.length)return;const a=uQ(i),o=s>e.length;n.issues.push({origin:a,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),xD=Ct("$ZodCheckStringFormat",(t,e)=>{var r,n;mc.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),D9t=Ct("$ZodCheckRegex",(t,e)=>{xD.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),O9t=Ct("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=A9t),xD.init(t,e)}),P9t=Ct("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=M9t),xD.init(t,e)}),$9t=Ct("$ZodCheckIncludes",(t,e)=>{mc.init(t,e);const r=f5(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),B9t=Ct("$ZodCheckStartsWith",(t,e)=>{mc.init(t,e);const r=new RegExp(`^${f5(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),F9t=Ct("$ZodCheckEndsWith",(t,e)=>{mc.init(t,e);const r=new RegExp(`.*${f5(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),z9t=Ct("$ZodCheckOverwrite",(t,e)=>{mc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class V9t{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(` +\`\`\``,xRt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,wRt=Zn.create({name:ek,group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{id:{default:""},pluginId:{default:""},type:{default:""},resourceId:{default:""},previewResourceId:{default:""},title:{default:""},dataJson:{default:"null"}}},parseHTML(){return[{tag:'figure[data-type="edgeever-plugin-embed"]'}]},renderHTML({HTMLAttributes:t}){const e=typeof t.title=="string"&&t.title?t.title:"Plugin embed";return["figure",xn(t,{"data-type":"edgeever-plugin-embed",class:"edgeever-plugin-embed",contenteditable:"false"}),["figcaption",{},e]]},parseMarkdown:t=>({type:ek,attrs:t.attrs}),renderMarkdown:t=>{const e=Bue(t.attrs);return e?bRt(e):""},markdownTokenizer:{name:ek,level:"block",start(t){return t.indexOf(`\`\`\`${S7e}`)},tokenize(t){const e=xRt.exec(t);if(e)try{const r=Bue(JSON.parse(e[1]));return r?{type:ek,raw:e[0],attrs:r}:void 0}catch{return}}}}),lQ="edgeeverEmptyExternalLink",Fue=t=>{if(typeof t!="string")return"";const e=t.trim();return/^(?:https?:\/\/|\/|#)/i.test(e)?e:""},TRt=Zn.create({name:lQ,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{href:{default:""},title:{default:null}}},parseHTML(){return[{tag:"a[data-edgeever-empty-link]"}]},renderHTML({HTMLAttributes:t}){const e=Fue(t.href);return["a",xn(t,{href:e||void 0,target:"_blank",rel:"noopener noreferrer","data-edgeever-empty-link":"true","aria-label":e?`Open link: ${e}`:"Open link",class:"edgeever-empty-external-link"}),"↗"]},renderMarkdown(t){var n,i;const e=Fue((n=t.attrs)==null?void 0:n.href);if(!e)return"";const r=typeof((i=t.attrs)==null?void 0:i.title)=="string"&&t.attrs.title?` "${t.attrs.title.replaceAll('"','\\"')}"`:"";return`[](${e}${r})`}}),CRt=oMt.extend({inclusive:!1,parseMarkdown(t,e){var r;return!((r=t.tokens)!=null&&r.length)&&t.text===""&&typeof t.href=="string"&&t.href?{type:lQ,attrs:{href:t.href,title:t.title||null}}:e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})}}),cC=(t,e)=>t===!1?[]:[t??e],E7e=t=>[t.markdown?vB.configure({...t.starterKit,link:!1}):t.starterKit===void 0?vB:vB.configure(t.starterKit),...t.markdown?[CRt]:[],TRt,FEe,BEe.configure({nested:!0}),t.table===void 0?kue:kue.configure(t.table),...cC(t.image,Bwe),...cC(t.gallery,k7e),...cC(t.pdf,vRt),...cC(t.file,NMt),gRt,...uRt(),...cC(t.pluginEmbed,wRt),...t.mathematics,...t.markdown?[v7t.configure({markedOptions:{gfm:!0}})]:[]],J_="blockMath",eL="inlineMath",kRt=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},A7e=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!kRt(t,n))return n;return-1},M7e={name:eL,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=A7e(t,"$",1);if(e<0||t[e+1]==="$")return;const r=t.slice(0,e+1),n=t.slice(1,e).trim();if(!(!n||n.includes(` +`)))return/^\d+(?:[.,]\d+)?$/u.test(n)?{type:"text",raw:r,text:r}:{type:eL,raw:r,latex:n}}},R7e={name:J_,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=A7e(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:J_,raw:t.slice(0,e+2),latex:r}}},SRt=Zn.create({name:eL,group:"inline",inline:!0,atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:eL,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:M7e}),ERt=Zn.create({name:J_,group:"block",atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",xn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:J_,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` +`)},markdownTokenizer:R7e}),ARt=()=>[ERt.configure(),SRt.configure()],cQ="edgeeverUnsupportedBlock",L6="edgeeverUnsupportedInline",l7="edgeeverUnsupportedMark",I6=new Set([cQ,L6]),_7e=new Set(["doc","text","paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","hardBreak","horizontalRule","image","details","detailsSummary","detailsContent","edgeeverImageGallery","table","tableRow","tableHeader","tableCell","edgeeverMergeDivider",lQ,"inlineMath","blockMath",...I6]),cW=new Set(["bold","italic","strike","underline","code","link",l7]),MRt=new Set([..._7e,Wf,tb,ek]),L7e=new Set(["paragraph","heading"]),bD=t=>t.type==="text"&&"text"in t,N6=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",f5=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:e==="ja"?`未対応のコンテンツ: ${t}`:`Unsupported content: ${t}`,RRt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:f5(t.type,e)}),I7e=t=>{if(typeof(t==null?void 0:t.originalJson)!="string")return null;try{const e=JSON.parse(t.originalJson);return e&&typeof e.type=="string"?e:null}catch{return null}},_Rt=t=>{if(typeof(t==null?void 0:t.originalMarksJson)!="string")return[];try{const e=JSON.parse(t.originalMarksJson);return Array.isArray(e)?e.filter(r=>!!(r&&typeof r=="object"&&typeof r.type=="string")):[]}catch{return[]}},LRt=Zn.create({name:cQ,group:"block",atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"div[data-edgeever-unsupported-block]"}]},renderHTML({node:t}){const e=N6(t.attrs);return["div",{"data-edgeever-unsupported-block":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--block",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:f5(e)]}}),IRt=Zn.create({name:L6,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-inline]"}]},renderHTML({node:t}){const e=N6(t.attrs);return["span",{"data-edgeever-unsupported-inline":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--inline",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:f5(e)]}}),NRt=Kg.create({name:l7,addAttributes(){return{originalMarksJson:{default:"[]"}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-mark]"}]},renderHTML(){return["span",{"data-edgeever-unsupported-mark":"true",class:"edgeever-unsupported-mark"},0]}}),DRt=()=>[LRt,IRt,NRt],ORt=t=>{const e=t.marks??[],r=e.filter(i=>cW.has(i.type));return e.filter(i=>!cW.has(i.type)).length?{...t,marks:[...r,{type:l7,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},PRt=(t,e)=>{const r=(n,i)=>{if(bD(n))return ORt(n);if(!_7e.has(n.type))return{type:L7e.has(i)?L6:cQ,attrs:RRt(n,e)};const s=n;return I6.has(s.type)?s:s.content?{...s,content:s.content.map(a=>r(a,s.type))}:s};return{...t,content:t.content.map(n=>r(n,"doc"))}},uQ=t=>{const e=r=>{var i;if(I6.has(r.type)){const s=r;return I7e(s.attrs)??{type:r.type===L6?"text":"paragraph",...r.type===L6?{text:f5(N6(s.attrs))}:{content:[{type:"text",text:f5(N6(s.attrs))}]}}}if(bD(r)){const s=r,a=(i=s.marks)==null?void 0:i.find(l=>l.type===l7),o=a?_Rt(a.attrs):s.marks??[];return o.length?{...s,marks:o}:{type:"text",text:s.text}}const n=r;return n.content?{...n,content:n.content.map(e)}:n};return{...t,content:t.content.map(r=>e(r))}},N7e=t=>{var e;return bD(t)?t.text:((e=t.content)==null?void 0:e.map(N7e).filter(Boolean).join(" "))??""},$Rt=t=>{const e=(r,n)=>{var s;if(bD(r)){const a=r;return{...a,marks:(s=a.marks)==null?void 0:s.filter(o=>cW.has(o.type)&&o.type!==l7)}}if(!MRt.has(r.type)||I6.has(r.type)){const a=r,o=I6.has(r.type)?I7e(a.attrs):a,l=(o==null?void 0:o.type)??N6(a.attrs),h=(o?N7e(o):"")||f5(l);return L7e.has(n)?{type:"text",text:h}:{type:"paragraph",content:[{type:"text",text:h}]}}const i=r;return i.content?{...i,content:i.content.map(a=>e(a,i.type))}:i};return{...t,content:t.content.map(r=>e(r,"doc"))}},BRt=t=>new WG({extensions:E7e({...t,markdown:!0})}),FRt=BRt({mathematics:ARt()}),zRt=t=>{if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=O7e($Rt(uW(t)));return FRt.serialize(r).replaceAll(D7e,"\\$")},D7e="edgeever-dollar",O7e=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",D7e)}:t:Array.isArray(e.content)?{...e,content:e.content.map(O7e)}:t},uW=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=VRt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(uW)]}}return Array.isArray(e.content)?{...e,content:e.content.map(uW)}:t},VRt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""};var zue;function Ct(t,e,r){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),o._zod.traits.has(t))return;o._zod.traits.add(t),e(o,l);const u=a.prototype,h=Object.keys(u);for(let d=0;d{var l,u;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(t)}}),Object.defineProperty(a,"name",{value:t}),a}class Ib extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class P7e extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(zue=globalThis).__zod_globalConfig??(zue.__zod_globalConfig={});const hQ=globalThis.__zod_globalConfig;function v0(t){return hQ}function $7e(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function hW(t,e){return typeof e=="bigint"?e.toString():e}function xD(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function dQ(t){return t==null}function fQ(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function HRt(t,e){const r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){};function D6(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const WRt=xD(()=>{var t;if(hQ.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function p5(t){if(D6(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(D6(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function F7e(t){return p5(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const qRt=new Set(["string","number","symbol"]);function g5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jg(t,e,r){const n=new t._zod.constr(e??t._zod.def);return(!e||r!=null&&r.parent)&&(n._zod.parent=t),n}function _r(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function URt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const YRt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function jRt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Qg(t._zod.def,{get shape(){const a={};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(a[o]=r.shape[o])}return tv(this,"shape",a),a},checks:[]});return Jg(t,s)}function XRt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Qg(t._zod.def,{get shape(){const a={...t._zod.def.shape};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete a[o]}return tv(this,"shape",a),a},checks:[]});return Jg(t,s)}function KRt(t,e){if(!p5(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const s=t._zod.def.shape;for(const a in e)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Qg(t._zod.def,{get shape(){const s={...t._zod.def.shape,...e};return tv(this,"shape",s),s}});return Jg(t,i)}function ZRt(t,e){if(!p5(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Qg(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return tv(this,"shape",n),n}});return Jg(t,r)}function QRt(t,e){var n;if((n=t._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Qg(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return tv(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Jg(t,r)}function JRt(t,e,r){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Qg(e._zod.def,{get shape(){const o=e._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=t?new t({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=t?new t({type:"optional",innerType:o[u]}):o[u];return tv(this,"shape",l),l},checks:[]});return Jg(e,a)}function e9t(t,e,r){const n=Qg(e._zod.def,{get shape(){const i=e._zod.def.shape,s={...i};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new t({type:"nonoptional",innerType:i[a]}))}else for(const a in i)s[a]=new t({type:"nonoptional",innerType:i[a]});return tv(this,"shape",s),s}});return Jg(e,n)}function rb(t,e=0){var r;if(t.aborted===!0)return!0;for(let n=e;n{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function JA(t){return typeof t=="string"?t:t==null?void 0:t.message}function b0(t,e,r){var l,u,h,d,f,p;const n=t.message?t.message:JA((h=(u=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:h.call(u,t))??JA((d=e==null?void 0:e.error)==null?void 0:d.call(e,t))??JA((f=r.customError)==null?void 0:f.call(r,t))??JA((p=r.localeError)==null?void 0:p.call(r,t))??"Invalid input",{inst:i,continue:s,input:a,...o}=t;return o.path??(o.path=[]),o.message=n,e!=null&&e.reportInput&&(o.input=a),o}function pQ(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function O6(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const z7e=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,hW,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},V7e=Ct("$ZodError",z7e),H7e=Ct("$ZodError",z7e,{Parent:Error});function r9t(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function n9t(t,e=r=>r.message){const r={_errors:[]},n=(i,s=[])=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o},[...s,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...s,...a.path]);else{const o=[...s,...a.path];if(o.length===0)r._errors.push(e(a));else{let l=r,u=0;for(;u(e,r,n,i)=>{const s=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Ib;if(a.issues.length){const o=new((i==null?void 0:i.Err)??t)(a.issues.map(l=>b0(l,s,v0())));throw B7e(o,i==null?void 0:i.callee),o}return a.value},mQ=t=>async(e,r,n,i)=>{const s=n?{...n,async:!0}:{async:!0};let a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((i==null?void 0:i.Err)??t)(a.issues.map(l=>b0(l,s,v0())));throw B7e(o,i==null?void 0:i.callee),o}return a.value},wD=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Ib;return s.issues.length?{success:!1,error:new(t??V7e)(s.issues.map(a=>b0(a,i,v0())))}:{success:!0,data:s.value}},i9t=wD(H7e),TD=t=>async(e,r,n)=>{const i=n?{...n,async:!0}:{async:!0};let s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(a=>b0(a,i,v0())))}:{success:!0,data:s.value}},s9t=TD(H7e),a9t=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return gQ(t)(e,r,i)},o9t=t=>(e,r,n)=>gQ(t)(e,r,n),l9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return mQ(t)(e,r,i)},c9t=t=>async(e,r,n)=>mQ(t)(e,r,n),u9t=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return wD(t)(e,r,i)},h9t=t=>(e,r,n)=>wD(t)(e,r,n),d9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return TD(t)(e,r,i)},f9t=t=>async(e,r,n)=>TD(t)(e,r,n),p9t=/^[cC][0-9a-z]{6,}$/,g9t=/^[0-9a-z]+$/,m9t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,y9t=/^[0-9a-vA-V]{20}$/,v9t=/^[A-Za-z0-9]{27}$/,b9t=/^[a-zA-Z0-9_-]{21}$/,x9t=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,w9t=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Gue=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,T9t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,C9t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function k9t(){return new RegExp(C9t,"u")}const S9t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,E9t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,A9t=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,M9t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,R9t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,G7e=/^[A-Za-z0-9_-]*$/,_9t=/^https?$/,L9t=/^\+[1-9]\d{6,14}$/,W7e="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",I9t=new RegExp(`^${W7e}$`);function q7e(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function N9t(t){return new RegExp(`^${q7e(t)}$`)}function D9t(t){const e=q7e({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${r.join("|")})`;return new RegExp(`^${W7e}T(?:${n})$`)}const O9t=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},P9t=/^-?\d+$/,U7e=/^-?\d+(?:\.\d+)?$/,$9t=/^(?:true|false)$/i,B9t=/^[^A-Z]*$/,F9t=/^[^a-z]*$/,bc=Ct("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Y7e={number:"number",bigint:"bigint",object:"date"},j7e=Ct("$ZodCheckLessThan",(t,e)=>{bc.init(t,e);const r=Y7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{bc.init(t,e);const r=Y7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),z9t=Ct("$ZodCheckMultipleOf",(t,e)=>{bc.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):HRt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),V9t=Ct("$ZodCheckNumberFormat",(t,e)=>{var a;bc.init(t,e),e.format=e.format||"float64";const r=(a=e.format)==null?void 0:a.includes("int"),n=r?"int":"number",[i,s]=YRt[e.format];t._zod.onattach.push(o=>{const l=o._zod.bag;l.format=e.format,l.minimum=i,l.maximum=s,r&&(l.pattern=P9t)}),t._zod.check=o=>{const l=o.value;if(r){if(!Number.isInteger(l)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}ls&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),H9t=Ct("$ZodCheckMaxLength",(t,e)=>{var r;bc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!dQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const i=n.value;if(i.length<=e.maximum)return;const a=pQ(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),G9t=Ct("$ZodCheckMinLength",(t,e)=>{var r;bc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!dQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const i=n.value;if(i.length>=e.minimum)return;const a=pQ(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),W9t=Ct("$ZodCheckLengthEquals",(t,e)=>{var r;bc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!dQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{const i=n.value,s=i.length;if(s===e.length)return;const a=pQ(i),o=s>e.length;n.issues.push({origin:a,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),CD=Ct("$ZodCheckStringFormat",(t,e)=>{var r,n;bc.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),q9t=Ct("$ZodCheckRegex",(t,e)=>{CD.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),U9t=Ct("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=B9t),CD.init(t,e)}),Y9t=Ct("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=F9t),CD.init(t,e)}),j9t=Ct("$ZodCheckIncludes",(t,e)=>{bc.init(t,e);const r=g5(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),X9t=Ct("$ZodCheckStartsWith",(t,e)=>{bc.init(t,e);const r=new RegExp(`^${g5(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),K9t=Ct("$ZodCheckEndsWith",(t,e)=>{bc.init(t,e);const r=new RegExp(`.*${g5(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),Z9t=Ct("$ZodCheckOverwrite",(t,e)=>{bc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class Q9t{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(` `).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const e=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new e(...r,i.join(` -`))}}const H9t={major:4,minor:4,patch:3},Cs=Ct("$ZodType",(t,e)=>{var i;var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=H9t;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const s of n)for(const a of s._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const s=(o,l,u)=>{let h=eb(o),d;for(const f of l){if(f._zod.def.when){if(WRt(o)||!f._zod.def.when(o))continue}else if(h)continue;const p=o.issues.length,g=f._zod.check(o);if(g instanceof Promise&&(u==null?void 0:u.async)===!1)throw new _b;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,o.issues.length!==p&&(h||(h=eb(o,p)))});else{if(o.issues.length===p)continue;h||(h=eb(o,p))}}return d?d.then(()=>o):o},a=(o,l,u)=>{if(eb(o))return o.aborted=!0,o;const h=s(l,n,u);if(h instanceof Promise){if(u.async===!1)throw new _b;return h.then(d=>t._zod.parse(d,u))}return t._zod.parse(h,u)};t._zod.run=(o,l)=>{if(l.skipChecks)return t._zod.parse(o,l);if(l.direction==="backward"){const h=t._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(d=>a(d,o,l)):a(h,o,l)}const u=t._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new _b;return u.then(h=>s(h,n,l))}return s(u,n,l)}}bi(t,"~standard",()=>({validate:s=>{var a;try{const o=YRt(t,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return jRt(t,s).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),fQ=Ct("$ZodString",(t,e)=>{var r;Cs.init(t,e),t._zod.pattern=[...((r=t==null?void 0:t._zod.bag)==null?void 0:r.patterns)??[]].pop()??k9t(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),hs=Ct("$ZodStringFormat",(t,e)=>{xD.init(t,e),fQ.init(t,e)}),G9t=Ct("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=u9t),hs.init(t,e)}),W9t=Ct("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Fue(n))}else e.pattern??(e.pattern=Fue());hs.init(t,e)}),q9t=Ct("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=h9t),hs.init(t,e)}),U9t=Ct("$ZodURL",(t,e)=>{hs.init(t,e),t._zod.check=r=>{var n;try{const i=r.value.trim();if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===b9t.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}const s=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=s.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Y9t=Ct("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=f9t()),hs.init(t,e)}),j9t=Ct("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=l9t),hs.init(t,e)}),X9t=Ct("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=n9t),hs.init(t,e)}),K9t=Ct("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=i9t),hs.init(t,e)}),Z9t=Ct("$ZodULID",(t,e)=>{e.pattern??(e.pattern=s9t),hs.init(t,e)}),Q9t=Ct("$ZodXID",(t,e)=>{e.pattern??(e.pattern=a9t),hs.init(t,e)}),J9t=Ct("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=o9t),hs.init(t,e)}),e_t=Ct("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=C9t(e)),hs.init(t,e)}),t_t=Ct("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=w9t),hs.init(t,e)}),r_t=Ct("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=T9t(e)),hs.init(t,e)}),n_t=Ct("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=c9t),hs.init(t,e)}),i_t=Ct("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=p9t),hs.init(t,e),t._zod.bag.format="ipv4"}),s_t=Ct("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=g9t),hs.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),a_t=Ct("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=m9t),hs.init(t,e)}),o_t=Ct("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=y9t),hs.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,s]=n;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function W7e(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const l_t=Ct("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=v9t),hs.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{W7e(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function c_t(t){if(!$7e.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return W7e(r)}const u_t=Ct("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=$7e),hs.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{c_t(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),h_t=Ct("$ZodE164",(t,e)=>{e.pattern??(e.pattern=x9t),hs.init(t,e)});function d_t(t,e=null){try{const r=t.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const f_t=Ct("$ZodJWT",(t,e)=>{hs.init(t,e),t._zod.check=r=>{d_t(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),q7e=Ct("$ZodNumber",(t,e)=>{Cs.init(t,e),t._zod.pattern=t._zod.bag.pattern??z7e,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),p_t=Ct("$ZodNumberFormat",(t,e)=>{_9t.init(t,e),q7e.init(t,e)}),g_t=Ct("$ZodBoolean",(t,e)=>{Cs.init(t,e),t._zod.pattern=E9t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),m_t=Ct("$ZodUnknown",(t,e)=>{Cs.init(t,e),t._zod.parse=r=>r}),y_t=Ct("$ZodNever",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function zue(t,e,r){t.issues.length&&e.issues.push(...tb(r,t.issues)),e.value[r]=t.value}const v_t=Ct("$ZodArray",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);const s=[];for(let a=0;azue(u,r,a))):zue(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function Z_(t,e,r,n,i,s){const a=r in n;if(t.issues.length){if(i&&s&&!a)return;e.issues.push(...tb(r,t.issues))}if(!a&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?a&&(e.value[r]=void 0):e.value[r]=t.value}function U7e(t){var n,i,s,a;const e=Object.keys(t.shape);for(const o of e)if(!((a=(s=(i=(n=t.shape)==null?void 0:n[o])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=ORt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Y7e(t,e,r,n,i,s){const a=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,h=l.optin==="optional",d=l.optout==="optional";for(const f in e){if(f==="__proto__"||o.has(f))continue;if(u==="never"){a.push(f);continue}const p=l.run({value:e[f],issues:[]},n);p instanceof Promise?t.push(p.then(g=>Z_(g,r,f,e,h,d))):Z_(p,r,f,e,h,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}const b_t=Ct("$ZodObject",(t,e)=>{Cs.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape");if(!(r!=null&&r.get)){const o=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...o};return Object.defineProperty(e,"shape",{value:l}),l}})}const n=yD(()=>U7e(e));bi(t._zod,"propValues",()=>{const o=e.shape,l={};for(const u in o){const h=o[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(const d of h.values)l[u].add(d)}}return l});const i=L6,s=e.catchall;let a;t._zod.parse=(o,l)=>{a??(a=n.value);const u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),o;o.value={};const h=[],d=a.shape;for(const f of a.keys){const p=d[f],g=p._zod.optin==="optional",m=p._zod.optout==="optional",y=p._zod.run({value:u[f],issues:[]},l);y instanceof Promise?h.push(y.then(v=>Z_(v,o,f,u,g,m))):Z_(y,o,f,u,g,m)}return s?Y7e(h,u,o,l,n.value,t):h.length?Promise.all(h).then(()=>o):o}}),x_t=Ct("$ZodObjectJIT",(t,e)=>{b_t.init(t,e);const r=t._zod.parse,n=yD(()=>U7e(e)),i=f=>{var b,T;const p=new V9t(["shape","payload","ctx"]),g=n.value,m=C=>{const S=Bue(C);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let v=0;for(const C of g.keys)y[C]=`key_${v++}`;p.write("const newResult = {};");for(const C of g.keys){const S=y[C],k=Bue(C),E=f[C],A=((b=E==null?void 0:E._zod)==null?void 0:b.optin)==="optional",R=((T=E==null?void 0:E._zod)==null?void 0:T.optout)==="optional";p.write(`const ${S} = ${m(C)};`),A&&R?p.write(` +`))}}const J9t={major:4,minor:4,patch:3},Cs=Ct("$ZodType",(t,e)=>{var i;var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=J9t;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const s of n)for(const a of s._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const s=(o,l,u)=>{let h=rb(o),d;for(const f of l){if(f._zod.def.when){if(t9t(o)||!f._zod.def.when(o))continue}else if(h)continue;const p=o.issues.length,g=f._zod.check(o);if(g instanceof Promise&&(u==null?void 0:u.async)===!1)throw new Ib;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,o.issues.length!==p&&(h||(h=rb(o,p)))});else{if(o.issues.length===p)continue;h||(h=rb(o,p))}}return d?d.then(()=>o):o},a=(o,l,u)=>{if(rb(o))return o.aborted=!0,o;const h=s(l,n,u);if(h instanceof Promise){if(u.async===!1)throw new Ib;return h.then(d=>t._zod.parse(d,u))}return t._zod.parse(h,u)};t._zod.run=(o,l)=>{if(l.skipChecks)return t._zod.parse(o,l);if(l.direction==="backward"){const h=t._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(d=>a(d,o,l)):a(h,o,l)}const u=t._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new Ib;return u.then(h=>s(h,n,l))}return s(u,n,l)}}bi(t,"~standard",()=>({validate:s=>{var a;try{const o=i9t(t,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return s9t(t,s).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),yQ=Ct("$ZodString",(t,e)=>{var r;Cs.init(t,e),t._zod.pattern=[...((r=t==null?void 0:t._zod.bag)==null?void 0:r.patterns)??[]].pop()??O9t(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),hs=Ct("$ZodStringFormat",(t,e)=>{CD.init(t,e),yQ.init(t,e)}),e_t=Ct("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=w9t),hs.init(t,e)}),t_t=Ct("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Gue(n))}else e.pattern??(e.pattern=Gue());hs.init(t,e)}),r_t=Ct("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=T9t),hs.init(t,e)}),n_t=Ct("$ZodURL",(t,e)=>{hs.init(t,e),t._zod.check=r=>{var n;try{const i=r.value.trim();if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===_9t.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}const s=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=s.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),i_t=Ct("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=k9t()),hs.init(t,e)}),s_t=Ct("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=b9t),hs.init(t,e)}),a_t=Ct("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=p9t),hs.init(t,e)}),o_t=Ct("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=g9t),hs.init(t,e)}),l_t=Ct("$ZodULID",(t,e)=>{e.pattern??(e.pattern=m9t),hs.init(t,e)}),c_t=Ct("$ZodXID",(t,e)=>{e.pattern??(e.pattern=y9t),hs.init(t,e)}),u_t=Ct("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=v9t),hs.init(t,e)}),h_t=Ct("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=D9t(e)),hs.init(t,e)}),d_t=Ct("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=I9t),hs.init(t,e)}),f_t=Ct("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=N9t(e)),hs.init(t,e)}),p_t=Ct("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=x9t),hs.init(t,e)}),g_t=Ct("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=S9t),hs.init(t,e),t._zod.bag.format="ipv4"}),m_t=Ct("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=E9t),hs.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),y_t=Ct("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=A9t),hs.init(t,e)}),v_t=Ct("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=M9t),hs.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,s]=n;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function K7e(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const b_t=Ct("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=R9t),hs.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{K7e(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function x_t(t){if(!G7e.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return K7e(r)}const w_t=Ct("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=G7e),hs.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{x_t(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),T_t=Ct("$ZodE164",(t,e)=>{e.pattern??(e.pattern=L9t),hs.init(t,e)});function C_t(t,e=null){try{const r=t.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const k_t=Ct("$ZodJWT",(t,e)=>{hs.init(t,e),t._zod.check=r=>{C_t(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Z7e=Ct("$ZodNumber",(t,e)=>{Cs.init(t,e),t._zod.pattern=t._zod.bag.pattern??U7e,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),S_t=Ct("$ZodNumberFormat",(t,e)=>{V9t.init(t,e),Z7e.init(t,e)}),E_t=Ct("$ZodBoolean",(t,e)=>{Cs.init(t,e),t._zod.pattern=$9t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),A_t=Ct("$ZodUnknown",(t,e)=>{Cs.init(t,e),t._zod.parse=r=>r}),M_t=Ct("$ZodNever",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function Wue(t,e,r){t.issues.length&&e.issues.push(...nb(r,t.issues)),e.value[r]=t.value}const R_t=Ct("$ZodArray",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);const s=[];for(let a=0;aWue(u,r,a))):Wue(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function tL(t,e,r,n,i,s){const a=r in n;if(t.issues.length){if(i&&s&&!a)return;e.issues.push(...nb(r,t.issues))}if(!a&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?a&&(e.value[r]=void 0):e.value[r]=t.value}function Q7e(t){var n,i,s,a;const e=Object.keys(t.shape);for(const o of e)if(!((a=(s=(i=(n=t.shape)==null?void 0:n[o])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=URt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function J7e(t,e,r,n,i,s){const a=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,h=l.optin==="optional",d=l.optout==="optional";for(const f in e){if(f==="__proto__"||o.has(f))continue;if(u==="never"){a.push(f);continue}const p=l.run({value:e[f],issues:[]},n);p instanceof Promise?t.push(p.then(g=>tL(g,r,f,e,h,d))):tL(p,r,f,e,h,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}const __t=Ct("$ZodObject",(t,e)=>{Cs.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape");if(!(r!=null&&r.get)){const o=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...o};return Object.defineProperty(e,"shape",{value:l}),l}})}const n=xD(()=>Q7e(e));bi(t._zod,"propValues",()=>{const o=e.shape,l={};for(const u in o){const h=o[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(const d of h.values)l[u].add(d)}}return l});const i=D6,s=e.catchall;let a;t._zod.parse=(o,l)=>{a??(a=n.value);const u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),o;o.value={};const h=[],d=a.shape;for(const f of a.keys){const p=d[f],g=p._zod.optin==="optional",m=p._zod.optout==="optional",y=p._zod.run({value:u[f],issues:[]},l);y instanceof Promise?h.push(y.then(v=>tL(v,o,f,u,g,m))):tL(y,o,f,u,g,m)}return s?J7e(h,u,o,l,n.value,t):h.length?Promise.all(h).then(()=>o):o}}),L_t=Ct("$ZodObjectJIT",(t,e)=>{__t.init(t,e);const r=t._zod.parse,n=xD(()=>Q7e(e)),i=f=>{var b,T;const p=new Q9t(["shape","payload","ctx"]),g=n.value,m=C=>{const S=Hue(C);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let v=0;for(const C of g.keys)y[C]=`key_${v++}`;p.write("const newResult = {};");for(const C of g.keys){const S=y[C],k=Hue(C),E=f[C],A=((b=E==null?void 0:E._zod)==null?void 0:b.optin)==="optional",R=((T=E==null?void 0:E._zod)==null?void 0:T.optout)==="optional";p.write(`const ${S} = ${m(C)};`),A&&R?p.write(` if (${S}.issues.length) { if (${k} in input) { payload.issues = payload.issues.concat(${S}.issues.map(iss => ({ @@ -1511,9 +1518,9 @@ ${JSON.stringify(t)} } } - `)}p.write("payload.value = newResult;"),p.write("return payload;");const x=p.compile();return(C,S)=>x(f,C,S)};let s;const a=L6,o=!oQ.jitless,u=o&&NRt.value,h=e.catchall;let d;t._zod.parse=(f,p)=>{d??(d=n.value);const g=f.value;return a(g)?o&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(s||(s=i(e.shape)),f=s(f,p),h?Y7e([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)}});function Vue(t,e,r,n){for(const s of t)if(s.issues.length===0)return e.value=s.value,e;const i=t.filter(s=>!eb(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(a=>p0(a,n,f0())))}),e)}const j7e=Ct("$ZodUnion",(t,e)=>{Cs.init(t,e),bi(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),bi(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),bi(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),bi(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>cQ(i.source)).join("|")})$`)}});const r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1;const a=[];for(const o of e.options){const l=o._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(o=>Vue(o,n,t,i)):Vue(a,n,t,i)}}),w_t=Ct("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,j7e.init(t,e);const r=t._zod.parse;bi(t._zod,"propValues",()=>{const i={};for(const s of e.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[o,l]of Object.entries(a)){i[o]||(i[o]=new Set);for(const u of l)i[o].add(u)}}return i});const n=yD(()=>{var a;const i=e.options,s=new Map;for(const o of i){const l=(a=o._zod.propValues)==null?void 0:a[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,o)}}return s});t._zod.parse=(i,s)=>{const a=i.value;if(!L6(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=n.value.get(a==null?void 0:a[e.discriminator]);return o?o._zod.run(i,s):e.unionFallback||s.direction==="backward"?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:a,path:[e.discriminator],inst:t}),i)}}),T_t=Ct("$ZodIntersection",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,s=e.left._zod.run({value:i,issues:[]},n),a=e.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([l,u])=>Hue(r,l,u)):Hue(r,s,a)}});function lW(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(d5(t)&&d5(e)){const r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};for(const s of n){const a=lW(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;no.l&&o.r).map(([o])=>o);if(s.length&&i&&t.issues.push({...i,keys:s}),eb(t))return t;const a=lW(e.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}const C_t=Ct("$ZodRecord",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!d5(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const s=[],a=e.keyType._zod.values;if(a){r.value={};const o=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){o.add(typeof u=="number"?u.toString():u);const h=e.keyType._zod.run({value:u,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(p=>p0(p,n,f0())),input:u,path:[u],inst:t});continue}const d=h.value,f=e.valueType._zod.run({value:i[u],issues:[]},n);f instanceof Promise?s.push(f.then(p=>{p.issues.length&&r.issues.push(...tb(u,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...tb(u,f.issues)),r.value[d]=f.value)}let l;for(const u in i)o.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(const o of Reflect.ownKeys(i)){if(o==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof o=="string"&&z7e.test(o)&&l.issues.length){const d=e.keyType._zod.run({value:Number(o),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){e.mode==="loose"?r.value[o]=i[o]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>p0(d,n,f0())),input:o,path:[o],inst:t});continue}const h=e.valueType._zod.run({value:i[o],issues:[]},n);h instanceof Promise?s.push(h.then(d=>{d.issues.length&&r.issues.push(...tb(o,d.issues)),r.value[l.value]=d.value})):(h.issues.length&&r.issues.push(...tb(o,h.issues)),r.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}}),k_t=Ct("$ZodEnum",(t,e)=>{Cs.init(t,e);const r=L7e(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>DRt.has(typeof i)).map(i=>typeof i=="string"?f5(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{const a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:t}),i}}),S_t=Ct("$ZodLiteral",(t,e)=>{if(Cs.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?f5(n):n?f5(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}}),E_t=Ct("$ZodTransform",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _7e(t.constructor.name);const i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r.fallback=!0,r));if(i instanceof Promise)throw new _b;return r.value=i,r.fallback=!0,r}});function Gue(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const X7e=Ct("$ZodOptional",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",t._zod.optout="optional",bi(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),bi(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${cQ(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){const i=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>Gue(a,i)):Gue(s,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),A_t=Ct("$ZodExactOptional",(t,e)=>{X7e.init(t,e),bi(t._zod,"values",()=>e.innerType._zod.values),bi(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),M_t=Ct("$ZodNullable",(t,e)=>{Cs.init(t,e),bi(t._zod,"optin",()=>e.innerType._zod.optin),bi(t._zod,"optout",()=>e.innerType._zod.optout),bi(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${cQ(r.source)}|null)$`):void 0}),bi(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),R_t=Ct("$ZodDefault",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",bi(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Wue(s,e)):Wue(i,e)}});function Wue(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const __t=Ct("$ZodPrefault",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",bi(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),L_t=Ct("$ZodNonOptional",(t,e)=>{Cs.init(t,e),bi(t._zod,"values",()=>{const r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>que(s,t)):que(i,t)}});function que(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const I_t=Ct("$ZodCatch",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",bi(t._zod,"optout",()=>e.innerType._zod.optout),bi(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(a=>p0(a,n,f0()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(s=>p0(s,n,f0()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),N_t=Ct("$ZodPipe",(t,e)=>{Cs.init(t,e),bi(t._zod,"values",()=>e.in._zod.values),bi(t._zod,"optin",()=>e.in._zod.optin),bi(t._zod,"optout",()=>e.out._zod.optout),bi(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=e.out._zod.run(r,n);return s instanceof Promise?s.then(a=>ZA(a,e.in,n)):ZA(s,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>ZA(s,e.out,n)):ZA(i,e.out,n)}});function ZA(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}const D_t=Ct("$ZodReadonly",(t,e)=>{Cs.init(t,e),bi(t._zod,"propValues",()=>e.innerType._zod.propValues),bi(t._zod,"values",()=>e.innerType._zod.values),bi(t._zod,"optin",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),bi(t._zod,"optout",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Uue):Uue(i)}});function Uue(t){return t.value=Object.freeze(t.value),t}const O_t=Ct("$ZodCustom",(t,e)=>{mc.init(t,e),Cs.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{const n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>Yue(s,r,n,t));Yue(i,r,n,t)}});function Yue(t,e,r,n){if(!t){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(I6(i))}}var jue;class P_t{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){const n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){const r=e._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function $_t(){return new P_t}(jue=globalThis).__zod_globalRegistry??(jue.__zod_globalRegistry=$_t());const QC=globalThis.__zod_globalRegistry;function B_t(t,e){return new t({type:"string",..._r(e)})}function F_t(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,..._r(e)})}function Xue(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,..._r(e)})}function z_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,..._r(e)})}function V_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._r(e)})}function H_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._r(e)})}function G_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._r(e)})}function W_t(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,..._r(e)})}function q_t(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,..._r(e)})}function U_t(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,..._r(e)})}function Y_t(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,..._r(e)})}function j_t(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,..._r(e)})}function X_t(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,..._r(e)})}function K_t(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,..._r(e)})}function Z_t(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,..._r(e)})}function Q_t(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,..._r(e)})}function J_t(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,..._r(e)})}function eLt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._r(e)})}function tLt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._r(e)})}function rLt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,..._r(e)})}function nLt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,..._r(e)})}function iLt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,..._r(e)})}function sLt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,..._r(e)})}function aLt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._r(e)})}function oLt(t,e){return new t({type:"string",format:"date",check:"string_format",..._r(e)})}function lLt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,..._r(e)})}function cLt(t,e){return new t({type:"string",format:"duration",check:"string_format",..._r(e)})}function uLt(t,e){return new t({type:"number",checks:[],..._r(e)})}function hLt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",..._r(e)})}function dLt(t,e){return new t({type:"boolean",..._r(e)})}function fLt(t){return new t({type:"unknown"})}function pLt(t,e){return new t({type:"never",..._r(e)})}function Kue(t,e){return new H7e({check:"less_than",..._r(e),value:t,inclusive:!1})}function mB(t,e){return new H7e({check:"less_than",..._r(e),value:t,inclusive:!0})}function Zue(t,e){return new G7e({check:"greater_than",..._r(e),value:t,inclusive:!1})}function yB(t,e){return new G7e({check:"greater_than",..._r(e),value:t,inclusive:!0})}function Que(t,e){return new R9t({check:"multiple_of",..._r(e),value:t})}function K7e(t,e){return new L9t({check:"max_length",..._r(e),maximum:t})}function Q_(t,e){return new I9t({check:"min_length",..._r(e),minimum:t})}function Z7e(t,e){return new N9t({check:"length_equals",..._r(e),length:t})}function gLt(t,e){return new D9t({check:"string_format",format:"regex",..._r(e),pattern:t})}function mLt(t){return new O9t({check:"string_format",format:"lowercase",..._r(t)})}function yLt(t){return new P9t({check:"string_format",format:"uppercase",..._r(t)})}function vLt(t,e){return new $9t({check:"string_format",format:"includes",..._r(e),includes:t})}function bLt(t,e){return new B9t({check:"string_format",format:"starts_with",..._r(e),prefix:t})}function xLt(t,e){return new F9t({check:"string_format",format:"ends_with",..._r(e),suffix:t})}function u3(t){return new z9t({check:"overwrite",tx:t})}function wLt(t){return u3(e=>e.normalize(t))}function TLt(){return u3(t=>t.trim())}function CLt(){return u3(t=>t.toLowerCase())}function kLt(){return u3(t=>t.toUpperCase())}function SLt(){return u3(t=>IRt(t))}function ELt(t,e,r){return new t({type:"array",element:e,..._r(r)})}function ALt(t,e,r){return new t({type:"custom",check:"custom",fn:e,..._r(r)})}function MLt(t,e){const r=RLt(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(I6(i,n.value,r._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(I6(s))}},t(n.value,n)),e);return r}function RLt(t,e){const r=new mc({check:"custom",..._r(e)});return r._zod.check=t,r}function Q7e(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??QC,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function ha(t,e,r={path:[],schemaPath:[]}){var h,d;var n;const i=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a);const o=(d=(h=t._zod).toJSONSchema)==null?void 0:d.call(h);if(o)a.schema=o;else{const f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,f);else{const g=a.schema,m=e.processors[i.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);m(t,e,g,f)}const p=t._zod.parent;p&&(a.ref||(a.ref=p),ha(p,e,f),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&Object.assign(a.schema,l),e.io==="input"&&sl(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function J7e(t,e){var a,o,l,u;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const h of t.seen.entries()){const d=(a=t.metadataRegistry.get(h[0]))==null?void 0:a.id;if(d){const f=n.get(d);if(f&&f!==h[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(d,h[0])}}const i=h=>{var m;const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const y=(m=t.external.registry.get(h[0]))==null?void 0:m.id,v=t.external.uri??(b=>b);if(y)return{ref:v(y)};const x=h[1].defId??h[1].schema.id??`schema${t.counter++}`;return h[1].defId=x,{defId:x,ref:`${v("__shared")}#/${d}/${x}`}}if(h[1]===r)return{ref:"#"};const p=`#/${d}/`,g=h[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:p+g}},s=h=>{if(h[1].schema.$ref)return;const d=h[1],{ref:f,defId:p}=i(h);d.def={...d.schema},p&&(d.defId=p);const g=d.schema;for(const m in g)delete g[m];g.$ref=f};if(t.cycles==="throw")for(const h of t.seen.entries()){const d=h[1];if(d.cycle)throw new Error(`Cycle detected: #/${(o=d.cycle)==null?void 0:o.join("/")}/ + `)}p.write("payload.value = newResult;"),p.write("return payload;");const x=p.compile();return(C,S)=>x(f,C,S)};let s;const a=D6,o=!hQ.jitless,u=o&&WRt.value,h=e.catchall;let d;t._zod.parse=(f,p)=>{d??(d=n.value);const g=f.value;return a(g)?o&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(s||(s=i(e.shape)),f=s(f,p),h?J7e([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)}});function que(t,e,r,n){for(const s of t)if(s.issues.length===0)return e.value=s.value,e;const i=t.filter(s=>!rb(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(a=>b0(a,n,v0())))}),e)}const eAe=Ct("$ZodUnion",(t,e)=>{Cs.init(t,e),bi(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),bi(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),bi(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),bi(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>fQ(i.source)).join("|")})$`)}});const r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1;const a=[];for(const o of e.options){const l=o._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(o=>que(o,n,t,i)):que(a,n,t,i)}}),I_t=Ct("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,eAe.init(t,e);const r=t._zod.parse;bi(t._zod,"propValues",()=>{const i={};for(const s of e.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[o,l]of Object.entries(a)){i[o]||(i[o]=new Set);for(const u of l)i[o].add(u)}}return i});const n=xD(()=>{var a;const i=e.options,s=new Map;for(const o of i){const l=(a=o._zod.propValues)==null?void 0:a[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,o)}}return s});t._zod.parse=(i,s)=>{const a=i.value;if(!D6(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=n.value.get(a==null?void 0:a[e.discriminator]);return o?o._zod.run(i,s):e.unionFallback||s.direction==="backward"?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:a,path:[e.discriminator],inst:t}),i)}}),N_t=Ct("$ZodIntersection",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,s=e.left._zod.run({value:i,issues:[]},n),a=e.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([l,u])=>Uue(r,l,u)):Uue(r,s,a)}});function dW(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(p5(t)&&p5(e)){const r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};for(const s of n){const a=dW(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;no.l&&o.r).map(([o])=>o);if(s.length&&i&&t.issues.push({...i,keys:s}),rb(t))return t;const a=dW(e.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}const D_t=Ct("$ZodRecord",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!p5(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const s=[],a=e.keyType._zod.values;if(a){r.value={};const o=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){o.add(typeof u=="number"?u.toString():u);const h=e.keyType._zod.run({value:u,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(p=>b0(p,n,v0())),input:u,path:[u],inst:t});continue}const d=h.value,f=e.valueType._zod.run({value:i[u],issues:[]},n);f instanceof Promise?s.push(f.then(p=>{p.issues.length&&r.issues.push(...nb(u,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...nb(u,f.issues)),r.value[d]=f.value)}let l;for(const u in i)o.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(const o of Reflect.ownKeys(i)){if(o==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof o=="string"&&U7e.test(o)&&l.issues.length){const d=e.keyType._zod.run({value:Number(o),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){e.mode==="loose"?r.value[o]=i[o]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>b0(d,n,v0())),input:o,path:[o],inst:t});continue}const h=e.valueType._zod.run({value:i[o],issues:[]},n);h instanceof Promise?s.push(h.then(d=>{d.issues.length&&r.issues.push(...nb(o,d.issues)),r.value[l.value]=d.value})):(h.issues.length&&r.issues.push(...nb(o,h.issues)),r.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}}),O_t=Ct("$ZodEnum",(t,e)=>{Cs.init(t,e);const r=$7e(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>qRt.has(typeof i)).map(i=>typeof i=="string"?g5(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{const a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:t}),i}}),P_t=Ct("$ZodLiteral",(t,e)=>{if(Cs.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?g5(n):n?g5(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}}),$_t=Ct("$ZodTransform",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new P7e(t.constructor.name);const i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r.fallback=!0,r));if(i instanceof Promise)throw new Ib;return r.value=i,r.fallback=!0,r}});function Yue(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const tAe=Ct("$ZodOptional",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",t._zod.optout="optional",bi(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),bi(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${fQ(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){const i=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>Yue(a,i)):Yue(s,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),B_t=Ct("$ZodExactOptional",(t,e)=>{tAe.init(t,e),bi(t._zod,"values",()=>e.innerType._zod.values),bi(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),F_t=Ct("$ZodNullable",(t,e)=>{Cs.init(t,e),bi(t._zod,"optin",()=>e.innerType._zod.optin),bi(t._zod,"optout",()=>e.innerType._zod.optout),bi(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${fQ(r.source)}|null)$`):void 0}),bi(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),z_t=Ct("$ZodDefault",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",bi(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>jue(s,e)):jue(i,e)}});function jue(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const V_t=Ct("$ZodPrefault",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",bi(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),H_t=Ct("$ZodNonOptional",(t,e)=>{Cs.init(t,e),bi(t._zod,"values",()=>{const r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Xue(s,t)):Xue(i,t)}});function Xue(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const G_t=Ct("$ZodCatch",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",bi(t._zod,"optout",()=>e.innerType._zod.optout),bi(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(a=>b0(a,n,v0()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(s=>b0(s,n,v0()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),W_t=Ct("$ZodPipe",(t,e)=>{Cs.init(t,e),bi(t._zod,"values",()=>e.in._zod.values),bi(t._zod,"optin",()=>e.in._zod.optin),bi(t._zod,"optout",()=>e.out._zod.optout),bi(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=e.out._zod.run(r,n);return s instanceof Promise?s.then(a=>e8(a,e.in,n)):e8(s,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>e8(s,e.out,n)):e8(i,e.out,n)}});function e8(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}const q_t=Ct("$ZodReadonly",(t,e)=>{Cs.init(t,e),bi(t._zod,"propValues",()=>e.innerType._zod.propValues),bi(t._zod,"values",()=>e.innerType._zod.values),bi(t._zod,"optin",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),bi(t._zod,"optout",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Kue):Kue(i)}});function Kue(t){return t.value=Object.freeze(t.value),t}const U_t=Ct("$ZodCustom",(t,e)=>{bc.init(t,e),Cs.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{const n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>Zue(s,r,n,t));Zue(i,r,n,t)}});function Zue(t,e,r,n){if(!t){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(O6(i))}}var Que;class Y_t{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){const n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){const r=e._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function j_t(){return new Y_t}(Que=globalThis).__zod_globalRegistry??(Que.__zod_globalRegistry=j_t());const tk=globalThis.__zod_globalRegistry;function X_t(t,e){return new t({type:"string",..._r(e)})}function K_t(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,..._r(e)})}function Jue(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,..._r(e)})}function Z_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,..._r(e)})}function Q_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._r(e)})}function J_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._r(e)})}function eLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._r(e)})}function tLt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,..._r(e)})}function rLt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,..._r(e)})}function nLt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,..._r(e)})}function iLt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,..._r(e)})}function sLt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,..._r(e)})}function aLt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,..._r(e)})}function oLt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,..._r(e)})}function lLt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,..._r(e)})}function cLt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,..._r(e)})}function uLt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,..._r(e)})}function hLt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._r(e)})}function dLt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._r(e)})}function fLt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,..._r(e)})}function pLt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,..._r(e)})}function gLt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,..._r(e)})}function mLt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,..._r(e)})}function yLt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._r(e)})}function vLt(t,e){return new t({type:"string",format:"date",check:"string_format",..._r(e)})}function bLt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,..._r(e)})}function xLt(t,e){return new t({type:"string",format:"duration",check:"string_format",..._r(e)})}function wLt(t,e){return new t({type:"number",checks:[],..._r(e)})}function TLt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",..._r(e)})}function CLt(t,e){return new t({type:"boolean",..._r(e)})}function kLt(t){return new t({type:"unknown"})}function SLt(t,e){return new t({type:"never",..._r(e)})}function ehe(t,e){return new j7e({check:"less_than",..._r(e),value:t,inclusive:!1})}function bB(t,e){return new j7e({check:"less_than",..._r(e),value:t,inclusive:!0})}function the(t,e){return new X7e({check:"greater_than",..._r(e),value:t,inclusive:!1})}function xB(t,e){return new X7e({check:"greater_than",..._r(e),value:t,inclusive:!0})}function rhe(t,e){return new z9t({check:"multiple_of",..._r(e),value:t})}function rAe(t,e){return new H9t({check:"max_length",..._r(e),maximum:t})}function rL(t,e){return new G9t({check:"min_length",..._r(e),minimum:t})}function nAe(t,e){return new W9t({check:"length_equals",..._r(e),length:t})}function ELt(t,e){return new q9t({check:"string_format",format:"regex",..._r(e),pattern:t})}function ALt(t){return new U9t({check:"string_format",format:"lowercase",..._r(t)})}function MLt(t){return new Y9t({check:"string_format",format:"uppercase",..._r(t)})}function RLt(t,e){return new j9t({check:"string_format",format:"includes",..._r(e),includes:t})}function _Lt(t,e){return new X9t({check:"string_format",format:"starts_with",..._r(e),prefix:t})}function LLt(t,e){return new K9t({check:"string_format",format:"ends_with",..._r(e),suffix:t})}function f3(t){return new Z9t({check:"overwrite",tx:t})}function ILt(t){return f3(e=>e.normalize(t))}function NLt(){return f3(t=>t.trim())}function DLt(){return f3(t=>t.toLowerCase())}function OLt(){return f3(t=>t.toUpperCase())}function PLt(){return f3(t=>GRt(t))}function $Lt(t,e,r){return new t({type:"array",element:e,..._r(r)})}function BLt(t,e,r){return new t({type:"custom",check:"custom",fn:e,..._r(r)})}function FLt(t,e){const r=zLt(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(O6(i,n.value,r._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(O6(s))}},t(n.value,n)),e);return r}function zLt(t,e){const r=new bc({check:"custom",..._r(e)});return r._zod.check=t,r}function iAe(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??tk,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function ha(t,e,r={path:[],schemaPath:[]}){var h,d;var n;const i=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a);const o=(d=(h=t._zod).toJSONSchema)==null?void 0:d.call(h);if(o)a.schema=o;else{const f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,f);else{const g=a.schema,m=e.processors[i.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);m(t,e,g,f)}const p=t._zod.parent;p&&(a.ref||(a.ref=p),ha(p,e,f),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&Object.assign(a.schema,l),e.io==="input"&&sl(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function sAe(t,e){var a,o,l,u;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const h of t.seen.entries()){const d=(a=t.metadataRegistry.get(h[0]))==null?void 0:a.id;if(d){const f=n.get(d);if(f&&f!==h[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(d,h[0])}}const i=h=>{var m;const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const y=(m=t.external.registry.get(h[0]))==null?void 0:m.id,v=t.external.uri??(b=>b);if(y)return{ref:v(y)};const x=h[1].defId??h[1].schema.id??`schema${t.counter++}`;return h[1].defId=x,{defId:x,ref:`${v("__shared")}#/${d}/${x}`}}if(h[1]===r)return{ref:"#"};const p=`#/${d}/`,g=h[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:p+g}},s=h=>{if(h[1].schema.$ref)return;const d=h[1],{ref:f,defId:p}=i(h);d.def={...d.schema},p&&(d.defId=p);const g=d.schema;for(const m in g)delete g[m];g.$ref=f};if(t.cycles==="throw")for(const h of t.seen.entries()){const d=h[1];if(d.cycle)throw new Error(`Cycle detected: #/${(o=d.cycle)==null?void 0:o.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of t.seen.entries()){const d=h[1];if(e===h[0]){s(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){s(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){s(h);continue}if(d.cycle){s(h);continue}if(d.count>1&&t.reused==="ref"){s(h);continue}}}function eAe(t,e){var o,l,u,h;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=d=>{const f=t.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,g={...p},m=f.ref;if(f.ref=null,m){n(m);const v=t.seen.get(m),x=v.schema;if(x.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(x.$ref&&v.def)for(const T in p)T==="$ref"||T==="allOf"||T in v.def&&JSON.stringify(p[T])===JSON.stringify(v.def[T])&&delete p[T]}const y=d._zod.parent;if(y&&y!==m){n(y);const v=t.seen.get(y);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...t.seen.entries()].reverse())n(d[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(o=t.external)!=null&&o.uri){const d=(l=t.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(d)}Object.assign(i,r.def??r.schema);const s=(u=t.metadataRegistry.get(e))==null?void 0:u.id;s!==void 0&&i.id===s&&delete i.id;const a=((h=t.external)==null?void 0:h.defs)??{};for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,a[f.defId]=f.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:J_(e,"input",t.processors),output:J_(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function sl(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return sl(n.element,r);if(n.type==="set")return sl(n.valueType,r);if(n.type==="lazy")return sl(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return sl(n.innerType,r);if(n.type==="intersection")return sl(n.left,r)||sl(n.right,r);if(n.type==="record"||n.type==="map")return sl(n.keyType,r)||sl(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:sl(n.in,r)||sl(n.out,r);if(n.type==="object"){for(const i in n.shape)if(sl(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(sl(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(sl(i,r))return!0;return!!(n.rest&&sl(n.rest,r))}return!1}const _Lt=(t,e={})=>r=>{const n=Q7e({...r,processors:e});return ha(t,n),J7e(n,t),eAe(n,t)},J_=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=Q7e({...i??{},target:s,io:e,processors:r});return ha(t,a),J7e(a,t),eAe(a,t)},LLt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ILt=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=LLt[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},NLt=(t,e,r,n)=>{const i=r,{minimum:s,maximum:a,format:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const d=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},DLt=(t,e,r,n)=>{r.type="boolean"},OLt=(t,e,r,n)=>{r.not={}},PLt=(t,e,r,n)=>{},$Lt=(t,e,r,n)=>{const i=t._zod.def,s=L7e(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},BLt=(t,e,r,n)=>{const i=t._zod.def,s=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},FLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},VLt=(t,e,r,n)=>{const i=r,s=t._zod.def,{minimum:a,maximum:o}=t._zod.bag;typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=ha(s.element,e,{...n,path:[...n.path,"items"]})},HLt=(t,e,r,n)=>{var u;const i=r,s=t._zod.def;i.type="object",i.properties={};const a=s.shape;for(const h in a)i.properties[h]=ha(a[h],e,{...n,path:[...n.path,"properties",h]});const o=new Set(Object.keys(a)),l=new Set([...o].filter(h=>{const d=s.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=ha(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},GLt=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>ha(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},WLt=(t,e,r,n)=>{const i=t._zod.def,s=ha(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=ha(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]];r.allOf=l},qLt=(t,e,r,n)=>{const i=r,s=t._zod.def;i.type="object";const a=s.keyType,o=a._zod.bag,l=o==null?void 0:o.patterns;if(s.mode==="loose"&&l&&l.size>0){const h=ha(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const d of l)i.patternProperties[d.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=ha(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ha(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});const u=a._zod.values;if(u){const h=[...u].filter(d=>typeof d=="string"||typeof d=="number");h.length>0&&(i.required=h)}},ULt=(t,e,r,n)=>{const i=t._zod.def,s=ha(i.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},YLt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},jLt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},XLt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},KLt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},ZLt=(t,e,r,n)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?s?i.out:i.in:i.out;ha(a,e,n);const o=e.seen.get(t);o.ref=a},QLt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},tAe=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},JLt=Ct("ZodISODateTime",(t,e)=>{e_t.init(t,e),Ss.init(t,e)});function eIt(t){return aLt(JLt,t)}const tIt=Ct("ZodISODate",(t,e)=>{t_t.init(t,e),Ss.init(t,e)});function rIt(t){return oLt(tIt,t)}const nIt=Ct("ZodISOTime",(t,e)=>{r_t.init(t,e),Ss.init(t,e)});function iIt(t){return lLt(nIt,t)}const sIt=Ct("ZodISODuration",(t,e)=>{n_t.init(t,e),Ss.init(t,e)});function aIt(t){return cLt(sIt,t)}const oIt=(t,e)=>{O7e.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>URt(t,r)},flatten:{value:r=>qRt(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,oW,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,oW,2)}},isEmpty:{get(){return t.issues.length===0}}})},Du=Ct("ZodError",oIt,{Parent:Error}),lIt=hQ(Du),cIt=dQ(Du),uIt=vD(Du),hIt=bD(Du),dIt=XRt(Du),fIt=KRt(Du),pIt=ZRt(Du),gIt=QRt(Du),mIt=JRt(Du),yIt=e9t(Du),vIt=t9t(Du),bIt=r9t(Du),Jue=new WeakMap;function a7(t,e,r){const n=Object.getPrototypeOf(t);let i=Jue.get(n);if(i||(i=new Set,Jue.set(n,i)),!i.has(e)){i.add(e);for(const s in r){const a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){const o=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}const ks=Ct("ZodType",(t,e)=>(Cs.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:J_(t,"input"),output:J_(t,"output")}}),t.toJSONSchema=_Lt(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>lIt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>uIt(t,r,n),t.parseAsync=async(r,n)=>cIt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>hIt(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>dIt(t,r,n),t.decode=(r,n)=>fIt(t,r,n),t.encodeAsync=async(r,n)=>pIt(t,r,n),t.decodeAsync=async(r,n)=>gIt(t,r,n),t.safeEncode=(r,n)=>mIt(t,r,n),t.safeDecode=(r,n)=>yIt(t,r,n),t.safeEncodeAsync=async(r,n)=>vIt(t,r,n),t.safeDecodeAsync=async(r,n)=>bIt(t,r,n),a7(t,"ZodType",{check(...r){const n=this.def;return this.clone(Xg(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Kg(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(hNt(r,n))},superRefine(r,n){return this.check(dNt(r,n))},overwrite(r){return this.check(u3(r))},optional(){return nhe(this)},exactOptional(){return QIt(this)},nullable(){return ihe(this)},nullish(){return nhe(ihe(this))},nonoptional(r){return iNt(this,r)},array(){return gi(this)},or(r){return pQ([this,r])},and(r){return YIt(this,r)},transform(r){return she(this,KIt(r))},default(r){return tNt(this,r)},prefault(r){return nNt(this,r)},catch(r){return aNt(this,r)},pipe(r){return she(this,r)},readonly(){return cNt(this)},describe(r){const n=this.clone();return QC.add(n,{description:r}),n},meta(...r){if(r.length===0)return QC.get(this);const n=this.clone();return QC.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){var r;return(r=QC.get(t))==null?void 0:r.description},configurable:!0}),t)),rAe=Ct("_ZodString",(t,e)=>{fQ.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>ILt(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,a7(t,"_ZodString",{regex(...n){return this.check(gLt(...n))},includes(...n){return this.check(vLt(...n))},startsWith(...n){return this.check(bLt(...n))},endsWith(...n){return this.check(xLt(...n))},min(...n){return this.check(Q_(...n))},max(...n){return this.check(K7e(...n))},length(...n){return this.check(Z7e(...n))},nonempty(...n){return this.check(Q_(1,...n))},lowercase(n){return this.check(mLt(n))},uppercase(n){return this.check(yLt(n))},trim(){return this.check(TLt())},normalize(...n){return this.check(wLt(...n))},toLowerCase(){return this.check(CLt())},toUpperCase(){return this.check(kLt())},slugify(){return this.check(SLt())}})}),xIt=Ct("ZodString",(t,e)=>{fQ.init(t,e),rAe.init(t,e),t.email=r=>t.check(F_t(wIt,r)),t.url=r=>t.check(W_t(TIt,r)),t.jwt=r=>t.check(sLt($It,r)),t.emoji=r=>t.check(q_t(CIt,r)),t.guid=r=>t.check(Xue(ehe,r)),t.uuid=r=>t.check(z_t(QA,r)),t.uuidv4=r=>t.check(V_t(QA,r)),t.uuidv6=r=>t.check(H_t(QA,r)),t.uuidv7=r=>t.check(G_t(QA,r)),t.nanoid=r=>t.check(U_t(kIt,r)),t.guid=r=>t.check(Xue(ehe,r)),t.cuid=r=>t.check(Y_t(SIt,r)),t.cuid2=r=>t.check(j_t(EIt,r)),t.ulid=r=>t.check(X_t(AIt,r)),t.base64=r=>t.check(rLt(DIt,r)),t.base64url=r=>t.check(nLt(OIt,r)),t.xid=r=>t.check(K_t(MIt,r)),t.ksuid=r=>t.check(Z_t(RIt,r)),t.ipv4=r=>t.check(Q_t(_It,r)),t.ipv6=r=>t.check(J_t(LIt,r)),t.cidrv4=r=>t.check(eLt(IIt,r)),t.cidrv6=r=>t.check(tLt(NIt,r)),t.e164=r=>t.check(iLt(PIt,r)),t.datetime=r=>t.check(eIt(r)),t.date=r=>t.check(rIt(r)),t.time=r=>t.check(iIt(r)),t.duration=r=>t.check(aIt(r))});function Qe(t){return B_t(xIt,t)}const Ss=Ct("ZodStringFormat",(t,e)=>{hs.init(t,e),rAe.init(t,e)}),wIt=Ct("ZodEmail",(t,e)=>{q9t.init(t,e),Ss.init(t,e)}),ehe=Ct("ZodGUID",(t,e)=>{G9t.init(t,e),Ss.init(t,e)}),QA=Ct("ZodUUID",(t,e)=>{W9t.init(t,e),Ss.init(t,e)}),TIt=Ct("ZodURL",(t,e)=>{U9t.init(t,e),Ss.init(t,e)}),CIt=Ct("ZodEmoji",(t,e)=>{Y9t.init(t,e),Ss.init(t,e)}),kIt=Ct("ZodNanoID",(t,e)=>{j9t.init(t,e),Ss.init(t,e)}),SIt=Ct("ZodCUID",(t,e)=>{X9t.init(t,e),Ss.init(t,e)}),EIt=Ct("ZodCUID2",(t,e)=>{K9t.init(t,e),Ss.init(t,e)}),AIt=Ct("ZodULID",(t,e)=>{Z9t.init(t,e),Ss.init(t,e)}),MIt=Ct("ZodXID",(t,e)=>{Q9t.init(t,e),Ss.init(t,e)}),RIt=Ct("ZodKSUID",(t,e)=>{J9t.init(t,e),Ss.init(t,e)}),_It=Ct("ZodIPv4",(t,e)=>{i_t.init(t,e),Ss.init(t,e)}),LIt=Ct("ZodIPv6",(t,e)=>{s_t.init(t,e),Ss.init(t,e)}),IIt=Ct("ZodCIDRv4",(t,e)=>{a_t.init(t,e),Ss.init(t,e)}),NIt=Ct("ZodCIDRv6",(t,e)=>{o_t.init(t,e),Ss.init(t,e)}),DIt=Ct("ZodBase64",(t,e)=>{l_t.init(t,e),Ss.init(t,e)}),OIt=Ct("ZodBase64URL",(t,e)=>{u_t.init(t,e),Ss.init(t,e)}),PIt=Ct("ZodE164",(t,e)=>{h_t.init(t,e),Ss.init(t,e)}),$It=Ct("ZodJWT",(t,e)=>{f_t.init(t,e),Ss.init(t,e)}),nAe=Ct("ZodNumber",(t,e)=>{q7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>NLt(t,n,i),a7(t,"ZodNumber",{gt(n,i){return this.check(Zue(n,i))},gte(n,i){return this.check(yB(n,i))},min(n,i){return this.check(yB(n,i))},lt(n,i){return this.check(Kue(n,i))},lte(n,i){return this.check(mB(n,i))},max(n,i){return this.check(mB(n,i))},int(n){return this.check(the(n))},safe(n){return this.check(the(n))},positive(n){return this.check(Zue(0,n))},nonnegative(n){return this.check(yB(0,n))},negative(n){return this.check(Kue(0,n))},nonpositive(n){return this.check(mB(0,n))},multipleOf(n,i){return this.check(Que(n,i))},step(n,i){return this.check(Que(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ia(t){return uLt(nAe,t)}const BIt=Ct("ZodNumberFormat",(t,e)=>{p_t.init(t,e),nAe.init(t,e)});function the(t){return hLt(BIt,t)}const FIt=Ct("ZodBoolean",(t,e)=>{g_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DLt(t,r,n)});function ri(t){return dLt(FIt,t)}const zIt=Ct("ZodUnknown",(t,e)=>{m_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PLt()});function Ld(){return fLt(zIt)}const VIt=Ct("ZodNever",(t,e)=>{y_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OLt(t,r,n)});function HIt(t){return pLt(VIt,t)}const GIt=Ct("ZodArray",(t,e)=>{v_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VLt(t,r,n,i),t.element=e.element,a7(t,"ZodArray",{min(r,n){return this.check(Q_(r,n))},nonempty(r){return this.check(Q_(1,r))},max(r,n){return this.check(K7e(r,n))},length(r,n){return this.check(Z7e(r,n))},unwrap(){return this.element}})});function gi(t,e){return ELt(GIt,t,e)}const WIt=Ct("ZodObject",(t,e)=>{x_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HLt(t,r,n,i),bi(t,"shape",()=>e.shape),a7(t,"ZodObject",{keyof(){return fi(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Ld()})},loose(){return this.clone({...this._zod.def,catchall:Ld()})},strict(){return this.clone({...this._zod.def,catchall:HIt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return FRt(this,r)},safeExtend(r){return zRt(this,r)},merge(r){return VRt(this,r)},pick(r){return $Rt(this,r)},omit(r){return BRt(this,r)},partial(...r){return HRt(aAe,this,r[0])},required(...r){return GRt(oAe,this,r[0])}})});function rr(t,e){const r={type:"object",shape:t??{},..._r(e)};return new WIt(r)}const iAe=Ct("ZodUnion",(t,e)=>{j7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GLt(t,r,n,i),t.options=e.options});function pQ(t,e){return new iAe({type:"union",options:t,..._r(e)})}const qIt=Ct("ZodDiscriminatedUnion",(t,e)=>{iAe.init(t,e),w_t.init(t,e)});function sAe(t,e,r){return new qIt({type:"union",options:e,discriminator:t,..._r(r)})}const UIt=Ct("ZodIntersection",(t,e)=>{T_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WLt(t,r,n,i)});function YIt(t,e){return new UIt({type:"intersection",left:t,right:e})}const rhe=Ct("ZodRecord",(t,e)=>{C_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qLt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function wD(t,e,r){return!e||!e._zod?new rhe({type:"record",keyType:Qe(),valueType:t,..._r(e)}):new rhe({type:"record",keyType:t,valueType:e,..._r(r)})}const cW=Ct("ZodEnum",(t,e)=>{k_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>$Lt(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new cW({...e,checks:[],..._r(i),entries:s})},t.exclude=(n,i)=>{const s={...e.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new cW({...e,checks:[],..._r(i),entries:s})}});function fi(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new cW({type:"enum",entries:r,..._r(e)})}const jIt=Ct("ZodLiteral",(t,e)=>{S_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BLt(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Ic(t,e){return new jIt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const XIt=Ct("ZodTransform",(t,e)=>{E_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zLt(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _7e(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(I6(s,r.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(I6(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function KIt(t){return new XIt({type:"transform",transform:t})}const aAe=Ct("ZodOptional",(t,e)=>{X7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function nhe(t){return new aAe({type:"optional",innerType:t})}const ZIt=Ct("ZodExactOptional",(t,e)=>{A_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function QIt(t){return new ZIt({type:"optional",innerType:t})}const JIt=Ct("ZodNullable",(t,e)=>{M_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ULt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ihe(t){return new JIt({type:"nullable",innerType:t})}const eNt=Ct("ZodDefault",(t,e)=>{R_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jLt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function tNt(t,e){return new eNt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():N7e(e)}})}const rNt=Ct("ZodPrefault",(t,e)=>{__t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XLt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function nNt(t,e){return new rNt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():N7e(e)}})}const oAe=Ct("ZodNonOptional",(t,e)=>{L_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YLt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function iNt(t,e){return new oAe({type:"nonoptional",innerType:t,..._r(e)})}const sNt=Ct("ZodCatch",(t,e)=>{I_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KLt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function aNt(t,e){return new sNt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const oNt=Ct("ZodPipe",(t,e)=>{N_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZLt(t,r,n,i),t.in=e.in,t.out=e.out});function she(t,e){return new oNt({type:"pipe",in:t,out:e})}const lNt=Ct("ZodReadonly",(t,e)=>{D_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QLt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function cNt(t){return new lNt({type:"readonly",innerType:t})}const uNt=Ct("ZodCustom",(t,e)=>{O_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FLt(t,r)});function hNt(t,e={}){return ALt(uNt,t,e)}function dNt(t,e){return MLt(t,e)}const eL=Qe().uuid();rr({content:Qe().trim().min(1).max(500),sourceTurnId:eL.optional()}).strict();rr({content:Qe().trim().min(1).max(500),version:ia().int().positive()}).strict();const fNt=rr({memoId:Qe().trim().min(1).max(100).optional(),notebookId:Qe().trim().min(1).max(100).optional(),notebookTitle:Qe().trim().max(160).optional(),title:Qe().trim().max(160).optional(),selectionMarkdown:Qe().max(2e3).optional(),contentMarkdown:Qe().max(4e3).optional(),contentTruncated:ri().optional(),diagramKind:fi(["mind-map","flowchart","architecture"]).optional()}).strict(),pNt=rr({type:fi(["memo","notebook","tag"]),id:Qe().trim().min(1).max(100),title:Qe().trim().max(160).optional()}).strict();rr({id:eL,threadId:eL,message:Qe().trim().min(1).max(4e3),useMemory:ri().default(!0),allowNotes:ri().default(!1),allowWrites:ri().optional(),locale:fi(["zh-CN","en-US","ja"]).default("en-US"),focus:fNt.optional(),mentions:gi(pNt).max(8).optional()}).strict();rr({id:Qe().trim().min(1).max(80),prompt:Qe().trim().min(1).max(200),inputType:fi(["free_text","single_select","multi_select"]),options:gi(rr({id:Qe().trim().min(1).max(80),label:Qe().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const gNt=rr({questionId:Qe().trim().min(1).max(80),optionIds:gi(Qe().trim().min(1).max(80)).max(6).optional(),text:Qe().trim().max(400).optional()}).strict();rr({answers:gi(gNt).max(3).optional()}).strict();rr({name:Qe().trim().min(1).max(80),input:wD(Qe(),Ld()).default({}),callId:Qe().trim().min(1).max(100).optional(),response:Qe().max(16e3).optional(),process:Qe().max(32e3).optional()}).strict();rr({response:Qe().max(16e3),process:Qe().max(32e3).optional()}).strict();rr({response:Qe().max(16e3),process:Qe().max(32e3).optional(),status:fi(["completed","interrupted","failed"]),inputTokens:ia().int().nonnegative().optional(),outputTokens:ia().int().nonnegative().optional()}).strict();rr({enabled:ri(),learningEnabled:ri().optional(),useMemory:ri().optional(),version:ia().int().nonnegative()}).strict();const mNt=Qe().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");rr({suggestion:rr({kind:fi(["insight","merge","append","move","tag"]),title:Qe().trim().min(1).max(60),body:mNt,sourceIds:gi(Qe().min(1).max(100)).min(1).max(5),memoryIds:gi(Qe().max(100)).max(8).optional(),notebookId:Qe().max(100).nullable().optional(),tags:gi(Qe().min(1).max(40)).max(5).optional(),targetId:Qe().max(100).nullable()}).nullable()});rr({turnId:eL,output:Ld()}).strict();const gQ=Qe().trim().min(1).max(400),lAe=Qe().trim().min(1).max(100),yNt=rr({kind:Ic("merge"),memoIds:gi(lAe).min(2).max(5),title:Qe().trim().min(1).max(160),reason:gQ}).strict(),vNt=rr({kind:Ic("tag"),memoId:lAe,tags:gi(Qe().trim().min(1).max(40)).min(1).max(5),reason:gQ}).strict(),bNt=rr({kind:Ic("tool"),toolName:Qe().min(1).max(80),arguments:wD(Qe(),Ld()),reason:gQ}).strict();sAe("kind",[yNt,vNt,bNt]);rr({version:pQ([Ic(1),Ic(2)]),memories:gi(rr({content:Qe().trim().min(1).max(500),kind:fi(["explicit","inferred"]).optional()})).max(50),controls:rr({useMemory:ri(),learningEnabled:ri()}).optional()}).strict();const uW=["summarize","extract-key-points","extract-todos","rewrite-proofread","translate","improve-writing","fix-spelling-grammar","make-shorter","make-longer","simplify-language","change-tone","continue-writing","custom"],xNt=["professional","friendly","casual","direct"],wNt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt"],TNt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],CNt=4,ahe=4*1024*1024,kNt=256*1024,SNt=8*1024*1024,cAe=t=>{if(!t||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return null;const e=t.endsWith("==")?2:t.endsWith("=")?1:0;return t.length/4*3-e},ENt=t=>t.startsWith("text/")||t==="application/json",mQ=["none","target-language","tone"],yQ=["append","replace","both"],Gv=(t,e,r,n)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n}});Gv({key:"summarize",action:"summarize",parameterKind:"none",resultMode:"append"},{name:"精简总结",description:"压缩全文,提炼主题、结论与可执行结果",instruction:["对笔记做真正的精简总结,不要逐句改写、同义复述或回声式重写。","识别中心主题、主要主张、关键结论与可执行结果。","省略重复、修辞、举例、引语和次要细节,除非它们对理解关键结论必不可少。","较长笔记目标约为原文 20–30% 篇幅,用 3–7 条简洁 Markdown 要点;短笔记用 1–3 句即可。","不要大段照搬原文,也不要添加原文没有的信息。","保持笔记原语言,只返回 Markdown 总结。"].join("")},{name:"Summarize",description:"Condense the note into its topic, conclusions, and actionable outcomes",instruction:["Create a genuinely condensed summary of the note rather than rewriting, paraphrasing line by line, or echoing it. ","Identify the central topic, main claims, essential conclusions, and actionable outcomes. ","Omit repetition, rhetorical phrasing, examples, quotations, and minor details unless necessary to understand a key conclusion. ","For a substantial note, target roughly 20–30% of the source length and use 3–7 concise Markdown bullet points; for a short note, use 1–3 concise sentences. ","Do not reproduce long passages verbatim or add facts that are not present in the source. ","Preserve the note's language and return only the summary in Markdown."].join("")},{name:"要約する",description:"テーマ、結論、実行できる結果に圧縮する",instruction:["ノートを本当に要約してください。逐語の言い換え、行ごとの書き換え、エコーのような再述はしないでください。","中心テーマ、主要な主張、重要な結論、実行できる結果を抜き出してください。","繰り返し、修辞、例示、引用、枝葉の詳細は、重要な結論を理解するのに必要でない限り省いてください。","長いノートは原文のおよそ 20–30% を目安に、3–7 個の簡潔な Markdown 箇条書きにしてください。短いノートは 1–3 文で構いません。","長い原文をそのまま写したり、原文にない事実を足したりしないでください。","ノートの言語を保ち、Markdown の要約だけを返してください。"].join("")}),Gv({key:"translate",action:"translate",parameterKind:"target-language",resultMode:"both"},{name:"全文翻译",description:"翻译为指定目标语言,保留结构与格式",instruction:"将完整笔记翻译成用户指定的目标语言。保留原意、Markdown 结构、链接与代码块。只返回译文,不要评论。"},{name:"Translate",description:"Translate into a selected language while preserving formatting",instruction:"Translate the complete note into the target language specified by the user. Preserve its meaning, Markdown structure, links, and code blocks. Return only the translated note without commentary."},{name:"翻訳する",description:"指定した言語へ翻訳し、構造と書式を残す",instruction:"ノート全体を、ユーザーが指定した目標言語へ翻訳してください。意味、Markdown の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"}),Gv({key:"improve-writing",action:"improve-writing",parameterKind:"none",resultMode:"both"},{name:"润色表达",description:"校正语言并提升文字的清晰度与流畅度",instruction:"润色内容,修正错别字、语法与标点,改善用词、句式、清晰度和流畅度,但不要改变原意或刻意缩短内容。保持原语言与有用的 Markdown 格式。只返回润色后的内容。"},{name:"Polish",description:"Correct the language and improve clarity and flow",instruction:"Polish the content by correcting spelling, grammar, and punctuation and improving word choice, sentence structure, clarity, and flow. Do not change its meaning or deliberately shorten it. Preserve its language and useful Markdown formatting. Return only the polished content."},{name:"文章を整える",description:"誤字と文法を直し、わかりやすさと流れを上げる",instruction:"内容を整えてください。誤字、文法、句読点を直し、語彙、文の形、明瞭さ、流れを改善します。意味を変えたり、意図的に短くしたりしないでください。元の言語と有用な Markdown 書式は残してください。整えた本文だけを返してください。"}),Gv({key:"make-shorter",action:"make-shorter",parameterKind:"none",resultMode:"both"},{name:"精炼表达",description:"删去重复与冗余,让表达更简洁有力",instruction:"精炼内容,删除重复、空话和不必要的修饰,合并可以合并的句子,使表达简洁、清晰、有力。保留所有关键事实、观点与原意,不要添加新信息。保持原语言与有用的 Markdown 格式。只返回精炼后的内容。"},{name:"Make concise",description:"Remove repetition and make the writing concise and direct",instruction:"Refine the content by removing repetition, filler, and unnecessary modifiers and by combining sentences where useful. Make it concise, clear, and direct while preserving every key fact, claim, and the original meaning. Do not add new information. Preserve its language and useful Markdown formatting. Return only the refined content."},{name:"簡潔にする",description:"重複と冗長さを削り、短くはっきり書く",instruction:"内容を簡潔にしてください。繰り返し、空疎な言い回し、不要な修飾を削り、まとめられる文はまとめて、短く、はっきり、力強くしてください。重要な事実、主張、元の意味はすべて残し、新しい情報は足さないでください。元の言語と有用な Markdown 書式は残してください。簡潔にした本文だけを返してください。"}),Gv({key:"extract-todos",action:"extract-todos",parameterKind:"none",resultMode:"append"},{name:"提取待办",description:"识别可执行任务,生成任务清单",instruction:"从笔记中提取明确或隐含的可执行任务,用 Markdown 任务列表(- [ ])输出。保持原语言,不要编造任务。若没有可执行事项,用原文语言简短说明。"},{name:"Extract tasks",description:"Identify actionable work and produce a task list",instruction:"Extract explicit or implied actionable tasks from the note as a Markdown task list using '- [ ]'. Preserve its language and do not invent tasks. If there are no actionable tasks, say so briefly in the note's language."},{name:"タスクを抜き出す",description:"実行できる作業を見つけ、チェックリストにする",instruction:"ノートから明示または含意された実行可能なタスクを抜き出し、Markdown のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"}),Gv({key:"continue-writing",action:"continue-writing",parameterKind:"none",resultMode:"append"},{name:"继续写作",description:"从笔记末尾自然续写",instruction:"从笔记结束处自然续写。只返回新增续写内容,不要重复原文。保持原语言与 Markdown 风格。"},{name:"Continue writing",description:"Continue naturally from the end of the note",instruction:"Continue writing naturally from where the note ends. Return only the new continuation, not the original content. Preserve its language and Markdown style."},{name:"続きを書く",description:"ノートの末尾から自然に書き継ぐ",instruction:"ノートの終わりから自然に書き継いでください。原文は繰り返さず、新しい続きだけを返してください。元の言語と Markdown の調子を保ってください。"});const ANt=new Set([zf,J2]),oC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},ohe="edgeever-attachment-kind-",vQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),uAe=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(ohe)):[],i=J1(e,vQ(t));return[...n,"edgeever-attachment-link",`${ohe}${i}`].join(" ")},MNt=Wi.create({name:"edgeeverNativeAttachmentMetadata",addGlobalAttributes(){return[{types:["link"],attributes:{attachmentFilename:{default:null,parseHTML:t=>t.getAttribute("data-attachment-filename"),renderHTML:t=>t.attachmentFilename?{"data-attachment-filename":String(t.attachmentFilename)}:{}},attachmentMimeType:{default:null,parseHTML:t=>t.getAttribute("data-attachment-mime-type"),renderHTML:t=>t.attachmentMimeType?{"data-attachment-mime-type":String(t.attachmentMimeType)}:{}},attachmentByteSize:{default:null,parseHTML:t=>yg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=yg(t.attachmentByteSize),r=typeof t.attachmentFilename=="string"?t.attachmentFilename:"",n=typeof t.attachmentMimeType=="string"?t.attachmentMimeType:"";return!r&&!n&&e===null?{}:{...e===null?{}:{"data-attachment-byte-size":String(e)},"data-attachment-meta":wMt(n,r,e)}}}}}]}}),lhe=t=>{var n,i;if(t.type!=="link")return!1;const e=typeof((n=t.attrs)==null?void 0:n.href)=="string"?t.attrs.href:"";return(typeof((i=t.attrs)==null?void 0:i.class)=="string"?t.attrs.class:"").split(/\s+/).includes("edgeever-attachment-link")||e.includes("/api/v1/resources/")},RNt=t=>{var e;return(e=t.marks)!=null&&e.some(lhe)?{...t,marks:t.marks.map(r=>{var n,i;return lhe(r)?{...r,attrs:{...r.attrs,class:uAe(t.text,null,(n=r.attrs)==null?void 0:n.class),attachmentFilename:typeof((i=r.attrs)==null?void 0:i.attachmentFilename)=="string"?r.attrs.attachmentFilename:vQ(t.text)}}:r})}:t},_Nt=t=>{var a;const e=oC(t,"url"),r=oC(t,"label")||oC(t,"filename")||"Attachment",n=oC(t,"mimeType"),i=oC(t,"filename")||vQ(r),s=yg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:uAe(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},LNt=t=>{const e=r=>ANt.has(r.type)?_Nt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?RNt(r):r;return{...t,content:t.content.map(r=>e(r))}},INt="edgeever-zip",NNt=2,gh=Qe().datetime();rr({format:Ic(INt),formatVersion:pQ([Ic(1),Ic(NNt)]),schemaVersion:ia().int().positive(),edgeeverVersion:Qe().trim().min(1),buildId:Qe().trim().min(1),exportedAt:gh,includesTrash:Ic(!1),counts:rr({notebooks:ia().int().min(0),memos:ia().int().min(0),revisions:ia().int().min(0),resources:ia().int().min(0),prompts:ia().int().min(0).optional()})});const DNt=rr({id:Qe().trim().min(1),parentId:Qe().trim().min(1).nullable(),name:Qe().trim().min(1).max(80),slug:Qe().nullable(),icon:Qe().nullable(),color:Qe().nullable(),sortOrder:ia().int(),createdAt:gh,updatedAt:gh}),ONt=rr({id:Qe().trim().min(1),memoId:Qe().trim().min(1),revision:ia().int().min(0),title:Qe().nullable(),tags:gi(Qe()),contentJson:Ld(),contentMarkdown:Qe(),contentText:Qe(),contentHash:Qe(),createdBy:Qe(),createdAt:gh}),PNt=rr({id:Qe().trim().min(1),notebookId:Qe().trim().min(1),title:Qe().nullable(),excerpt:Qe(),tags:gi(Qe()),isPinned:ri(),isArchived:ri(),isDeleted:ri(),revision:ia().int().min(0),createdAt:gh,updatedAt:gh,deletedAt:gh.nullable(),contentJson:Ld(),contentMarkdown:Qe(),contentText:Qe(),contentHash:Qe(),sourceMemoIds:gi(Qe()),mergeSourceCount:ia().int().min(0),mergedIntoMemoId:Qe().nullable()}),hAe=rr({memo:PNt,revisions:gi(ONt),resources:gi(rr({id:Qe().trim().min(1),memoId:Qe().trim().min(1),originalMemoId:Qe().nullable(),kind:fi(["image","attachment"]),mimeType:Qe().nullable(),filename:Qe().nullable(),byteSize:ia().int().min(0),sha256:Qe().nullable(),width:ia().int().positive().nullable(),height:ia().int().positive().nullable(),createdAt:gh,updatedAt:gh,archivePath:Qe().trim().min(1)}))});rr({notebooks:gi(DNt).min(1).max(100)});rr({memos:gi(hAe).min(1).max(10)});const $Nt=rr({id:Qe().trim().min(1).max(200),origin:fi(["default","custom"]),seedKey:fi(uW.filter(t=>t!=="custom")).nullable(),action:fi(uW),parameterKind:fi(mQ),resultMode:fi(yQ),nameCustomized:ri(),descriptionCustomized:ri(),instructionCustomized:ri(),name:Qe().trim().min(1).max(80),description:Qe().max(200).nullable(),instruction:Qe().trim().min(1).max(2e3),createdAt:gh,updatedAt:gh}).superRefine((t,e)=>{t.origin==="default"&&!t.seedKey&&e.addIssue({code:"custom",path:["seedKey"],message:"A default prompt must include a seed key."}),t.origin==="default"&&t.seedKey&&t.action!==t.seedKey&&e.addIssue({code:"custom",path:["action"],message:"A default prompt action must match its seed key."}),t.origin==="custom"&&(t.seedKey!==null||t.action!=="custom")&&e.addIssue({code:"custom",path:["origin"],message:"A custom prompt cannot use factory prompt identity."})});rr({prompts:gi($Nt).max(100)});hAe.shape.resources.element;const lC=(t,e,r,n)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n}});lC({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录 +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of t.seen.entries()){const d=h[1];if(e===h[0]){s(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){s(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){s(h);continue}if(d.cycle){s(h);continue}if(d.count>1&&t.reused==="ref"){s(h);continue}}}function aAe(t,e){var o,l,u,h;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=d=>{const f=t.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,g={...p},m=f.ref;if(f.ref=null,m){n(m);const v=t.seen.get(m),x=v.schema;if(x.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(x.$ref&&v.def)for(const T in p)T==="$ref"||T==="allOf"||T in v.def&&JSON.stringify(p[T])===JSON.stringify(v.def[T])&&delete p[T]}const y=d._zod.parent;if(y&&y!==m){n(y);const v=t.seen.get(y);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...t.seen.entries()].reverse())n(d[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(o=t.external)!=null&&o.uri){const d=(l=t.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(d)}Object.assign(i,r.def??r.schema);const s=(u=t.metadataRegistry.get(e))==null?void 0:u.id;s!==void 0&&i.id===s&&delete i.id;const a=((h=t.external)==null?void 0:h.defs)??{};for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,a[f.defId]=f.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:nL(e,"input",t.processors),output:nL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function sl(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return sl(n.element,r);if(n.type==="set")return sl(n.valueType,r);if(n.type==="lazy")return sl(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return sl(n.innerType,r);if(n.type==="intersection")return sl(n.left,r)||sl(n.right,r);if(n.type==="record"||n.type==="map")return sl(n.keyType,r)||sl(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:sl(n.in,r)||sl(n.out,r);if(n.type==="object"){for(const i in n.shape)if(sl(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(sl(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(sl(i,r))return!0;return!!(n.rest&&sl(n.rest,r))}return!1}const VLt=(t,e={})=>r=>{const n=iAe({...r,processors:e});return ha(t,n),sAe(n,t),aAe(n,t)},nL=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=iAe({...i??{},target:s,io:e,processors:r});return ha(t,a),sAe(a,t),aAe(a,t)},HLt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},GLt=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=HLt[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},WLt=(t,e,r,n)=>{const i=r,{minimum:s,maximum:a,format:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const d=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},qLt=(t,e,r,n)=>{r.type="boolean"},ULt=(t,e,r,n)=>{r.not={}},YLt=(t,e,r,n)=>{},jLt=(t,e,r,n)=>{const i=t._zod.def,s=$7e(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},XLt=(t,e,r,n)=>{const i=t._zod.def,s=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},KLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ZLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},QLt=(t,e,r,n)=>{const i=r,s=t._zod.def,{minimum:a,maximum:o}=t._zod.bag;typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=ha(s.element,e,{...n,path:[...n.path,"items"]})},JLt=(t,e,r,n)=>{var u;const i=r,s=t._zod.def;i.type="object",i.properties={};const a=s.shape;for(const h in a)i.properties[h]=ha(a[h],e,{...n,path:[...n.path,"properties",h]});const o=new Set(Object.keys(a)),l=new Set([...o].filter(h=>{const d=s.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=ha(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},eIt=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>ha(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},tIt=(t,e,r,n)=>{const i=t._zod.def,s=ha(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=ha(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]];r.allOf=l},rIt=(t,e,r,n)=>{const i=r,s=t._zod.def;i.type="object";const a=s.keyType,o=a._zod.bag,l=o==null?void 0:o.patterns;if(s.mode==="loose"&&l&&l.size>0){const h=ha(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const d of l)i.patternProperties[d.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=ha(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ha(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});const u=a._zod.values;if(u){const h=[...u].filter(d=>typeof d=="string"||typeof d=="number");h.length>0&&(i.required=h)}},nIt=(t,e,r,n)=>{const i=t._zod.def,s=ha(i.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},iIt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},sIt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},aIt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},oIt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},lIt=(t,e,r,n)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?s?i.out:i.in:i.out;ha(a,e,n);const o=e.seen.get(t);o.ref=a},cIt=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},oAe=(t,e,r,n)=>{const i=t._zod.def;ha(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},uIt=Ct("ZodISODateTime",(t,e)=>{h_t.init(t,e),Ss.init(t,e)});function hIt(t){return yLt(uIt,t)}const dIt=Ct("ZodISODate",(t,e)=>{d_t.init(t,e),Ss.init(t,e)});function fIt(t){return vLt(dIt,t)}const pIt=Ct("ZodISOTime",(t,e)=>{f_t.init(t,e),Ss.init(t,e)});function gIt(t){return bLt(pIt,t)}const mIt=Ct("ZodISODuration",(t,e)=>{p_t.init(t,e),Ss.init(t,e)});function yIt(t){return xLt(mIt,t)}const vIt=(t,e)=>{V7e.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>n9t(t,r)},flatten:{value:r=>r9t(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,hW,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,hW,2)}},isEmpty:{get(){return t.issues.length===0}}})},$u=Ct("ZodError",vIt,{Parent:Error}),bIt=gQ($u),xIt=mQ($u),wIt=wD($u),TIt=TD($u),CIt=a9t($u),kIt=o9t($u),SIt=l9t($u),EIt=c9t($u),AIt=u9t($u),MIt=h9t($u),RIt=d9t($u),_It=f9t($u),nhe=new WeakMap;function c7(t,e,r){const n=Object.getPrototypeOf(t);let i=nhe.get(n);if(i||(i=new Set,nhe.set(n,i)),!i.has(e)){i.add(e);for(const s in r){const a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){const o=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}const ks=Ct("ZodType",(t,e)=>(Cs.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:nL(t,"input"),output:nL(t,"output")}}),t.toJSONSchema=VLt(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>bIt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>wIt(t,r,n),t.parseAsync=async(r,n)=>xIt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>TIt(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>CIt(t,r,n),t.decode=(r,n)=>kIt(t,r,n),t.encodeAsync=async(r,n)=>SIt(t,r,n),t.decodeAsync=async(r,n)=>EIt(t,r,n),t.safeEncode=(r,n)=>AIt(t,r,n),t.safeDecode=(r,n)=>MIt(t,r,n),t.safeEncodeAsync=async(r,n)=>RIt(t,r,n),t.safeDecodeAsync=async(r,n)=>_It(t,r,n),c7(t,"ZodType",{check(...r){const n=this.def;return this.clone(Qg(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Jg(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(TNt(r,n))},superRefine(r,n){return this.check(CNt(r,n))},overwrite(r){return this.check(f3(r))},optional(){return ohe(this)},exactOptional(){return cNt(this)},nullable(){return lhe(this)},nullish(){return ohe(lhe(this))},nonoptional(r){return gNt(this,r)},array(){return ni(this)},or(r){return vQ([this,r])},and(r){return iNt(this,r)},transform(r){return che(this,oNt(r))},default(r){return dNt(this,r)},prefault(r){return pNt(this,r)},catch(r){return yNt(this,r)},pipe(r){return che(this,r)},readonly(){return xNt(this)},describe(r){const n=this.clone();return tk.add(n,{description:r}),n},meta(...r){if(r.length===0)return tk.get(this);const n=this.clone();return tk.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){var r;return(r=tk.get(t))==null?void 0:r.description},configurable:!0}),t)),lAe=Ct("_ZodString",(t,e)=>{yQ.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>GLt(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,c7(t,"_ZodString",{regex(...n){return this.check(ELt(...n))},includes(...n){return this.check(RLt(...n))},startsWith(...n){return this.check(_Lt(...n))},endsWith(...n){return this.check(LLt(...n))},min(...n){return this.check(rL(...n))},max(...n){return this.check(rAe(...n))},length(...n){return this.check(nAe(...n))},nonempty(...n){return this.check(rL(1,...n))},lowercase(n){return this.check(ALt(n))},uppercase(n){return this.check(MLt(n))},trim(){return this.check(NLt())},normalize(...n){return this.check(ILt(...n))},toLowerCase(){return this.check(DLt())},toUpperCase(){return this.check(OLt())},slugify(){return this.check(PLt())}})}),LIt=Ct("ZodString",(t,e)=>{yQ.init(t,e),lAe.init(t,e),t.email=r=>t.check(K_t(IIt,r)),t.url=r=>t.check(tLt(NIt,r)),t.jwt=r=>t.check(mLt(jIt,r)),t.emoji=r=>t.check(rLt(DIt,r)),t.guid=r=>t.check(Jue(ihe,r)),t.uuid=r=>t.check(Z_t(t8,r)),t.uuidv4=r=>t.check(Q_t(t8,r)),t.uuidv6=r=>t.check(J_t(t8,r)),t.uuidv7=r=>t.check(eLt(t8,r)),t.nanoid=r=>t.check(nLt(OIt,r)),t.guid=r=>t.check(Jue(ihe,r)),t.cuid=r=>t.check(iLt(PIt,r)),t.cuid2=r=>t.check(sLt($It,r)),t.ulid=r=>t.check(aLt(BIt,r)),t.base64=r=>t.check(fLt(qIt,r)),t.base64url=r=>t.check(pLt(UIt,r)),t.xid=r=>t.check(oLt(FIt,r)),t.ksuid=r=>t.check(lLt(zIt,r)),t.ipv4=r=>t.check(cLt(VIt,r)),t.ipv6=r=>t.check(uLt(HIt,r)),t.cidrv4=r=>t.check(hLt(GIt,r)),t.cidrv6=r=>t.check(dLt(WIt,r)),t.e164=r=>t.check(gLt(YIt,r)),t.datetime=r=>t.check(hIt(r)),t.date=r=>t.check(fIt(r)),t.time=r=>t.check(gIt(r)),t.duration=r=>t.check(yIt(r))});function Qe(t){return X_t(LIt,t)}const Ss=Ct("ZodStringFormat",(t,e)=>{hs.init(t,e),lAe.init(t,e)}),IIt=Ct("ZodEmail",(t,e)=>{r_t.init(t,e),Ss.init(t,e)}),ihe=Ct("ZodGUID",(t,e)=>{e_t.init(t,e),Ss.init(t,e)}),t8=Ct("ZodUUID",(t,e)=>{t_t.init(t,e),Ss.init(t,e)}),NIt=Ct("ZodURL",(t,e)=>{n_t.init(t,e),Ss.init(t,e)}),DIt=Ct("ZodEmoji",(t,e)=>{i_t.init(t,e),Ss.init(t,e)}),OIt=Ct("ZodNanoID",(t,e)=>{s_t.init(t,e),Ss.init(t,e)}),PIt=Ct("ZodCUID",(t,e)=>{a_t.init(t,e),Ss.init(t,e)}),$It=Ct("ZodCUID2",(t,e)=>{o_t.init(t,e),Ss.init(t,e)}),BIt=Ct("ZodULID",(t,e)=>{l_t.init(t,e),Ss.init(t,e)}),FIt=Ct("ZodXID",(t,e)=>{c_t.init(t,e),Ss.init(t,e)}),zIt=Ct("ZodKSUID",(t,e)=>{u_t.init(t,e),Ss.init(t,e)}),VIt=Ct("ZodIPv4",(t,e)=>{g_t.init(t,e),Ss.init(t,e)}),HIt=Ct("ZodIPv6",(t,e)=>{m_t.init(t,e),Ss.init(t,e)}),GIt=Ct("ZodCIDRv4",(t,e)=>{y_t.init(t,e),Ss.init(t,e)}),WIt=Ct("ZodCIDRv6",(t,e)=>{v_t.init(t,e),Ss.init(t,e)}),qIt=Ct("ZodBase64",(t,e)=>{b_t.init(t,e),Ss.init(t,e)}),UIt=Ct("ZodBase64URL",(t,e)=>{w_t.init(t,e),Ss.init(t,e)}),YIt=Ct("ZodE164",(t,e)=>{T_t.init(t,e),Ss.init(t,e)}),jIt=Ct("ZodJWT",(t,e)=>{k_t.init(t,e),Ss.init(t,e)}),cAe=Ct("ZodNumber",(t,e)=>{Z7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>WLt(t,n,i),c7(t,"ZodNumber",{gt(n,i){return this.check(the(n,i))},gte(n,i){return this.check(xB(n,i))},min(n,i){return this.check(xB(n,i))},lt(n,i){return this.check(ehe(n,i))},lte(n,i){return this.check(bB(n,i))},max(n,i){return this.check(bB(n,i))},int(n){return this.check(she(n))},safe(n){return this.check(she(n))},positive(n){return this.check(the(0,n))},nonnegative(n){return this.check(xB(0,n))},negative(n){return this.check(ehe(0,n))},nonpositive(n){return this.check(bB(0,n))},multipleOf(n,i){return this.check(rhe(n,i))},step(n,i){return this.check(rhe(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ia(t){return wLt(cAe,t)}const XIt=Ct("ZodNumberFormat",(t,e)=>{S_t.init(t,e),cAe.init(t,e)});function she(t){return TLt(XIt,t)}const KIt=Ct("ZodBoolean",(t,e)=>{E_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qLt(t,r,n)});function ri(t){return CLt(KIt,t)}const ZIt=Ct("ZodUnknown",(t,e)=>{A_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YLt()});function Dd(){return kLt(ZIt)}const QIt=Ct("ZodNever",(t,e)=>{M_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ULt(t,r,n)});function JIt(t){return SLt(QIt,t)}const eNt=Ct("ZodArray",(t,e)=>{R_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QLt(t,r,n,i),t.element=e.element,c7(t,"ZodArray",{min(r,n){return this.check(rL(r,n))},nonempty(r){return this.check(rL(1,r))},max(r,n){return this.check(rAe(r,n))},length(r,n){return this.check(nAe(r,n))},unwrap(){return this.element}})});function ni(t,e){return $Lt(eNt,t,e)}const tNt=Ct("ZodObject",(t,e)=>{L_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JLt(t,r,n,i),bi(t,"shape",()=>e.shape),c7(t,"ZodObject",{keyof(){return pi(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Dd()})},loose(){return this.clone({...this._zod.def,catchall:Dd()})},strict(){return this.clone({...this._zod.def,catchall:JIt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return KRt(this,r)},safeExtend(r){return ZRt(this,r)},merge(r){return QRt(this,r)},pick(r){return jRt(this,r)},omit(r){return XRt(this,r)},partial(...r){return JRt(dAe,this,r[0])},required(...r){return e9t(fAe,this,r[0])}})});function er(t,e){const r={type:"object",shape:t??{},..._r(e)};return new tNt(r)}const uAe=Ct("ZodUnion",(t,e)=>{eAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eIt(t,r,n,i),t.options=e.options});function vQ(t,e){return new uAe({type:"union",options:t,..._r(e)})}const rNt=Ct("ZodDiscriminatedUnion",(t,e)=>{uAe.init(t,e),I_t.init(t,e)});function hAe(t,e,r){return new rNt({type:"union",options:e,discriminator:t,..._r(r)})}const nNt=Ct("ZodIntersection",(t,e)=>{N_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tIt(t,r,n,i)});function iNt(t,e){return new nNt({type:"intersection",left:t,right:e})}const ahe=Ct("ZodRecord",(t,e)=>{D_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rIt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function kD(t,e,r){return!e||!e._zod?new ahe({type:"record",keyType:Qe(),valueType:t,..._r(e)}):new ahe({type:"record",keyType:t,valueType:e,..._r(r)})}const fW=Ct("ZodEnum",(t,e)=>{O_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>jLt(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new fW({...e,checks:[],..._r(i),entries:s})},t.exclude=(n,i)=>{const s={...e.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new fW({...e,checks:[],..._r(i),entries:s})}});function pi(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new fW({type:"enum",entries:r,..._r(e)})}const sNt=Ct("ZodLiteral",(t,e)=>{P_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XLt(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Oc(t,e){return new sNt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const aNt=Ct("ZodTransform",(t,e)=>{$_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZLt(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new P7e(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(O6(s,r.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(O6(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function oNt(t){return new aNt({type:"transform",transform:t})}const dAe=Ct("ZodOptional",(t,e)=>{tAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ohe(t){return new dAe({type:"optional",innerType:t})}const lNt=Ct("ZodExactOptional",(t,e)=>{B_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function cNt(t){return new lNt({type:"optional",innerType:t})}const uNt=Ct("ZodNullable",(t,e)=>{F_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lhe(t){return new uNt({type:"nullable",innerType:t})}const hNt=Ct("ZodDefault",(t,e)=>{z_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function dNt(t,e){return new hNt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():F7e(e)}})}const fNt=Ct("ZodPrefault",(t,e)=>{V_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function pNt(t,e){return new fNt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():F7e(e)}})}const fAe=Ct("ZodNonOptional",(t,e)=>{H_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function gNt(t,e){return new fAe({type:"nonoptional",innerType:t,..._r(e)})}const mNt=Ct("ZodCatch",(t,e)=>{G_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function yNt(t,e){return new mNt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const vNt=Ct("ZodPipe",(t,e)=>{W_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lIt(t,r,n,i),t.in=e.in,t.out=e.out});function che(t,e){return new vNt({type:"pipe",in:t,out:e})}const bNt=Ct("ZodReadonly",(t,e)=>{q_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function xNt(t){return new bNt({type:"readonly",innerType:t})}const wNt=Ct("ZodCustom",(t,e)=>{U_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KLt(t,r)});function TNt(t,e={}){return BLt(wNt,t,e)}function CNt(t,e){return FLt(t,e)}const iL=Qe().uuid();er({content:Qe().trim().min(1).max(500),sourceTurnId:iL.optional()}).strict();er({content:Qe().trim().min(1).max(500),version:ia().int().positive()}).strict();const kNt=er({memoId:Qe().trim().min(1).max(100).optional(),notebookId:Qe().trim().min(1).max(100).optional(),notebookTitle:Qe().trim().max(160).optional(),title:Qe().trim().max(160).optional(),selectionMarkdown:Qe().max(2e3).optional(),contentMarkdown:Qe().max(4e3).optional(),contentTruncated:ri().optional(),diagramKind:pi(["mind-map","flowchart","architecture"]).optional()}).strict(),SNt=er({type:pi(["memo","notebook","tag"]),id:Qe().trim().min(1).max(100),title:Qe().trim().max(160).optional()}).strict();er({id:iL,threadId:iL,message:Qe().trim().min(1).max(4e3),useMemory:ri().default(!0),allowNotes:ri().default(!1),allowWrites:ri().optional(),locale:pi(["zh-CN","en-US","ja"]).default("en-US"),focus:kNt.optional(),mentions:ni(SNt).max(8).optional()}).strict();er({id:Qe().trim().min(1).max(80),prompt:Qe().trim().min(1).max(200),inputType:pi(["free_text","single_select","multi_select"]),options:ni(er({id:Qe().trim().min(1).max(80),label:Qe().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const ENt=er({questionId:Qe().trim().min(1).max(80),optionIds:ni(Qe().trim().min(1).max(80)).max(6).optional(),text:Qe().trim().max(400).optional()}).strict();er({answers:ni(ENt).max(3).optional()}).strict();er({name:Qe().trim().min(1).max(80),input:kD(Qe(),Dd()).default({}),callId:Qe().trim().min(1).max(100).optional(),response:Qe().max(16e3).optional(),process:Qe().max(32e3).optional()}).strict();er({response:Qe().max(16e3),process:Qe().max(32e3).optional()}).strict();er({response:Qe().max(16e3),process:Qe().max(32e3).optional(),status:pi(["completed","interrupted","failed"]),inputTokens:ia().int().nonnegative().optional(),outputTokens:ia().int().nonnegative().optional()}).strict();er({enabled:ri(),learningEnabled:ri().optional(),useMemory:ri().optional(),version:ia().int().nonnegative()}).strict();const ANt=Qe().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");er({suggestion:er({kind:pi(["insight","merge","append","move","tag"]),title:Qe().trim().min(1).max(60),body:ANt,sourceIds:ni(Qe().min(1).max(100)).min(1).max(5),memoryIds:ni(Qe().max(100)).max(8).optional(),notebookId:Qe().max(100).nullable().optional(),tags:ni(Qe().min(1).max(40)).max(5).optional(),targetId:Qe().max(100).nullable()}).nullable()});er({turnId:iL,output:Dd()}).strict();const bQ=Qe().trim().min(1).max(400),pAe=Qe().trim().min(1).max(100),MNt=er({kind:Oc("merge"),memoIds:ni(pAe).min(2).max(5),title:Qe().trim().min(1).max(160),reason:bQ}).strict(),RNt=er({kind:Oc("tag"),memoId:pAe,tags:ni(Qe().trim().min(1).max(40)).min(1).max(5),reason:bQ}).strict(),_Nt=er({kind:Oc("tool"),toolName:Qe().min(1).max(80),arguments:kD(Qe(),Dd()),reason:bQ}).strict();hAe("kind",[MNt,RNt,_Nt]);er({version:vQ([Oc(1),Oc(2)]),memories:ni(er({content:Qe().trim().min(1).max(500),kind:pi(["explicit","inferred"]).optional()})).max(50),controls:er({useMemory:ri(),learningEnabled:ri()}).optional()}).strict();const pW=["summarize","extract-key-points","extract-todos","rewrite-proofread","translate","improve-writing","fix-spelling-grammar","make-shorter","make-longer","simplify-language","change-tone","continue-writing","custom"],LNt=["professional","friendly","casual","direct"],INt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt"],NNt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],DNt=4,uhe=4*1024*1024,ONt=256*1024,PNt=8*1024*1024,gAe=t=>{if(!t||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return null;const e=t.endsWith("==")?2:t.endsWith("=")?1:0;return t.length/4*3-e},$Nt=t=>t.startsWith("text/")||t==="application/json",xQ=["none","target-language","tone"],wQ=["append","replace","both"],qv=(t,e,r,n)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n}});qv({key:"summarize",action:"summarize",parameterKind:"none",resultMode:"append"},{name:"精简总结",description:"压缩全文,提炼主题、结论与可执行结果",instruction:["对笔记做真正的精简总结,不要逐句改写、同义复述或回声式重写。","识别中心主题、主要主张、关键结论与可执行结果。","省略重复、修辞、举例、引语和次要细节,除非它们对理解关键结论必不可少。","较长笔记目标约为原文 20–30% 篇幅,用 3–7 条简洁 Markdown 要点;短笔记用 1–3 句即可。","不要大段照搬原文,也不要添加原文没有的信息。","保持笔记原语言,只返回 Markdown 总结。"].join("")},{name:"Summarize",description:"Condense the note into its topic, conclusions, and actionable outcomes",instruction:["Create a genuinely condensed summary of the note rather than rewriting, paraphrasing line by line, or echoing it. ","Identify the central topic, main claims, essential conclusions, and actionable outcomes. ","Omit repetition, rhetorical phrasing, examples, quotations, and minor details unless necessary to understand a key conclusion. ","For a substantial note, target roughly 20–30% of the source length and use 3–7 concise Markdown bullet points; for a short note, use 1–3 concise sentences. ","Do not reproduce long passages verbatim or add facts that are not present in the source. ","Preserve the note's language and return only the summary in Markdown."].join("")},{name:"要約する",description:"テーマ、結論、実行できる結果に圧縮する",instruction:["ノートを本当に要約してください。逐語の言い換え、行ごとの書き換え、エコーのような再述はしないでください。","中心テーマ、主要な主張、重要な結論、実行できる結果を抜き出してください。","繰り返し、修辞、例示、引用、枝葉の詳細は、重要な結論を理解するのに必要でない限り省いてください。","長いノートは原文のおよそ 20–30% を目安に、3–7 個の簡潔な Markdown 箇条書きにしてください。短いノートは 1–3 文で構いません。","長い原文をそのまま写したり、原文にない事実を足したりしないでください。","ノートの言語を保ち、Markdown の要約だけを返してください。"].join("")}),qv({key:"translate",action:"translate",parameterKind:"target-language",resultMode:"both"},{name:"全文翻译",description:"翻译为指定目标语言,保留结构与格式",instruction:"将完整笔记翻译成用户指定的目标语言。保留原意、Markdown 结构、链接与代码块。只返回译文,不要评论。"},{name:"Translate",description:"Translate into a selected language while preserving formatting",instruction:"Translate the complete note into the target language specified by the user. Preserve its meaning, Markdown structure, links, and code blocks. Return only the translated note without commentary."},{name:"翻訳する",description:"指定した言語へ翻訳し、構造と書式を残す",instruction:"ノート全体を、ユーザーが指定した目標言語へ翻訳してください。意味、Markdown の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"}),qv({key:"improve-writing",action:"improve-writing",parameterKind:"none",resultMode:"both"},{name:"润色表达",description:"校正语言并提升文字的清晰度与流畅度",instruction:"润色内容,修正错别字、语法与标点,改善用词、句式、清晰度和流畅度,但不要改变原意或刻意缩短内容。保持原语言与有用的 Markdown 格式。只返回润色后的内容。"},{name:"Polish",description:"Correct the language and improve clarity and flow",instruction:"Polish the content by correcting spelling, grammar, and punctuation and improving word choice, sentence structure, clarity, and flow. Do not change its meaning or deliberately shorten it. Preserve its language and useful Markdown formatting. Return only the polished content."},{name:"文章を整える",description:"誤字と文法を直し、わかりやすさと流れを上げる",instruction:"内容を整えてください。誤字、文法、句読点を直し、語彙、文の形、明瞭さ、流れを改善します。意味を変えたり、意図的に短くしたりしないでください。元の言語と有用な Markdown 書式は残してください。整えた本文だけを返してください。"}),qv({key:"make-shorter",action:"make-shorter",parameterKind:"none",resultMode:"both"},{name:"精炼表达",description:"删去重复与冗余,让表达更简洁有力",instruction:"精炼内容,删除重复、空话和不必要的修饰,合并可以合并的句子,使表达简洁、清晰、有力。保留所有关键事实、观点与原意,不要添加新信息。保持原语言与有用的 Markdown 格式。只返回精炼后的内容。"},{name:"Make concise",description:"Remove repetition and make the writing concise and direct",instruction:"Refine the content by removing repetition, filler, and unnecessary modifiers and by combining sentences where useful. Make it concise, clear, and direct while preserving every key fact, claim, and the original meaning. Do not add new information. Preserve its language and useful Markdown formatting. Return only the refined content."},{name:"簡潔にする",description:"重複と冗長さを削り、短くはっきり書く",instruction:"内容を簡潔にしてください。繰り返し、空疎な言い回し、不要な修飾を削り、まとめられる文はまとめて、短く、はっきり、力強くしてください。重要な事実、主張、元の意味はすべて残し、新しい情報は足さないでください。元の言語と有用な Markdown 書式は残してください。簡潔にした本文だけを返してください。"}),qv({key:"extract-todos",action:"extract-todos",parameterKind:"none",resultMode:"append"},{name:"提取待办",description:"识别可执行任务,生成任务清单",instruction:"从笔记中提取明确或隐含的可执行任务,用 Markdown 任务列表(- [ ])输出。保持原语言,不要编造任务。若没有可执行事项,用原文语言简短说明。"},{name:"Extract tasks",description:"Identify actionable work and produce a task list",instruction:"Extract explicit or implied actionable tasks from the note as a Markdown task list using '- [ ]'. Preserve its language and do not invent tasks. If there are no actionable tasks, say so briefly in the note's language."},{name:"タスクを抜き出す",description:"実行できる作業を見つけ、チェックリストにする",instruction:"ノートから明示または含意された実行可能なタスクを抜き出し、Markdown のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"}),qv({key:"continue-writing",action:"continue-writing",parameterKind:"none",resultMode:"append"},{name:"继续写作",description:"从笔记末尾自然续写",instruction:"从笔记结束处自然续写。只返回新增续写内容,不要重复原文。保持原语言与 Markdown 风格。"},{name:"Continue writing",description:"Continue naturally from the end of the note",instruction:"Continue writing naturally from where the note ends. Return only the new continuation, not the original content. Preserve its language and Markdown style."},{name:"続きを書く",description:"ノートの末尾から自然に書き継ぐ",instruction:"ノートの終わりから自然に書き継いでください。原文は繰り返さず、新しい続きだけを返してください。元の言語と Markdown の調子を保ってください。"});const BNt=new Set([Wf,tb]),uC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},hhe="edgeever-attachment-kind-",TQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),mAe=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(hhe)):[],i=ty(e,TQ(t));return[...n,"edgeever-attachment-link",`${hhe}${i}`].join(" ")},FNt=Wi.create({name:"edgeeverNativeAttachmentMetadata",addGlobalAttributes(){return[{types:["link"],attributes:{attachmentFilename:{default:null,parseHTML:t=>t.getAttribute("data-attachment-filename"),renderHTML:t=>t.attachmentFilename?{"data-attachment-filename":String(t.attachmentFilename)}:{}},attachmentMimeType:{default:null,parseHTML:t=>t.getAttribute("data-attachment-mime-type"),renderHTML:t=>t.attachmentMimeType?{"data-attachment-mime-type":String(t.attachmentMimeType)}:{}},attachmentByteSize:{default:null,parseHTML:t=>xg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=xg(t.attachmentByteSize),r=typeof t.attachmentFilename=="string"?t.attachmentFilename:"",n=typeof t.attachmentMimeType=="string"?t.attachmentMimeType:"";return!r&&!n&&e===null?{}:{...e===null?{}:{"data-attachment-byte-size":String(e)},"data-attachment-meta":AMt(n,r,e)}}}}}]}}),dhe=t=>{var n,i;if(t.type!=="link")return!1;const e=typeof((n=t.attrs)==null?void 0:n.href)=="string"?t.attrs.href:"";return(typeof((i=t.attrs)==null?void 0:i.class)=="string"?t.attrs.class:"").split(/\s+/).includes("edgeever-attachment-link")||e.includes("/api/v1/resources/")},zNt=t=>{var e;return(e=t.marks)!=null&&e.some(dhe)?{...t,marks:t.marks.map(r=>{var n,i;return dhe(r)?{...r,attrs:{...r.attrs,class:mAe(t.text,null,(n=r.attrs)==null?void 0:n.class),attachmentFilename:typeof((i=r.attrs)==null?void 0:i.attachmentFilename)=="string"?r.attrs.attachmentFilename:TQ(t.text)}}:r})}:t},VNt=t=>{var a;const e=uC(t,"url"),r=uC(t,"label")||uC(t,"filename")||"Attachment",n=uC(t,"mimeType"),i=uC(t,"filename")||TQ(r),s=xg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:mAe(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},HNt=t=>{const e=r=>BNt.has(r.type)?VNt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?zNt(r):r;return{...t,content:t.content.map(r=>e(r))}},GNt="edgeever-zip",WNt=2,vh=Qe().datetime();er({format:Oc(GNt),formatVersion:vQ([Oc(1),Oc(WNt)]),schemaVersion:ia().int().positive(),edgeeverVersion:Qe().trim().min(1),buildId:Qe().trim().min(1),exportedAt:vh,includesTrash:Oc(!1),counts:er({notebooks:ia().int().min(0),memos:ia().int().min(0),revisions:ia().int().min(0),resources:ia().int().min(0),prompts:ia().int().min(0).optional()})});const qNt=er({id:Qe().trim().min(1),parentId:Qe().trim().min(1).nullable(),name:Qe().trim().min(1).max(80),slug:Qe().nullable(),icon:Qe().nullable(),color:Qe().nullable(),sortOrder:ia().int(),createdAt:vh,updatedAt:vh}),UNt=er({id:Qe().trim().min(1),memoId:Qe().trim().min(1),revision:ia().int().min(0),title:Qe().nullable(),tags:ni(Qe()),contentJson:Dd(),contentMarkdown:Qe(),contentText:Qe(),contentHash:Qe(),createdBy:Qe(),createdAt:vh}),YNt=er({id:Qe().trim().min(1),notebookId:Qe().trim().min(1),title:Qe().nullable(),excerpt:Qe(),tags:ni(Qe()),isPinned:ri(),isArchived:ri(),isDeleted:ri(),revision:ia().int().min(0),createdAt:vh,updatedAt:vh,deletedAt:vh.nullable(),contentJson:Dd(),contentMarkdown:Qe(),contentText:Qe(),contentHash:Qe(),sourceMemoIds:ni(Qe()),mergeSourceCount:ia().int().min(0),mergedIntoMemoId:Qe().nullable()}),yAe=er({memo:YNt,revisions:ni(UNt),resources:ni(er({id:Qe().trim().min(1),memoId:Qe().trim().min(1),originalMemoId:Qe().nullable(),kind:pi(["image","attachment"]),mimeType:Qe().nullable(),filename:Qe().nullable(),byteSize:ia().int().min(0),sha256:Qe().nullable(),width:ia().int().positive().nullable(),height:ia().int().positive().nullable(),createdAt:vh,updatedAt:vh,archivePath:Qe().trim().min(1)}))});er({notebooks:ni(qNt).min(1).max(100)});er({memos:ni(yAe).min(1).max(10)});const jNt=er({id:Qe().trim().min(1).max(200),origin:pi(["default","custom"]),seedKey:pi(pW.filter(t=>t!=="custom")).nullable(),action:pi(pW),parameterKind:pi(xQ),resultMode:pi(wQ),nameCustomized:ri(),descriptionCustomized:ri(),instructionCustomized:ri(),name:Qe().trim().min(1).max(80),description:Qe().max(200).nullable(),instruction:Qe().trim().min(1).max(2e3),createdAt:vh,updatedAt:vh}).superRefine((t,e)=>{t.origin==="default"&&!t.seedKey&&e.addIssue({code:"custom",path:["seedKey"],message:"A default prompt must include a seed key."}),t.origin==="default"&&t.seedKey&&t.action!==t.seedKey&&e.addIssue({code:"custom",path:["action"],message:"A default prompt action must match its seed key."}),t.origin==="custom"&&(t.seedKey!==null||t.action!=="custom")&&e.addIssue({code:"custom",path:["origin"],message:"A custom prompt cannot use factory prompt identity."})});er({prompts:ni(jNt).max(100)});yAe.shape.resources.element;const hC=(t,e,r,n)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n}});hC({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录 - @@ -1543,7 +1550,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. ## 🚀 次のアクション -- [ ] `}),lC({key:"meeting",translationKey:"meeting",tag:"meeting"},{title:"会议纪要",description:"结构化记录议题背景、核心结论与带负责人的待办事项。",contentMarkdown:`# 📝 会议纪要 +- [ ] `}),hC({key:"meeting",translationKey:"meeting",tag:"meeting"},{title:"会议纪要",description:"结构化记录议题背景、核心结论与带负责人的待办事项。",contentMarkdown:`# 📝 会议纪要 - **时间**: - **主持人/记录人**: @@ -1621,7 +1628,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. - [ ] **[担当者]** タスク内容(期限:MM-DD) - [ ] **[担当者]** タスク内容(期限:MM-DD) -`}),lC({key:"weekly-review",translationKey:"weeklyReview",tag:"weekly-review"},{title:"周报与进展复盘",description:"梳理本周核心产出、风险卡点与下周关键优先级。",contentMarkdown:`# 🗓️ 工作周报 +`}),hC({key:"weekly-review",translationKey:"weeklyReview",tag:"weekly-review"},{title:"周报与进展复盘",description:"梳理本周核心产出、风险卡点与下周关键优先级。",contentMarkdown:`# 🗓️ 工作周报 ## 🌟 本周核心进展 (Highlights) @@ -1681,7 +1688,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. ## 💡 振り返り - -`}),lC({key:"reading",translationKey:"reading",tag:"reading"},{title:"深度阅读卡片",description:"提炼核心观点、精妙摘录、个人理解与关联知识卡片。",contentMarkdown:`# 📖 深度阅读卡片 +`}),hC({key:"reading",translationKey:"reading",tag:"reading"},{title:"深度阅读卡片",description:"提炼核心观点、精妙摘录、个人理解与关联知识卡片。",contentMarkdown:`# 📖 深度阅读卡片 - **书名/文章**: - **作者/来源**: @@ -1753,7 +1760,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. ## 🔗 関連知識とアクション - [ ] **実践**: -`}),lC({key:"okr",translationKey:"okr",tag:"okr"},{title:"目标与任务拆解",description:"明确 OKR 目标、关键结果、里程碑与具体执行清单。",contentMarkdown:`# 🎯 目标拆解 +`}),hC({key:"okr",translationKey:"okr",tag:"okr"},{title:"目标与任务拆解",description:"明确 OKR 目标、关键结果、里程碑与具体执行清单。",contentMarkdown:`# 🎯 目标拆解 - **周期**: - **负责人**: @@ -1828,16 +1835,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. - [ ] - [ ] -`});rr({name:Qe().trim().min(1).max(80),parentId:Qe().trim().min(1).nullable().optional()});rr({name:Qe().trim().min(1).max(80).optional(),parentId:Qe().trim().min(1).nullable().optional(),sortOrder:ia().int().optional()});rr({notebookId:Qe().trim().min(1),title:Qe().trim().max(160).optional(),contentJson:Ld().optional(),contentMarkdown:Qe().optional(),tags:gi(Qe()).optional(),createdAt:Qe().datetime().optional(),updatedAt:Qe().datetime().optional()});rr({expectedRevision:ia().int().min(0).optional(),expectedContentHash:Qe().length(64).optional(),editSessionId:Qe().trim().min(1).optional(),notebookId:Qe().trim().min(1).optional(),title:Qe().trim().max(160).optional(),isPinned:ri().optional(),contentJson:Ld().optional(),contentMarkdown:Qe().optional(),tags:gi(Qe()).optional(),createdAt:Qe().datetime().optional(),updatedAt:Qe().datetime().optional(),allowDestructiveOverwrite:ri().optional()});rr({name:Qe().trim().min(1).max(160),description:Qe().trim().max(500).optional(),memoId:Qe().trim().min(1).optional(),title:Qe().trim().max(160).nullable().optional(),contentMarkdown:Qe().optional(),tags:gi(Qe()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});rr({name:Qe().trim().min(1).max(160).optional(),description:Qe().trim().max(500).nullable().optional(),title:Qe().trim().max(160).nullable().optional(),contentMarkdown:Qe().optional(),tags:gi(Qe()).optional()});rr({notebookId:Qe().trim().min(1)});const dAe=rr({pluginId:Qe().trim().min(3).max(200),commandId:Qe().trim().min(1).max(200)}),BNt=rr({name:Qe().trim().min(1).max(120),taskType:Ic("plugin-command"),taskPayload:dAe,cronExpression:Qe().trim().min(1).max(160),timezone:Qe().trim().min(1).max(80),executorDeviceId:Qe().trim().min(16).max(160),missedRunPolicy:fi(["run-once","skip"]).default("run-once"),isEnabled:ri().default(!0)});BNt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:dAe.optional(),executorDeviceId:Qe().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});rr({pluginId:Qe().trim().min(3).max(200),scheduleKey:Qe().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Qe().trim().min(1).max(120),commandId:Qe().trim().min(1).max(200),cronExpression:Qe().trim().min(1).max(160),timezone:Qe().trim().min(1).max(80),executorDeviceId:Qe().trim().min(16).max(160),missedRunPolicy:fi(["run-once","skip"]).default("run-once"),isEnabled:ri().optional()});rr({scheduledFor:Qe().datetime(),executorDeviceId:Qe().trim().min(16).max(160)});rr({executorDeviceId:Qe().trim().min(16).max(160),status:fi(["succeeded","failed"]),errorMessage:Qe().trim().max(2e3).nullable().optional()});const che=Qe().trim().max(2e3).refine(t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},{message:"URL must use http or https."});rr({type:fi(["plugin","theme"]),version:Qe().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:ri(),installedAt:Qe().datetime(),manifestUrl:che,sourceKind:fi(["marketplace","github","manifest"]),verified:ri(),repositoryUrl:che.max(500).nullable().optional(),releaseTag:Qe().trim().min(1).max(80).nullable().optional(),publisher:Ic("edgeever").nullable().optional()}).refine(t=>t.sourceKind==="github"?!!t.repositoryUrl:t.sourceKind==="marketplace"?!!(t.repositoryUrl||t.manifestUrl):!0,{message:"GitHub and marketplace extensions require a source URL."});rr({memoIds:gi(Qe().trim().min(1)).min(1).max(100),notebookId:Qe().trim().min(1)});rr({memoIds:gi(Qe().trim().min(1)).min(1).max(100),permanent:ri().optional()});rr({memoIds:gi(Qe().trim().min(1)).min(2).max(50),notebookId:Qe().trim().min(1).optional(),title:Qe().trim().max(160).optional()});rr({username:Qe().trim().min(1).max(80),password:Qe().min(1).max(512),deviceId:Qe().trim().min(16).max(160).optional()});rr({label:Qe().trim().max(80).nullable()});rr({currentPassword:Qe().min(1).max(512),newPassword:Qe().min(8).max(512),confirmPassword:Qe().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});rr({username:Qe().trim().min(1).max(80),displayName:Qe().trim().max(80).nullable().optional(),password:Qe().min(8).max(512)});rr({displayName:Qe().trim().max(80).nullable().optional(),password:Qe().min(8).max(512).optional(),isDisabled:ri().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");rr({name:Qe().trim().min(1).max(80),scopes:gi(Qe().trim().min(1).max(80)).min(1).max(32),expiresAt:Qe().datetime().nullable().optional()});rr({name:Qe().trim().min(1).max(80)});rr({filename:Qe().trim().min(1).max(160)});const fAe=Qe().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");sAe("provider",[rr({provider:Ic("builtin")}),rr({provider:Ic("s3"),displayName:Qe().trim().min(1).max(80),endpoint:fAe,region:Qe().trim().min(1).max(80),bucket:Qe().trim().min(1).max(255),accessKeyId:Qe().trim().min(1).max(256),secretAccessKey:Qe().min(1).max(1024).optional(),forcePathStyle:ri().default(!0),objectPrefix:Qe().trim().max(500).default("")})]);rr({endpoint:fAe,region:Qe().trim().min(1).max(80),bucket:Qe().trim().min(1).max(255),accessKeyId:Qe().trim().min(1).max(256),secretAccessKey:Qe().min(1).max(1024).optional(),forcePathStyle:ri().default(!0),objectPrefix:Qe().trim().max(500).default("")});const pAe=fi(["openai-compatible","anthropic","google"]),gAe=Qe().trim().url().max(500).superRefine((t,e)=>{let r;try{r=new URL(t)}catch{return}r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:"custom",message:"AI Base URL must use HTTP or HTTPS."}),(r.username||r.password)&&e.addIssue({code:"custom",message:"AI Base URL must not contain credentials."})}),mAe=rr({provider:pAe,displayName:Qe().trim().min(1).max(80),baseUrl:gAe,isEnabled:ri().default(!0)});mAe.extend({apiKey:Qe().min(1).max(4096),initialModelId:Qe().trim().min(1).max(200).optional()});mAe.extend({apiKey:Qe().min(1).max(4096).optional()});rr({modelId:Qe().trim().min(1).max(200),provider:pAe.optional(),baseUrl:gAe.optional(),apiKey:Qe().min(1).max(4096).optional()});rr({modelId:Qe().trim().min(1).max(200),displayName:Qe().trim().min(1).max(200).optional()});rr({modelConfigId:Qe().trim().min(1).nullable()});const FNt=rr({filename:Qe().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:fi(TNt),base64Data:Qe().min(1).max(Math.ceil(ahe/3)*4)}).superRefine((t,e)=>{const r=cAe(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=ENt(t.mediaType)?kNt:ahe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});rr({action:fi(uW),promptId:Qe().trim().min(1).max(200).optional(),locale:Qe().trim().min(2).max(35).optional(),title:Qe().trim().max(160).default(""),contentMarkdown:Qe().max(3e5),stream:ri().default(!1),targetLanguage:fi(wNt).optional(),tone:fi(xNt).optional(),instruction:Qe().trim().min(1).max(2e3).optional(),attachments:gi(FNt).max(CNt).default([])}).superRefine((t,e)=>{!t.promptId&&t.action==="translate"&&!t.targetLanguage&&e.addIssue({code:"custom",path:["targetLanguage"],message:"A target language is required for translation."}),!t.promptId&&t.action==="change-tone"&&!t.tone&&e.addIssue({code:"custom",path:["tone"],message:"A tone is required when changing tone."}),!t.promptId&&t.action==="custom"&&!t.instruction&&e.addIssue({code:"custom",path:["instruction"],message:"An instruction is required for a custom action."});const r=t.action==="custom"&&!!(t.instruction||t.promptId);!t.title&&!t.contentMarkdown.trim()&&t.attachments.length===0&&!r&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."}),t.attachments.reduce((i,s)=>i+(cAe(s.base64Data)??0),0)>SNt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});rr({title:Qe().trim().max(160).default(""),contentMarkdown:Qe().max(3e5),currentTags:gi(Qe().trim().min(1).max(200)).max(24).default([]),locale:Qe().trim().min(2).max(35).optional()}).superRefine((t,e)=>{!t.title&&!t.contentMarkdown.trim()&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."})});rr({prompt:Qe().trim().min(1).max(4e3).nullable()});rr({name:Qe().trim().min(1).max(80),description:Qe().trim().max(200).optional(),instruction:Qe().trim().min(1).max(2e3),parameterKind:fi(mQ).default("none"),resultMode:fi(yQ).default("both")});rr({name:Qe().trim().min(1).max(80).optional(),description:Qe().trim().max(200).nullable().optional(),instruction:Qe().trim().min(1).max(2e3).optional(),parameterKind:fi(mQ).optional(),resultMode:fi(yQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});rr({passwordProtected:ri()});rr({bodyFont:fi(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});rr({password:Qe().min(1).max(64)});const zNt=rr({fieldId:Qe().trim().min(1).max(80),required:ri()});rr({enabled:ri(),passwordProtected:ri(),rotatePassword:ri().optional(),title:Qe().trim().max(120),description:Qe().trim().max(1e3),submitLabel:Qe().trim().max(40),fields:gi(zNt).max(40)});rr({cells:wD(Qe().max(80),Ld())});const yAe="3.9.3",VNt=yAe,uhe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,hhe=typeof TextEncoder=="function"?new TextEncoder:void 0,HNt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",JC=Array.prototype.slice.call(HNt),JA=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(JC),GNt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,yo=String.fromCharCode.bind(String),WNt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),vAe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),bAe=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),xAe=t=>{let e,r,n,i,s="";const a=t.length%3;for(let o=0;o255||(n=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=JC[e>>18&63]+JC[e>>12&63]+JC[e>>6&63]+JC[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},bQ=typeof btoa=="function"?t=>btoa(t):xAe,hW=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;ne?vAe(hW(t)):hW(t),qNt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?yo(192|e>>>6)+yo(128|e&63):yo(224|e>>>12&15)+yo(128|e>>>6&63)+yo(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return yo(240|e>>>18&7)+yo(128|e>>>12&63)+yo(128|e>>>6&63)+yo(128|e&63)}},UNt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,wAe=t=>t.replace(UNt,qNt),dhe=hhe?t=>hW(hhe.encode(t)):t=>bQ(wAe(t)),Lb=(t,e=!1)=>e?vAe(dhe(t)):dhe(t),fhe=t=>Lb(t,!0),YNt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,jNt=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return yo((r>>>10)+55296)+yo((r&1023)+56320);case 3:return yo((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return yo((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},TAe=t=>t.replace(YNt,jNt),CAe=t=>{if(t=t.replace(/\s+/g,""),!GNt.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,i=[];for(let s=0;s>16&255)):n===64?i.push(yo(e>>16&255,e>>8&255)):i.push(yo(e>>16&255,e>>8&255,e&255));return i.join("")},xQ=typeof atob=="function"?t=>atob(bAe(t)):CAe,kAe=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>WNt(xQ(t).split("").map(e=>e.charCodeAt(0))),SAe=t=>kAe(EAe(t)),XNt=uhe?t=>uhe.decode(kAe(t)):t=>TAe(xQ(t)),EAe=t=>bAe(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),dW=t=>XNt(EAe(t)),KNt=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},AAe=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),MAe=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,AAe(r));t("fromBase64",function(){return dW(this)}),t("toBase64",function(e){return Lb(this,e)}),t("toBase64URI",function(){return Lb(this,!0)}),t("toBase64URL",function(){return Lb(this,!0)}),t("toUint8Array",function(){return SAe(this)})},RAe=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,AAe(r));t("toBase64",function(e){return BM(this,e)}),t("toBase64URI",function(){return BM(this,!0)}),t("toBase64URL",function(){return BM(this,!0)})},ZNt=()=>{MAe(),RAe()},QNt={version:yAe,VERSION:VNt,atob:xQ,atobPolyfill:CAe,btoa:bQ,btoaPolyfill:xAe,fromBase64:dW,toBase64:Lb,encode:Lb,encodeURI:fhe,encodeURL:fhe,utob:wAe,btou:TAe,decode:dW,isValid:KNt,fromUint8Array:BM,toUint8Array:SAe,extendString:MAe,extendUint8Array:RAe,extendBuiltins:ZNt},phe={client:[{tagName:"path",attrs:{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}},{tagName:"path",attrs:{d:"M10 19v-3.96 3.15"}},{tagName:"path",attrs:{d:"M7 19h5"}},{tagName:"rect",attrs:{width:"6",height:"10",x:"16",y:"12",rx:"2"}}],webApp:[{tagName:"rect",attrs:{x:"2",y:"4",width:"20",height:"16",rx:"2"}},{tagName:"path",attrs:{d:"M10 4v4"}},{tagName:"path",attrs:{d:"M2 8h20"}},{tagName:"path",attrs:{d:"M6 4v4"}}],mobileApp:[{tagName:"rect",attrs:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M12 18h.01"}}],website:[{tagName:"path",attrs:{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54"}},{tagName:"path",attrs:{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"}},{tagName:"path",attrs:{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}}],apiClient:[{tagName:"path",attrs:{d:"m18 16 4-4-4-4"}},{tagName:"path",attrs:{d:"m6 8-4 4 4 4"}},{tagName:"path",attrs:{d:"m14.5 4-5 16"}}],service:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}},{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"6",y2:"6"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"18",y2:"18"}}],cpu:[{tagName:"path",attrs:{d:"M12 20v2"}},{tagName:"path",attrs:{d:"M12 2v2"}},{tagName:"path",attrs:{d:"M17 20v2"}},{tagName:"path",attrs:{d:"M17 2v2"}},{tagName:"path",attrs:{d:"M2 12h2"}},{tagName:"path",attrs:{d:"M2 17h2"}},{tagName:"path",attrs:{d:"M2 7h2"}},{tagName:"path",attrs:{d:"M20 12h2"}},{tagName:"path",attrs:{d:"M20 17h2"}},{tagName:"path",attrs:{d:"M20 7h2"}},{tagName:"path",attrs:{d:"M7 20v2"}},{tagName:"path",attrs:{d:"M7 2v2"}},{tagName:"rect",attrs:{x:"4",y:"4",width:"16",height:"16",rx:"2"}},{tagName:"rect",attrs:{x:"8",y:"8",width:"8",height:"8",rx:"1"}}],gpu:[{tagName:"path",attrs:{d:"M2 17h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H2"}},{tagName:"path",attrs:{d:"M2 21V3"}},{tagName:"path",attrs:{d:"M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3"}},{tagName:"circle",attrs:{cx:"16",cy:"11",r:"2"}},{tagName:"circle",attrs:{cx:"8",cy:"11",r:"2"}}],memory:[{tagName:"path",attrs:{d:"M12 12v-2"}},{tagName:"path",attrs:{d:"M12 18v-2"}},{tagName:"path",attrs:{d:"M16 12v-2"}},{tagName:"path",attrs:{d:"M16 18v-2"}},{tagName:"path",attrs:{d:"M2 11h1.5"}},{tagName:"path",attrs:{d:"M20 18v-2"}},{tagName:"path",attrs:{d:"M20.5 11H22"}},{tagName:"path",attrs:{d:"M4 18v-2"}},{tagName:"path",attrs:{d:"M8 12v-2"}},{tagName:"path",attrs:{d:"M8 18v-2"}},{tagName:"rect",attrs:{x:"2",y:"6",width:"20",height:"10",rx:"2"}}],virtualMachine:[{tagName:"path",attrs:{d:"m10.852 14.772-.383.923"}},{tagName:"path",attrs:{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.148 9.228.383-.923"}},{tagName:"path",attrs:{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 10.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 13.148.923.383"}},{tagName:"path",attrs:{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"}},{tagName:"path",attrs:{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"}},{tagName:"path",attrs:{d:"M6 18h.01"}},{tagName:"path",attrs:{d:"M6 6h.01"}},{tagName:"path",attrs:{d:"m9.228 10.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 13.148-.923.383"}}],container:[{tagName:"path",attrs:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"}},{tagName:"path",attrs:{d:"M10 21.9V14L2.1 9.1"}},{tagName:"path",attrs:{d:"m10 14 11.9-6.9"}},{tagName:"path",attrs:{d:"M14 19.8v-8.1"}},{tagName:"path",attrs:{d:"M18 17.5V9.4"}}],kubernetes:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"8"}},{tagName:"path",attrs:{d:"M12 2v7.5"}},{tagName:"path",attrs:{d:"m19 5-5.23 5.23"}},{tagName:"path",attrs:{d:"M22 12h-7.5"}},{tagName:"path",attrs:{d:"m19 19-5.23-5.23"}},{tagName:"path",attrs:{d:"M12 14.5V22"}},{tagName:"path",attrs:{d:"M10.23 13.77 5 19"}},{tagName:"path",attrs:{d:"M9.5 12H2"}},{tagName:"path",attrs:{d:"M10.23 10.23 5 5"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2.5"}}],serverless:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}},{tagName:"path",attrs:{d:"M9 11.2h5.7"}}],largeLanguageModel:[{tagName:"path",attrs:{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}},{tagName:"path",attrs:{d:"M9 13a4.5 4.5 0 0 0 3-4"}},{tagName:"path",attrs:{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}},{tagName:"path",attrs:{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}},{tagName:"path",attrs:{d:"M6 18a4 4 0 0 1-1.967-.516"}},{tagName:"path",attrs:{d:"M12 13h4"}},{tagName:"path",attrs:{d:"M12 18h6a2 2 0 0 1 2 2v1"}},{tagName:"path",attrs:{d:"M12 8h8"}},{tagName:"path",attrs:{d:"M16 8V5a2 2 0 0 1 2-2"}},{tagName:"circle",attrs:{cx:"16",cy:"13",r:".5"}},{tagName:"circle",attrs:{cx:"18",cy:"3",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"21",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"8",r:".5"}}],multimodalModel:[{tagName:"path",attrs:{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}},{tagName:"path",attrs:{d:"M20 2v4"}},{tagName:"path",attrs:{d:"M22 4h-4"}},{tagName:"circle",attrs:{cx:"4",cy:"20",r:"2"}}],embeddingModel:[{tagName:"rect",attrs:{x:"14",y:"14",width:"4",height:"6",rx:"2"}},{tagName:"rect",attrs:{x:"6",y:"4",width:"4",height:"6",rx:"2"}},{tagName:"path",attrs:{d:"M6 20h4"}},{tagName:"path",attrs:{d:"M14 10h4"}},{tagName:"path",attrs:{d:"M6 14h2v6"}},{tagName:"path",attrs:{d:"M14 4h2v6"}}],reranker:[{tagName:"path",attrs:{d:"m3 16 4 4 4-4"}},{tagName:"path",attrs:{d:"M7 20V4"}},{tagName:"path",attrs:{d:"m21 8-4-4-4 4"}},{tagName:"path",attrs:{d:"M17 4v16"}}],modelInference:[{tagName:"path",attrs:{d:"M10 12h4"}},{tagName:"path",attrs:{d:"M10 17h4"}},{tagName:"path",attrs:{d:"M10 7h4"}},{tagName:"path",attrs:{d:"M18 12h2"}},{tagName:"path",attrs:{d:"M18 18h2"}},{tagName:"path",attrs:{d:"M18 6h2"}},{tagName:"path",attrs:{d:"M4 12h2"}},{tagName:"path",attrs:{d:"M4 18h2"}},{tagName:"path",attrs:{d:"M4 6h2"}},{tagName:"rect",attrs:{x:"6",y:"2",width:"12",height:"20",rx:"2"}}],vectorDatabase:[{tagName:"path",attrs:{d:"m10.586 5.414-5.172 5.172"}},{tagName:"path",attrs:{d:"m18.586 13.414-5.172 5.172"}},{tagName:"path",attrs:{d:"M6 12h12"}},{tagName:"circle",attrs:{cx:"12",cy:"20",r:"2"}},{tagName:"circle",attrs:{cx:"12",cy:"4",r:"2"}},{tagName:"circle",attrs:{cx:"20",cy:"12",r:"2"}},{tagName:"circle",attrs:{cx:"4",cy:"12",r:"2"}}],ragPipeline:[{tagName:"rect",attrs:{width:"8",height:"8",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M7 11v4a2 2 0 0 0 2 2h4"}},{tagName:"rect",attrs:{width:"8",height:"8",x:"13",y:"13",rx:"2"}}],aiAgent:[{tagName:"path",attrs:{d:"M12 8V4H8"}},{tagName:"rect",attrs:{width:"16",height:"12",x:"4",y:"8",rx:"2"}},{tagName:"path",attrs:{d:"M2 14h2"}},{tagName:"path",attrs:{d:"M20 14h2"}},{tagName:"path",attrs:{d:"M15 13v2"}},{tagName:"path",attrs:{d:"M9 13v2"}}],modelGateway:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2"}},{tagName:"path",attrs:{d:"M6.01 18H6"}},{tagName:"path",attrs:{d:"M10.01 18H10"}},{tagName:"path",attrs:{d:"M15 10v4"}},{tagName:"path",attrs:{d:"M17.84 7.17a4 4 0 0 0-5.66 0"}},{tagName:"path",attrs:{d:"M20.66 4.34a8 8 0 0 0-11.31 0"}}],mcpServer:[{tagName:"path",attrs:{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}},{tagName:"path",attrs:{d:"m2 22 3-3"}},{tagName:"path",attrs:{d:"M7.5 13.5 10 11"}},{tagName:"path",attrs:{d:"M10.5 16.5 13 14"}},{tagName:"path",attrs:{d:"m18 3-4 4h6l-4 4"}}],relationalDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 21 19V5"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 21 12"}}],noSqlDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 15 21.84"}},{tagName:"path",attrs:{d:"M21 5V8"}},{tagName:"path",attrs:{d:"M21 12L18 17H22L19 22"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 14.59 14.87"}}],cache:[{tagName:"path",attrs:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}}],dataWarehouse:[{tagName:"path",attrs:{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}},{tagName:"path",attrs:{d:"m7 16.5-4.74-2.85"}},{tagName:"path",attrs:{d:"m7 16.5 5-3"}},{tagName:"path",attrs:{d:"M7 16.5v5.17"}},{tagName:"path",attrs:{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}},{tagName:"path",attrs:{d:"m17 16.5-5-3"}},{tagName:"path",attrs:{d:"m17 16.5 4.74-2.85"}},{tagName:"path",attrs:{d:"M17 16.5v5.17"}},{tagName:"path",attrs:{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}},{tagName:"path",attrs:{d:"M12 8 7.26 5.15"}},{tagName:"path",attrs:{d:"m12 8 4.74-2.85"}},{tagName:"path",attrs:{d:"M12 13.5V8"}}],searchEngine:[{tagName:"path",attrs:{d:"m21 21-4.34-4.34"}},{tagName:"circle",attrs:{cx:"11",cy:"11",r:"8"}}],objectStorage:[{tagName:"path",attrs:{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"}}],fileStorage:[{tagName:"path",attrs:{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z"}}],blockStorage:[{tagName:"path",attrs:{d:"M10 16h.01"}},{tagName:"path",attrs:{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}},{tagName:"path",attrs:{d:"M21.946 12.013H2.054"}},{tagName:"path",attrs:{d:"M6 16h.01"}}],backup:[{tagName:"circle",attrs:{cx:"15",cy:"19",r:"2"}},{tagName:"path",attrs:{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1"}},{tagName:"path",attrs:{d:"M15 11v-1"}},{tagName:"path",attrs:{d:"M15 17v-2"}}],cdn:[{tagName:"path",attrs:{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}},{tagName:"path",attrs:{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}},{tagName:"path",attrs:{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}},{tagName:"path",attrs:{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2"}}],messageQueue:[{tagName:"path",attrs:{d:"M11 5h10"}},{tagName:"path",attrs:{d:"M11 12h10"}},{tagName:"path",attrs:{d:"M11 19h10"}},{tagName:"path",attrs:{d:"M4 4h1v5"}},{tagName:"path",attrs:{d:"M4 9h2"}},{tagName:"path",attrs:{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}}],eventBus:[{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"12",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"19",r:"3"}},{tagName:"line",attrs:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}},{tagName:"line",attrs:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}}],streamProcessing:[{tagName:"path",attrs:{d:"M2 12q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 19q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 5q2.5 2 5 0t5 0 5 0 5 0"}}],webhook:[{tagName:"path",attrs:{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}},{tagName:"path",attrs:{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}},{tagName:"path",attrs:{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"}}],serviceMesh:[{tagName:"path",attrs:{d:"M12 3v18"}},{tagName:"path",attrs:{d:"M3 12h18"}},{tagName:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}],apiGateway:[{tagName:"circle",attrs:{cx:"6",cy:"19",r:"3"}},{tagName:"path",attrs:{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}},{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}}],loadBalancer:[{tagName:"circle",attrs:{cx:"12",cy:"18",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"6",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"6",r:"3"}},{tagName:"path",attrs:{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}},{tagName:"path",attrs:{d:"M12 12v3"}}],dns:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"path",attrs:{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}}],vpc:[{tagName:"rect",attrs:{x:"16",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"2",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"9",y:"2",width:"6",height:"6",rx:"1"}},{tagName:"path",attrs:{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}},{tagName:"path",attrs:{d:"M12 12V8"}}],subnet:[{tagName:"path",attrs:{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"}},{tagName:"path",attrs:{d:"M17 21v-2"}},{tagName:"path",attrs:{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10"}},{tagName:"path",attrs:{d:"M21 21v-2"}},{tagName:"path",attrs:{d:"M3 5V3"}},{tagName:"path",attrs:{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"}},{tagName:"path",attrs:{d:"M7 5V3"}}],vpn:[{tagName:"path",attrs:{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}},{tagName:"path",attrs:{d:"M6 8v1"}},{tagName:"path",attrs:{d:"M10 8v1"}},{tagName:"path",attrs:{d:"M14 8v1"}},{tagName:"path",attrs:{d:"M18 8v1"}}],identity:[{tagName:"path",attrs:{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}},{tagName:"circle",attrs:{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}}],firewall:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M12 9v6"}},{tagName:"path",attrs:{d:"M16 15v6"}},{tagName:"path",attrs:{d:"M16 3v6"}},{tagName:"path",attrs:{d:"M3 15h18"}},{tagName:"path",attrs:{d:"M3 9h18"}},{tagName:"path",attrs:{d:"M8 15v6"}},{tagName:"path",attrs:{d:"M8 3v6"}}],waf:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"m9 12 2 2 4-4"}}],secretManager:[{tagName:"circle",attrs:{cx:"12",cy:"16",r:"1"}},{tagName:"rect",attrs:{x:"3",y:"10",width:"18",height:"12",rx:"2"}},{tagName:"path",attrs:{d:"M7 10V7a5 5 0 0 1 10 0v3"}}],certificate:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"M8 12h.01"}},{tagName:"path",attrs:{d:"M12 12h.01"}},{tagName:"path",attrs:{d:"M16 12h.01"}}],systemBoundary:[{tagName:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tagName:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tagName:"path",attrs:{d:"M12 22V12"}}],monitoring:[{tagName:"path",attrs:{d:"m12 14 4-4"}},{tagName:"path",attrs:{d:"M3.34 19a10 10 0 1 1 17.32 0"}}],logging:[{tagName:"path",attrs:{d:"M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85"}},{tagName:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tagName:"path",attrs:{d:"M8 14v2.2l1.6 1"}},{tagName:"circle",attrs:{cx:"8",cy:"16",r:"6"}}],metrics:[{tagName:"path",attrs:{d:"M12 16v5"}},{tagName:"path",attrs:{d:"M16 14.639V21"}},{tagName:"path",attrs:{d:"M20 10.656V21"}},{tagName:"path",attrs:{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15"}},{tagName:"path",attrs:{d:"M4 18.463V21"}},{tagName:"path",attrs:{d:"M8 14.656V21"}}],tracing:[{tagName:"path",attrs:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}}],alerting:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"line",attrs:{x1:"12",x2:"12",y1:"8",y2:"12"}},{tagName:"line",attrs:{x1:"12",x2:"12.01",y1:"16",y2:"16"}}],saas:[{tagName:"path",attrs:{d:"m10.852 19.772-.383.924"}},{tagName:"path",attrs:{d:"m13.148 14.228.383-.923"}},{tagName:"path",attrs:{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 15.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 18.148.923.383"}},{tagName:"path",attrs:{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2"}},{tagName:"path",attrs:{d:"m9.228 15.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 18.148-.923.383"}}],externalApi:[{tagName:"path",attrs:{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}},{tagName:"path",attrs:{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}}],thirdPartyService:[{tagName:"path",attrs:{d:"M15 3h6v6"}},{tagName:"path",attrs:{d:"M10 14 21 3"}},{tagName:"path",attrs:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}}]},_Ae='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',JNt=12,eDt=550,tDt=17,rDt=10,nDt=14,fW=34,iDt=10,sDt=(t,e)=>{const r=t.x+t.width,n=e.x+e.width;if(e.x>=r)return{source:"right",target:"left"};if(n<=t.x)return{source:"top",target:"top"};const i=t.y+t.height/2;return e.y+e.height/2>=i?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}},LAe=["client","frontend","service","database","storage","queue","security","external"],aDt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},oDt={light:{canvas:"#F5F8F6",boundaryStroke:"#7B8F86",boundaryText:"#1C3D31",boundaryFill:"rgba(123, 143, 134, 0.05)",boundaryBadgeFill:"rgba(255, 255, 255, 0.95)",boundaryBadgeStroke:"rgba(123, 143, 134, 0.4)",nodes:{client:{fill:"#E9EFF5",stroke:"#3B6285",text:"#1A3B5C",accent:"#2B5A84",iconFrame:"#D4E2EE"},frontend:{fill:"#EEF2FF",stroke:"#4338CA",text:"#312E81",accent:"#4F46E5",iconFrame:"#E0E7FF"},service:{fill:"#E3F4EE",stroke:"#169567",text:"#19563E",accent:"#16A06E",iconFrame:"#D0ECE2"},database:{fill:"#EFE7FD",stroke:"#7437DC",text:"#472877",accent:"#7C3AED",iconFrame:"#E5D8FB"},storage:{fill:"#FAEFE1",stroke:"#CA6F07",text:"#71430F",accent:"#D97706",iconFrame:"#F7E4CD"},queue:{fill:"#FCEBE2",stroke:"#DA530D",text:"#793512",accent:"#EA580C",iconFrame:"#FBDECE"},security:{fill:"#FBE4E9",stroke:"#D11D44",text:"#751B2D",accent:"#E11D48",iconFrame:"#F9D2DA"},external:{fill:"#ECEEF1",stroke:"#5E6D82",text:"#3C424B",accent:"#64748B",iconFrame:"#E0E3E8"}},edges:{dependency:{stroke:"#64748B",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#0F8A5C",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#7C3AED",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#EA580C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}},dark:{canvas:"#101311",boundaryStroke:"#5B6F66",boundaryText:"#D7F4E8",boundaryFill:"rgba(91, 111, 102, 0.12)",boundaryBadgeFill:"rgba(16, 19, 17, 0.95)",boundaryBadgeStroke:"rgba(91, 111, 102, 0.5)",nodes:{client:{fill:"#132537",stroke:"#5A8EB9",text:"#DCE8F2",accent:"#5A8EB9",iconFrame:"#1C3752"},frontend:{fill:"#18214D",stroke:"#6366F1",text:"#E0E7FF",accent:"#6366F1",iconFrame:"#232F6B"},service:{fill:"#123A2B",stroke:"#49B58E",text:"#D5EEE5",accent:"#49B58E",iconFrame:"#13573E"},database:{fill:"#2E1E4F",stroke:"#9965F1",text:"#E7DCFC",accent:"#9965F1",iconFrame:"#44267B"},storage:{fill:"#482F0E",stroke:"#E1953D",text:"#F8E7D2",accent:"#E1953D",iconFrame:"#70430C"},queue:{fill:"#4D2610",stroke:"#EF7D41",text:"#FBE1D3",accent:"#EF7D41",iconFrame:"#79340F"},security:{fill:"#4B1620",stroke:"#E84F70",text:"#FAD6DE",accent:"#E84F70",iconFrame:"#74182B"},external:{fill:"#282E33",stroke:"#8693A5",text:"#E3E6EA",accent:"#8693A5",iconFrame:"#38424C"}},edges:{dependency:{stroke:"#94A3B8",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#4DB58B",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#A78BFA",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#FB923C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}}},TD=(t="light")=>oDt[t],lDt=(t,e)=>{const r=TD(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:LAe.includes(t)?r.nodes[t]:r.nodes.service},cDt=(t,e)=>t==="database"||t==="queue"||t==="external"?Math.round(e/2):t==="security"?16:t==="frontend"?10:t==="service"?8:t==="client"||t==="storage"?6:11,ghe=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,uDt=t=>Math.round((t-fW)/2),IAe=(t,e)=>{const r=t??(LAe.includes(e)?aDt[e]:"service");return phe[r]??phe.service},hDt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=IAe(t,e);return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"iconFrame"},...r.map((n,i)=>({tagName:n.tagName,selector:`architectureIcon${i}`})),{tagName:"text",selector:"label"}]},dDt=(t,e,r,n)=>{const i=TD(e),s=lDt(t,e),a=t==="boundary",o=cDt(t,r.height),l=uDt(r.height),u=a?[]:IAe(n,t),h=Object.fromEntries(u.map((d,f)=>[`architectureIcon${f}`,{...d.attrs,transform:`translate(15 ${l+5})`,fill:"none",stroke:s.accent,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}]));return{markup:hDt(n,t),body:{fill:s.fill,stroke:s.stroke,strokeWidth:1.5,strokeDasharray:a||t==="external"?"7 5":void 0,rx:o,ry:o},label:{fill:s.text,fontSize:a?12:JNt,fontWeight:a?650:eDt,fontFamily:_Ae,lineHeight:a?18:tDt,...a?{refX:20,refY:20,textAnchor:"start",textVerticalAnchor:"middle"}:{refX:54,refY:"50%",textAnchor:"start",textVerticalAnchor:"middle"}},attrs:a?{headerBadge:{ref:"label",refWidth:1,refHeight:1,refWidth2:16,refHeight2:6,refX:-8,refY:-3,fill:i.boundaryBadgeFill,stroke:i.boundaryBadgeStroke,strokeWidth:1,rx:4,ry:4,pointerEvents:"none"}}:{iconFrame:{x:iDt,y:l,width:fW,height:fW,rx:ghe(t),ry:ghe(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},fDt=(t,e,r=!1)=>{const n=TD(e).edges[t??"dependency"],i={name:"block",width:n.markerWidth,height:n.markerHeight};return{stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,sourceMarker:r?i:null,targetMarker:i,fill:"none"}},pW='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',pDt=10,gDt=14,mDt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},yDt=(t,e)=>{const r={x:t.x+t.width/2,y:t.y+t.height/2},n={x:e.x+e.width/2,y:e.y+e.height/2},i=n.x-r.x,s=n.y-r.y;return s<-t.height?{source:"left",target:"left"}:i<-t.width?{source:"top",target:"top"}:Math.abs(s)>=Math.abs(i)?s>=0?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}:i>=0?{source:"right",target:"left"}:{source:"left",target:"right"}},vDt=(t,e)=>{const r=e.x+e.width/2-(t.x+t.width/2),n=e.y+e.height/2-(t.y+t.height/2);return n<-t.height||r<-t.width?!1:Math.abs(r)<=1&&Math.abs(n)>8||Math.abs(n)<=1&&Math.abs(r)>8},bDt=.85,xDt=["brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],wDt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},TDt=t=>t&&xDt.includes(t)?t:wDt[t??"brand"]??"brand",CDt={brand:{light:{canvas:"#F5F8F6",edge:"#5C7166",process:{fill:"#FFFFFF",stroke:"#6F9B88",text:"#1C3D31"},decision:{fill:"#FFF6E5",stroke:"#D4A24A",text:"#7A4A12"},terminator:{fill:"#E7F6EF",stroke:"#16A06E",text:"#145C40"}},dark:{canvas:"#101311",edge:"#8CA397",process:{fill:"#1B2420",stroke:"#5B7569",text:"#E8F2ED"},decision:{fill:"#2A2316",stroke:"#E0B35C",text:"#F8E4B8"},terminator:{fill:"#1A3329",stroke:"#4DB58B",text:"#D8F3E6"}}},ink:{light:{canvas:"#F3F5F7",edge:"#64748B",process:{fill:"#FFFFFF",stroke:"#7D8794",text:"#1C232C"},decision:{fill:"#E8EDF3",stroke:"#6E7C8F",text:"#243044"},terminator:{fill:"#E6EAEF",stroke:"#3A4656",text:"#1A222C"}},dark:{canvas:"#101214",edge:"#94A3B8",process:{fill:"#1B1E23",stroke:"#6B7380",text:"#E8ECF1"},decision:{fill:"#222830",stroke:"#8B9BB0",text:"#D5DDE8"},terminator:{fill:"#1A2028",stroke:"#A8B4C4",text:"#E8EEF4"}}},paper:{light:{canvas:"#F6F1E8",edge:"#78716C",process:{fill:"#FFFCF6",stroke:"#C4B396",text:"#3A3126"},decision:{fill:"#F4E4CC",stroke:"#C08A48",text:"#6A3F14"},terminator:{fill:"#F0E4D0",stroke:"#7A5230",text:"#3F2A16"}},dark:{canvas:"#161310",edge:"#A8A29E",process:{fill:"#221E19",stroke:"#7A6A56",text:"#F3EBE0"},decision:{fill:"#2C2418",stroke:"#D4A06A",text:"#F6E2C4"},terminator:{fill:"#2A2118",stroke:"#C4A07A",text:"#F0E4D4"}}},island:{light:{canvas:"#F6EEE8",edge:"#7C6F68",process:{fill:"#FFF8F3",stroke:"#C4A090",text:"#3A2A22"},decision:{fill:"#F3D8C8",stroke:"#C46A48",text:"#6A3220"},terminator:{fill:"#EBD0C0",stroke:"#8B4A32",text:"#3F2418"}},dark:{canvas:"#161210",edge:"#ABA09A",process:{fill:"#231C18",stroke:"#8A6A56",text:"#F3E8E0"},decision:{fill:"#2C2018",stroke:"#D49070",text:"#F6D8C4"},terminator:{fill:"#281A16",stroke:"#C48868",text:"#F0D8CC"}}},tea:{light:{canvas:"#F4F6EE",edge:"#657361",process:{fill:"#FFFFFF",stroke:"#8A9A72",text:"#2A3420"},decision:{fill:"#E8EED4",stroke:"#8A9A48",text:"#3F4A18"},terminator:{fill:"#DCE6C8",stroke:"#4F6A32",text:"#243018"}},dark:{canvas:"#121410",edge:"#97A693",process:{fill:"#1C2018",stroke:"#6A7A56",text:"#E8F0DC"},decision:{fill:"#222618",stroke:"#B8C46A",text:"#E8F0C4"},terminator:{fill:"#1A2418",stroke:"#8AAA5A",text:"#D8E8C4"}}},cosmos:{light:{canvas:"#F2F5F8",edge:"#5C6D7E",process:{fill:"#FFFFFF",stroke:"#7A94A8",text:"#1C2A38"},decision:{fill:"#E4EEF5",stroke:"#5A82A0",text:"#1E3A52"},terminator:{fill:"#D8E6F0",stroke:"#2A5470",text:"#163044"}},dark:{canvas:"#101218",edge:"#8EA0B2",process:{fill:"#181E26",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#1C2834",stroke:"#7AA0C0",text:"#D0E4F4"},terminator:{fill:"#162028",stroke:"#8AB4D0",text:"#D8E8F4"}}},sun:{light:{canvas:"#F8F6EC",edge:"#736B5E",process:{fill:"#FFFEF6",stroke:"#D4C47A",text:"#3A3418"},decision:{fill:"#FFF0C4",stroke:"#E0B040",text:"#6A4A08"},terminator:{fill:"#F8E8B0",stroke:"#C09020",text:"#4A3808"}},dark:{canvas:"#16140C",edge:"#A8A092",process:{fill:"#242018",stroke:"#8A7A48",text:"#F6F0D8"},decision:{fill:"#2C2410",stroke:"#E0B848",text:"#F8E8B8"},terminator:{fill:"#28240C",stroke:"#D4B040",text:"#F4E8C0"}}},wa:{light:{canvas:"#F4F7F9",edge:"#5B6F7D",process:{fill:"#FFFFFF",stroke:"#8AA8C0",text:"#1C2C3A"},decision:{fill:"#FCE8DC",stroke:"#E09070",text:"#7A3A24"},terminator:{fill:"#DCE8F4",stroke:"#2A5A88",text:"#1A3858"}},dark:{canvas:"#101418",edge:"#8EA3B3",process:{fill:"#182028",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#2C2018",stroke:"#E0A080",text:"#F8DCC8"},terminator:{fill:"#162030",stroke:"#6A98C0",text:"#D4E4F4"}}},rose:{light:{canvas:"#F8F3F5",edge:"#75646B",process:{fill:"#FFFFFF",stroke:"#C49AAC",text:"#3A2430"},decision:{fill:"#F8E4EC",stroke:"#D0809A",text:"#7A3048"},terminator:{fill:"#F0D8E2",stroke:"#A04060",text:"#4A2030"}},dark:{canvas:"#161014",edge:"#A8969D",process:{fill:"#24181C",stroke:"#8A5A6A",text:"#F4E4EA"},decision:{fill:"#2C1A22",stroke:"#E090A8",text:"#F8D8E4"},terminator:{fill:"#28141C",stroke:"#E07090",text:"#F4D0DC"}}},mint:{light:{canvas:"#F2F8F7",edge:"#5A736F",process:{fill:"#FFFFFF",stroke:"#7AB0A8",text:"#1C3A38"},decision:{fill:"#E4F4F0",stroke:"#4AA89A",text:"#1A5A52"},terminator:{fill:"#D4EEE8",stroke:"#1A7A70",text:"#145048"}},dark:{canvas:"#101614",edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},NAe=(t="light",e)=>CDt[TDt(e)][t],kDt=(t,e,r)=>{const n=NAe(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},SDt=(t,e,r,n)=>{const i=kDt(t,e,n),s=t==="terminator",a=t==="decision";return{body:{fill:i.fill,stroke:i.stroke,strokeWidth:1.5,rx:s?Math.round(r.height/2):10,ry:s?Math.round(r.height/2):10,...a?{refPoints:"0,10 10,0 20,10 10,20"}:{},style:{filter:e==="dark"?"drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3))":"drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06)) drop-shadow(0 2px 5px rgba(15, 23, 42, 0.04))"}},label:{fill:i.text,fontSize:13,fontWeight:s?650:a?600:500,fontFamily:pW,lineHeight:18}}},EDt=1,ADt=2,MDt=["brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],RDt=["brand","ocean","ink","classic","sky","sunset","violet","rose","sand","slate","aurora","mono","sun","wa","island","mint","cosmos","tea","naive","macaron","paper","dune","prism","sunrise","marine","blossom"],_Dt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],LDt=[..._Dt,"rect","diamond","cloud"],IDt={ocean:"brand",ink:"brand",paper:"brand",classic:"sunrise",sunset:"sunrise",sun:"sunrise",wa:"marine",island:"dune",sand:"dune",tea:"slate",mono:"slate",slate:"slate",sky:"cosmos",cosmos:"cosmos",rose:"blossom",violet:"blossom",aurora:"mint",naive:"prism",mint:"mint",macaron:"macaron"},wQ=t=>t&&MDt.includes(t)?t:IDt[t??"brand"]??"brand",NDt=["client","webApp","mobileApp","website","apiClient","service","cpu","gpu","memory","virtualMachine","container","kubernetes","serverless","largeLanguageModel","multimodalModel","embeddingModel","reranker","modelInference","vectorDatabase","ragPipeline","aiAgent","modelGateway","mcpServer","relationalDatabase","noSqlDatabase","cache","dataWarehouse","searchEngine","objectStorage","fileStorage","blockStorage","backup","cdn","messageQueue","eventBus","streamProcessing","webhook","serviceMesh","apiGateway","loadBalancer","dns","vpc","subnet","vpn","identity","firewall","waf","secretManager","certificate","systemBoundary","monitoring","logging","metrics","tracing","alerting","saas","externalApi","thirdPartyService"],DDt="edgeever-diagram-v1",DAe=new RegExp(`\x3C!--\\s*${DDt}:([\\s\\S]*?)\\s*-->`),ODt=t=>QNt.decode(t),e8=t=>typeof t=="number"&&Number.isFinite(t),PDt=["mind-map","flowchart","architecture"],$Dt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],mhe=["dependency","request","async","data"],BDt=t=>typeof t=="string"&&NDt.includes(t),FDt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.label!="string"||!e8(e.x)||!e8(e.y)||!e8(e.width)||!e8(e.height)||!$Dt.includes(e.shape)?null:{id:e.id,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height,shape:e.shape,...typeof e.parentId=="string"&&e.parentId?{parentId:e.parentId}:{},...BDt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},zDt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!mhe.includes(e.kind)||e.bidirectional!==void 0&&typeof e.bidirectional!="boolean"?null:{id:e.id,source:e.source,target:e.target,...typeof e.label=="string"&&e.label?{label:e.label}:{},...mhe.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},VDt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(DAe))==null?void 0:r[1])==null?void 0:n.replace(/\s+/g,"");if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;try{const i=JSON.parse(ODt(e));if(!PDt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==ADt:i.schemaVersion!==EDt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=RDt.includes(i.theme)?i.theme:void 0,o=LDt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(FDt),u=i.edges.map(zDt);if(l.some(f=>!f)||u.some(f=>!f))return null;const h=new Set(l.map(f=>f.id)),d=new Map(l.map(f=>[f.id,f]));if(h.size!==l.length||l.some(f=>f.parentId&&(f.parentId===f.id||!h.has(f.parentId)))||u.some(f=>!h.has(f.source)||!h.has(f.target)))return null;if(s){if(l.some(f=>f.shape==="topic"||f.shape==="process"||f.shape==="decision"||f.shape==="terminator")||l.some(f=>{var p;return f.parentId&&((p=d.get(f.parentId))==null?void 0:p.shape)!=="boundary"})||u.some(f=>{var p,g;return((p=d.get(f.source))==null?void 0:p.shape)==="boundary"||((g=d.get(f.target))==null?void 0:g.shape)==="boundary"}))return null}else if(l.some(f=>!["topic","process","decision","terminator"].includes(f.shape)))return null;return{schemaVersion:i.schemaVersion,kind:i.kind,...a?{theme:a}:{},...i.kind==="mind-map"&&o?{structure:o}:{},nodes:l,edges:u}}catch{return null}},HDt=t=>(t??"").replace(DAe,"").trimEnd(),OAe={brand:{id:"brand",group:"classic",colors:["#16A06E","#059669","#0D9488","#10B981","#047857","#065F46"],lightCanvas:"#F8FAF9",darkCanvas:"#101311",accent:"#16A06E"},cosmos:{id:"cosmos",group:"classic",colors:["#2563EB","#0284C7","#4F46E5","#0D9488","#3B82F6","#1D4ED8"],lightCanvas:"#F8FAFC",darkCanvas:"#0F1318",accent:"#2563EB"},dune:{id:"dune",group:"classic",colors:["#C2410C","#D97706","#B45309","#A16207","#78350F","#9A3412"],lightCanvas:"#FAF8F5",darkCanvas:"#151311",accent:"#B45309"},slate:{id:"slate",group:"classic",colors:["#475569","#52525B","#4B5563","#334155","#64748B","#1E293B"],lightCanvas:"#F8F9FA",darkCanvas:"#121416",accent:"#475569"},prism:{id:"prism",group:"vivid",colors:["#E11D48","#EA580C","#D97706","#059669","#2563EB","#7C3AED"],lightCanvas:"#FAFAFA",darkCanvas:"#111215",accent:"#6366F1"},sunrise:{id:"sunrise",group:"vivid",colors:["#E11D48","#F97316","#F59E0B","#D97706","#DC2626","#EA580C"],lightCanvas:"#FFFDF7",darkCanvas:"#16130E",accent:"#EA580C"},marine:{id:"marine",group:"vivid",colors:["#0284C7","#06B6D4","#0D9488","#2563EB","#0891B2","#1D4ED8"],lightCanvas:"#F5FAFD",darkCanvas:"#0C1318",accent:"#0284C7"},blossom:{id:"blossom",group:"vivid",colors:["#DB2777","#C026D3","#9333EA","#E11D48","#BE185D","#7C3AED"],lightCanvas:"#FDF8FA",darkCanvas:"#160F14",accent:"#DB2777"},mint:{id:"mint",group:"vivid",colors:["#0D9488","#059669","#10B981","#0891B2","#16A34A","#047857"],lightCanvas:"#F5FAF8",darkCanvas:"#0D1512",accent:"#0D9488"},macaron:{id:"macaron",group:"vivid",colors:["#EC4899","#FB923C","#EAB308","#10B981","#38BDF8","#8B5CF6"],lightCanvas:"#FAF9F8",darkCanvas:"#131316",accent:"#EC4899"}},GDt=Object.fromEntries(Object.entries(OAe).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),gW=t=>{const e=t.replace("#","");return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]},WDt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,ll=(t,e,r)=>{const n=gW(t),i=gW(e);return WDt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},qDt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},PAe=t=>{const[e,r,n]=gW(t).map(qDt);return e*.2126+r*.7152+n*.0722},mW=t=>PAe(t)>.35?"#1C1917":"#FFFCF8",UDt=t=>GDt[wQ(t)].colors,YDt=t=>wQ(t)!=="brand",yW=(t,e)=>{const r=PAe(t);return e==="dark"?r<.22?ll(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?ll(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},jDt=(t,e)=>UDt(t).map(n=>{const i=yW(n,e),s=e==="dark"?ll(n,"#121518",.72):ll(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?ll(i,"#FFFFFF",.15):ll(i,"#1C1917",.12),text:mW(s),edge:i}}),XDt=(t,e)=>{const r=wQ(t),n=OAe[r],i=n.accent;if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:"#101311"}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:"#F8FAF9"};if(e==="dark"){const a=yW(i,"dark");return{topicFill:i,topicText:mW(i),nodeFill:ll(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:ll(a,"#FFFFFF",.15),topicStroke:ll(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:ll(i,"#FFFFFF",.15),canvas:n.darkCanvas}}const s=yW(i,"light");return{topicFill:i,topicText:mW(i),nodeFill:ll(i,"#FFFFFF",.88),nodeText:ll(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:ll(s,"#FFFFFF",.5),topicStroke:ll(i,"#1C1917",.15),mindMapEdge:s,flowEdge:ll(i,"#1C1917",.15),canvas:n.lightCanvas}},TQ=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),KDt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},ZDt=13,QDt=18,yhe=.7,JDt=(t,e)=>t.split(` -`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&TQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),eOt=(t,e)=>{const r=KDt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*yhe:a-s)/ZDt),l=JDt(e,o),u=Math.max(l.length,1)*QDt,h=Math.max(r.height,n?Math.ceil(u/(1-yhe)):u+(i?16:18));return{width:a,height:h,text:l.join(` -`)}},$Ae="edgeever-mindmap",vhe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',tOt=10,rOt=14,CQ=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",nOt=t=>{const e=CQ(t);return e==="map"||e==="logic"},h3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,kQ=(t,e="primary")=>h3(e,t)?"underline":t==="capsule"?"capsule":t==="ellipse"?"ellipse":t==="circle"?"circle":t==="hexagon"?"hexagon":t==="box"||t==="logic"||t==="org"?"rounded":e==="root"?"capsule":"rounded",iOt=(t,e="primary")=>{const r=kQ(t,e);return[r==="ellipse"||r==="circle"?{tagName:"ellipse",selector:"body"}:r==="diamond"||r==="hexagon"?{tagName:"polygon",selector:"body"}:r==="cloud"?{tagName:"path",selector:"body"}:{tagName:"rect",selector:"body"},{tagName:"path",selector:"underline"},{tagName:"text",selector:"label"}]},sOt={light:[{fill:"#E7F6EF",stroke:"#0F8A5C",text:"#145C40",edge:"#16A06E"},{fill:"#E7F0FE",stroke:"#2563EB",text:"#1E3A8A",edge:"#3B82F6"},{fill:"#F3E8FF",stroke:"#7C3AED",text:"#5B21B6",edge:"#8B5CF6"},{fill:"#FEF3C7",stroke:"#D97706",text:"#92400E",edge:"#F59E0B"},{fill:"#FCE7F3",stroke:"#DB2777",text:"#9D174D",edge:"#EC4899"},{fill:"#CFFAFE",stroke:"#0E7490",text:"#155E75",edge:"#06B6D4"}],dark:[{fill:"#1A2A22",stroke:"#4DB58B",text:"#D7F4E8",edge:"#4DB58B"},{fill:"#1A2438",stroke:"#60A5FA",text:"#DBEAFE",edge:"#60A5FA"},{fill:"#251B38",stroke:"#A78BFA",text:"#EDE9FE",edge:"#A78BFA"},{fill:"#2A2114",stroke:"#FBBF24",text:"#FEF3C7",edge:"#FBBF24"},{fill:"#2A1520",stroke:"#F472B6",text:"#FCE7F3",edge:"#F472B6"},{fill:"#15252B",stroke:"#22D3EE",text:"#CFFAFE",edge:"#22D3EE"}]},aOt=(t,e)=>t.split(` -`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&TQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),er=t=>(Math.round(t*100)/100).toFixed(2),oOt=t=>YDt(t),FM=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=r.get(e);if(!(n!=null&&n.parentId))return"root";const i=r.get(n.parentId);return i!=null&&i.parentId?"nested":"primary"},lOt=(t,e)=>{const r=new Map(t.map(u=>[u.id,u])),n=r.get(e);if(!(n!=null&&n.parentId))return null;let i=n,s=n;const a=new Set;for(;s.parentId&&r.has(s.parentId)&&!a.has(s.id);){a.add(s.id);const u=r.get(s.parentId);if(!u)break;if(!u.parentId){i=s;break}s=u,i=s}const l=t.filter(u=>u.parentId===i.parentId).sort((u,h)=>(u.y??0)-(h.y??0)||(u.x??0)-(h.x??0)||u.id.localeCompare(h.id)).findIndex(u=>u.id===i.id);return l<0?0:l},cOt=(t,e,r)=>{if(t==null)return;const n=r?jDt(r,e):sOt[e];return n[t%n.length]},uOt=(t,e="primary",r)=>{const n=e==="root",i=h3(e,r),s=kQ(r,e),a=n?36:i?22:s==="diamond"||s==="hexagon"||s==="circle"?36:28,o=Math.round(Math.min(n?180:s==="circle"?132:168,Math.max(n?124:i?88:s==="circle"?108:96,TQ(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},hOt=(t,e,r)=>{const n=uOt(t,e,r),i=h3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=aOt(t,Math.max(4,(n.width-a)/13));return{...n,height:Math.max(n.height,o.length*s+(e==="root"?18:i?10:14)),text:o.join(` -`),fontSize:e==="root"?15:e==="primary"?14:13}},dOt=t=>Math.round(Math.max(1,t/2)),fOt=(t,e)=>`M 1 ${er(Math.max(2,e-2))} H ${er(Math.max(2,t-1))}`,pOt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${er(r*.18)} ${er(n*.62)}`,`Q ${er(r*.06)} ${er(n*.6)} ${er(r*.08)} ${er(n*.44)}`,`Q ${er(r*.02)} ${er(n*.26)} ${er(r*.22)} ${er(n*.24)}`,`Q ${er(r*.3)} ${er(n*.06)} ${er(r*.48)} ${er(n*.14)}`,`Q ${er(r*.6)} ${er(n*.02)} ${er(r*.72)} ${er(n*.16)}`,`Q ${er(r*.96)} ${er(n*.14)} ${er(r*.92)} ${er(n*.4)}`,`Q ${er(r*1.02)} ${er(n*.56)} ${er(r*.84)} ${er(n*.64)}`,`Q ${er(r*.8)} ${er(n*.84)} ${er(r*.58)} ${er(n*.78)}`,`Q ${er(r*.42)} ${er(n*.92)} ${er(r*.3)} ${er(n*.76)}`,`Q ${er(r*.12)} ${er(n*.82)} ${er(r*.18)} ${er(n*.62)}`,"Z"].join(" ")},gOt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:pOt(e,r)}:{rx:n,ry:n},mOt=(t,e,r={})=>{const n=r.underline??h3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=kQ(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:vhe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:fOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?dOt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...gOt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:vhe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},bhe=(t,e,r,n,i,s,a)=>{const o=FM(t,e),l=h3(o,a),u=oOt(n)?cOt(lOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:mOt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},yOt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},vOt=(t,e,r)=>{const n=CQ(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?sa+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},xhe=(t,e,r,n)=>{const i=h3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},bOt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},whe=(t,e)=>nOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},xOt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},wOt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},TOt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${er(t.x)} ${er(t.y)} L ${er(e.x)} ${er(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,x=xOt(o,l,u,h,v),b=wOt(o,l,u,h,v),T=Math.hypot(b.x,b.y)||1,C=((1-v)*r+v*n)/2,S=-b.y/T,k=b.x/T;f.push({x:x.x+S*C,y:x.y+k*C}),p.push({x:x.x-S*C,y:x.y-k*C})}const g=f[0],m=[`M ${er(g.x)} ${er(g.y)}`];for(let y=1;y=0;y-=1)m.push(`L ${er(p[y].x)} ${er(p[y].y)}`);return m.push("Z"),m.join(" ")},COt=t=>`${er(t.x)} ${er(t.y)}`,Id=t=>t.map((e,r)=>`${r===0?"M":"L"} ${COt(e)}`).join(" "),kOt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Id([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Id([t,n,i,e])},SOt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Id([t,e]):Id([t,{x:r,y:t.y},{x:r,y:e.y},e])},EOt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Id([t,{x:d-h,y:t.y}]),`M ${er(d-h)} ${er(o)}`,`C ${er(d)} ${er(o)} ${er(d)} ${er(o)} ${er(d)} ${er((o+u)/2)}`,`C ${er(d)} ${er(u)} ${er(d+h)} ${er(u)} ${er(d+h)} ${er(u)}`,`C ${er(d)} ${er(u)} ${er(d)} ${er(u)} ${er(d)} ${er((u+l)/2)}`,`C ${er(d)} ${er(l)} ${er(d)} ${er(l)} ${er(d-h)} ${er(l)}`,Id([{x:d,y:e.y},e])].join(" ")},AOt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Id([t,e]):Id([t,{x:e.x,y:t.y},e]),MOt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Id([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Id([t,s,e])},ROt=(t,e,r,n={})=>{const i=CQ(n.structure);return i==="org"?kOt(t,e):i==="tree"?SOt(t,e):i==="brace"?EOt(t,e,n.braceTop,n.braceBottom):i==="timeline"?AOt(t,e):i==="fishbone"?MOt(t,e):TOt(t,e,n.sourceWidth,n.targetWidth)},_Ot=(t="brand",e="light")=>XDt(t,e),LOt=(t,e)=>{const r=_Ot(t.theme??"brand",e),n=t.kind==="flowchart"?NAe(e,t.theme):null,i=t.kind==="architecture"?TD(e):null,s=t.nodes.map(l=>{const u=t.kind==="mind-map"?FM(t.nodes,l.id):null,h=t.kind==="flowchart"?eOt(l.shape,l.label):u?hOt(l.label,u,t.structure):{width:l.width,height:l.height,text:l.label},d=u?bhe(t.nodes,l.id,r,t.theme,e,h,t.structure):null,f=(d==null?void 0:d.visual)??null,p=t.kind==="flowchart"?SDt(l.shape,e,h,t.theme):null,g=t.kind==="architecture"?dDt(l.shape,e,h,l.resourceIcon):null,m=l.shape==="topic"&&!l.parentId,y=l.shape==="terminator",v=l.shape==="boundary",x=m||y,b=f?f.body.fill:p?p.body.fill:g?g.body.fill:x?r.topicFill:r.nodeFill,T=f?f.body.stroke:p?p.body.stroke:g?g.body.stroke:x?r.topicStroke:r.nodeStroke;return{id:l.id,shape:l.shape==="decision"?"polygon":"rect",x:l.x,y:l.y,width:h.width,height:h.height,zIndex:v?0:2,...g?{markup:g.markup}:u?{markup:iOt(t.structure,u)}:{},attrs:{body:{fill:b,stroke:T,strokeWidth:(f==null?void 0:f.body.strokeWidth)??(p==null?void 0:p.body.strokeWidth)??(g==null?void 0:g.body.strokeWidth)??1,strokeDasharray:(g==null?void 0:g.body.strokeDasharray)??(v?"7 5":void 0),...(f==null?void 0:f.body)??(p==null?void 0:p.body)??(g==null?void 0:g.body)??{rx:y?24:11,ry:y?24:11},...l.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:h.text,lineHeight:(f==null?void 0:f.label.lineHeight)??(p==null?void 0:p.label.lineHeight)??(g==null?void 0:g.label.lineHeight)??(u==="root"?20:18),fill:(f==null?void 0:f.label.fill)??(p==null?void 0:p.label.fill)??(g==null?void 0:g.label.fill)??(x?r.topicText:r.nodeText),fontSize:(f==null?void 0:f.label.fontSize)??(p==null?void 0:p.label.fontSize)??(g==null?void 0:g.label.fontSize)??(l.shape==="topic"?14:13),fontWeight:(f==null?void 0:f.label.fontWeight)??(p==null?void 0:p.label.fontWeight)??(g==null?void 0:g.label.fontWeight)??(x?650:500),fontFamily:(f==null?void 0:f.label.fontFamily)??(p==null?void 0:p.label.fontFamily)??(g==null?void 0:g.label.fontFamily)??pW,...f?{refX:f.label.refX,refY:f.label.refY,textAnchor:f.label.textAnchor,textVerticalAnchor:f.label.textVerticalAnchor}:{},...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{}},...f?{underline:f.underline}:{},...(g==null?void 0:g.attrs)??{}}}}),a=new Map(s.map(l=>[l.id,l])),o=t.edges.map(l=>{const u=l.kind??(t.kind==="architecture"?"dependency":void 0),h=a.get(l.source),d=a.get(l.target),f=t.kind==="mind-map"?FM(t.nodes,l.source):null,p=t.kind==="mind-map"?FM(t.nodes,l.target):null,g=t.kind==="mind-map"?bhe(t.nodes,l.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,m=f?yOt(f,r,g):null,y=h&&d?vOt(h,d,t.structure):{source:"right",target:"left"},v=h&&f?xhe(h,f,y.source,t.structure):null,x=d&&p?xhe(d,p,y.target,t.structure):null,b=t.kind==="mind-map"&&t.structure==="brace"?bOt(t.nodes,l.source):null,T=t.kind==="architecture"?fDt(u,e,l.bidirectional):null,C=(T==null?void 0:T.stroke)??(m==null?void 0:m.stroke)??(n==null?void 0:n.edge)??r.flowEdge,S=h&&d?t.kind==="architecture"?sDt(h,d):t.kind==="flowchart"?yDt(h,d):null:null,k=!!(S&&h&&d&&vDt(h,d));return{id:l.id,source:t.kind==="mind-map"?{cell:l.source,...v??{anchor:{name:y.source}}}:S?{cell:l.source,port:S.source}:{cell:l.source},target:t.kind==="mind-map"?{cell:l.target,...x??{anchor:{name:y.target}}}:S?{cell:l.target,port:S.target}:{cell:l.target},router:t.kind==="flowchart"||t.kind==="architecture"?k?{name:"normal"}:mDt:void 0,connector:t.kind==="mind-map"?{name:$Ae,args:{sourceWidth:m==null?void 0:m.sourceWidth,targetWidth:m==null?void 0:m.targetWidth,structure:t.structure,...b?{braceTop:b.top,braceBottom:b.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{stroke:C,strokeWidth:(T==null?void 0:T.strokeWidth)??(m?whe(t.structure,C).strokeWidth:1.5),strokeDasharray:T==null?void 0:T.strokeDasharray,sourceMarker:T?T.sourceMarker:l.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(T==null?void 0:T.targetMarker)??{name:"block",width:7,height:5},...m?whe(t.structure,C):{fill:"none"}}},labels:l.label?[{attrs:{label:{text:l.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?rDt:t.kind==="flowchart"?pDt:tOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?nDt:t.kind==="flowchart"?gDt:rOt,fontFamily:t.kind==="architecture"?_Ae:pW,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(T==null?void 0:T.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:o,nodes:s}},BAe={compact:560,standard:680,wide:800},IOt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,NOt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},p5={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},The={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Che={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},DOt=(t,e)=>e&&p5[e]?e:t==="warm"?"sunset":t&&p5[t]?t:"slate",OOt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return IOt.test(n)?`_${n}`:n},cC=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),POt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="slate",fontStyle:a="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=a==="mono",p=s==="notepad",g=f?`
    +`});er({name:Qe().trim().min(1).max(80),parentId:Qe().trim().min(1).nullable().optional()});er({name:Qe().trim().min(1).max(80).optional(),parentId:Qe().trim().min(1).nullable().optional(),sortOrder:ia().int().optional()});er({notebookId:Qe().trim().min(1),title:Qe().trim().max(160).optional(),contentJson:Dd().optional(),contentMarkdown:Qe().optional(),tags:ni(Qe()).optional(),createdAt:Qe().datetime().optional(),updatedAt:Qe().datetime().optional()});er({expectedRevision:ia().int().min(0).optional(),expectedContentHash:Qe().length(64).optional(),editSessionId:Qe().trim().min(1).optional(),notebookId:Qe().trim().min(1).optional(),title:Qe().trim().max(160).optional(),isPinned:ri().optional(),contentJson:Dd().optional(),contentMarkdown:Qe().optional(),tags:ni(Qe()).optional(),createdAt:Qe().datetime().optional(),updatedAt:Qe().datetime().optional(),allowDestructiveOverwrite:ri().optional()});er({name:Qe().trim().min(1).max(160),description:Qe().trim().max(500).optional(),memoId:Qe().trim().min(1).optional(),title:Qe().trim().max(160).nullable().optional(),contentMarkdown:Qe().optional(),tags:ni(Qe()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});er({name:Qe().trim().min(1).max(160).optional(),description:Qe().trim().max(500).nullable().optional(),title:Qe().trim().max(160).nullable().optional(),contentMarkdown:Qe().optional(),tags:ni(Qe()).optional()});er({notebookId:Qe().trim().min(1)});const vAe=er({pluginId:Qe().trim().min(3).max(200),commandId:Qe().trim().min(1).max(200)}),XNt=er({name:Qe().trim().min(1).max(120),taskType:Oc("plugin-command"),taskPayload:vAe,cronExpression:Qe().trim().min(1).max(160),timezone:Qe().trim().min(1).max(80),executorDeviceId:Qe().trim().min(16).max(160),missedRunPolicy:pi(["run-once","skip"]).default("run-once"),isEnabled:ri().default(!0)});XNt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:vAe.optional(),executorDeviceId:Qe().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});er({pluginId:Qe().trim().min(3).max(200),scheduleKey:Qe().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Qe().trim().min(1).max(120),commandId:Qe().trim().min(1).max(200),cronExpression:Qe().trim().min(1).max(160),timezone:Qe().trim().min(1).max(80),executorDeviceId:Qe().trim().min(16).max(160),missedRunPolicy:pi(["run-once","skip"]).default("run-once"),isEnabled:ri().optional()});er({scheduledFor:Qe().datetime(),executorDeviceId:Qe().trim().min(16).max(160)});er({executorDeviceId:Qe().trim().min(16).max(160),status:pi(["succeeded","failed"]),errorMessage:Qe().trim().max(2e3).nullable().optional()});const fhe=Qe().trim().max(2e3).refine(t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},{message:"URL must use http or https."});er({type:pi(["plugin","theme"]),version:Qe().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:ri(),installedAt:Qe().datetime(),manifestUrl:fhe,sourceKind:pi(["marketplace","github","manifest"]),verified:ri(),repositoryUrl:fhe.max(500).nullable().optional(),releaseTag:Qe().trim().min(1).max(80).nullable().optional(),publisher:Oc("edgeever").nullable().optional()}).refine(t=>t.sourceKind==="github"?!!t.repositoryUrl:t.sourceKind==="marketplace"?!!(t.repositoryUrl||t.manifestUrl):!0,{message:"GitHub and marketplace extensions require a source URL."});er({memoIds:ni(Qe().trim().min(1)).min(1).max(100),notebookId:Qe().trim().min(1)});er({memoIds:ni(Qe().trim().min(1)).min(1).max(100),permanent:ri().optional()});er({memoIds:ni(Qe().trim().min(1)).min(2).max(50),notebookId:Qe().trim().min(1).optional(),title:Qe().trim().max(160).optional()});er({username:Qe().trim().min(1).max(80),password:Qe().min(1).max(512),deviceId:Qe().trim().min(16).max(160).optional()});er({label:Qe().trim().max(80).nullable()});er({currentPassword:Qe().min(1).max(512),newPassword:Qe().min(8).max(512),confirmPassword:Qe().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});er({username:Qe().trim().min(1).max(80),displayName:Qe().trim().max(80).nullable().optional(),password:Qe().min(8).max(512)});er({displayName:Qe().trim().max(80).nullable().optional(),password:Qe().min(8).max(512).optional(),isDisabled:ri().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");er({name:Qe().trim().min(1).max(80),scopes:ni(Qe().trim().min(1).max(80)).min(1).max(32),expiresAt:Qe().datetime().nullable().optional()});er({name:Qe().trim().min(1).max(80)});er({filename:Qe().trim().min(1).max(160)});const bAe=Qe().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");hAe("provider",[er({provider:Oc("builtin")}),er({provider:Oc("s3"),displayName:Qe().trim().min(1).max(80),endpoint:bAe,region:Qe().trim().min(1).max(80),bucket:Qe().trim().min(1).max(255),accessKeyId:Qe().trim().min(1).max(256),secretAccessKey:Qe().min(1).max(1024).optional(),forcePathStyle:ri().default(!0),objectPrefix:Qe().trim().max(500).default("")})]);er({endpoint:bAe,region:Qe().trim().min(1).max(80),bucket:Qe().trim().min(1).max(255),accessKeyId:Qe().trim().min(1).max(256),secretAccessKey:Qe().min(1).max(1024).optional(),forcePathStyle:ri().default(!0),objectPrefix:Qe().trim().max(500).default("")});const xAe=pi(["openai-compatible","anthropic","google"]),wAe=Qe().trim().url().max(500).superRefine((t,e)=>{let r;try{r=new URL(t)}catch{return}r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:"custom",message:"AI Base URL must use HTTP or HTTPS."}),(r.username||r.password)&&e.addIssue({code:"custom",message:"AI Base URL must not contain credentials."})}),TAe=er({provider:xAe,displayName:Qe().trim().min(1).max(80),baseUrl:wAe,isEnabled:ri().default(!0)});TAe.extend({apiKey:Qe().min(1).max(4096),initialModelId:Qe().trim().min(1).max(200).optional()});TAe.extend({apiKey:Qe().min(1).max(4096).optional()});er({modelId:Qe().trim().min(1).max(200),provider:xAe.optional(),baseUrl:wAe.optional(),apiKey:Qe().min(1).max(4096).optional()});er({modelId:Qe().trim().min(1).max(200),displayName:Qe().trim().min(1).max(200).optional()});er({modelConfigId:Qe().trim().min(1).nullable()});const KNt=er({filename:Qe().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:pi(NNt),base64Data:Qe().min(1).max(Math.ceil(uhe/3)*4)}).superRefine((t,e)=>{const r=gAe(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=$Nt(t.mediaType)?ONt:uhe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});er({action:pi(pW),promptId:Qe().trim().min(1).max(200).optional(),locale:Qe().trim().min(2).max(35).optional(),title:Qe().trim().max(160).default(""),contentMarkdown:Qe().max(3e5),stream:ri().default(!1),targetLanguage:pi(INt).optional(),tone:pi(LNt).optional(),instruction:Qe().trim().min(1).max(2e3).optional(),attachments:ni(KNt).max(DNt).default([])}).superRefine((t,e)=>{!t.promptId&&t.action==="translate"&&!t.targetLanguage&&e.addIssue({code:"custom",path:["targetLanguage"],message:"A target language is required for translation."}),!t.promptId&&t.action==="change-tone"&&!t.tone&&e.addIssue({code:"custom",path:["tone"],message:"A tone is required when changing tone."}),!t.promptId&&t.action==="custom"&&!t.instruction&&e.addIssue({code:"custom",path:["instruction"],message:"An instruction is required for a custom action."});const r=t.action==="custom"&&!!(t.instruction||t.promptId);!t.title&&!t.contentMarkdown.trim()&&t.attachments.length===0&&!r&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."}),t.attachments.reduce((i,s)=>i+(gAe(s.base64Data)??0),0)>PNt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});er({title:Qe().trim().max(160).default(""),contentMarkdown:Qe().max(3e5),currentTags:ni(Qe().trim().min(1).max(200)).max(24).default([]),locale:Qe().trim().min(2).max(35).optional()}).superRefine((t,e)=>{!t.title&&!t.contentMarkdown.trim()&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."})});er({name:Qe().trim().min(1).max(80),description:Qe().trim().max(200).optional(),instruction:Qe().trim().min(1).max(2e3),parameterKind:pi(xQ).default("none"),resultMode:pi(wQ).default("both")});er({name:Qe().trim().min(1).max(80).optional(),description:Qe().trim().max(200).nullable().optional(),instruction:Qe().trim().min(1).max(2e3).optional(),parameterKind:pi(xQ).optional(),resultMode:pi(wQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});er({passwordProtected:ri()});er({bodyFont:pi(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});er({password:Qe().min(1).max(64)});const ZNt=er({fieldId:Qe().trim().min(1).max(80),required:ri()});er({enabled:ri(),passwordProtected:ri(),rotatePassword:ri().optional(),title:Qe().trim().max(120),description:Qe().trim().max(1e3),submitLabel:Qe().trim().max(40),fields:ni(ZNt).max(40)});er({cells:kD(Qe().max(80),Dd())});const CAe="3.9.3",QNt=CAe,phe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,ghe=typeof TextEncoder=="function"?new TextEncoder:void 0,JNt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",rk=Array.prototype.slice.call(JNt),r8=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(rk),eDt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,yo=String.fromCharCode.bind(String),tDt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),kAe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),SAe=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),EAe=t=>{let e,r,n,i,s="";const a=t.length%3;for(let o=0;o255||(n=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=rk[e>>18&63]+rk[e>>12&63]+rk[e>>6&63]+rk[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},CQ=typeof btoa=="function"?t=>btoa(t):EAe,gW=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;ne?kAe(gW(t)):gW(t),rDt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?yo(192|e>>>6)+yo(128|e&63):yo(224|e>>>12&15)+yo(128|e>>>6&63)+yo(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return yo(240|e>>>18&7)+yo(128|e>>>12&63)+yo(128|e>>>6&63)+yo(128|e&63)}},nDt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,AAe=t=>t.replace(nDt,rDt),mhe=ghe?t=>gW(ghe.encode(t)):t=>CQ(AAe(t)),Nb=(t,e=!1)=>e?kAe(mhe(t)):mhe(t),yhe=t=>Nb(t,!0),iDt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,sDt=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return yo((r>>>10)+55296)+yo((r&1023)+56320);case 3:return yo((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return yo((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},MAe=t=>t.replace(iDt,sDt),RAe=t=>{if(t=t.replace(/\s+/g,""),!eDt.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,i=[];for(let s=0;s>16&255)):n===64?i.push(yo(e>>16&255,e>>8&255)):i.push(yo(e>>16&255,e>>8&255,e&255));return i.join("")},kQ=typeof atob=="function"?t=>atob(SAe(t)):RAe,_Ae=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>tDt(kQ(t).split("").map(e=>e.charCodeAt(0))),LAe=t=>_Ae(IAe(t)),aDt=phe?t=>phe.decode(_Ae(t)):t=>MAe(kQ(t)),IAe=t=>SAe(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),mW=t=>aDt(IAe(t)),oDt=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},NAe=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),DAe=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,NAe(r));t("fromBase64",function(){return mW(this)}),t("toBase64",function(e){return Nb(this,e)}),t("toBase64URI",function(){return Nb(this,!0)}),t("toBase64URL",function(){return Nb(this,!0)}),t("toUint8Array",function(){return LAe(this)})},OAe=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,NAe(r));t("toBase64",function(e){return HM(this,e)}),t("toBase64URI",function(){return HM(this,!0)}),t("toBase64URL",function(){return HM(this,!0)})},lDt=()=>{DAe(),OAe()},cDt={version:CAe,VERSION:QNt,atob:kQ,atobPolyfill:RAe,btoa:CQ,btoaPolyfill:EAe,fromBase64:mW,toBase64:Nb,encode:Nb,encodeURI:yhe,encodeURL:yhe,utob:AAe,btou:MAe,decode:mW,isValid:oDt,fromUint8Array:HM,toUint8Array:LAe,extendString:DAe,extendUint8Array:OAe,extendBuiltins:lDt},ol="#f8fafb",ll="#191e1b",vhe={client:[{tagName:"path",attrs:{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}},{tagName:"path",attrs:{d:"M10 19v-3.96 3.15"}},{tagName:"path",attrs:{d:"M7 19h5"}},{tagName:"rect",attrs:{width:"6",height:"10",x:"16",y:"12",rx:"2"}}],webApp:[{tagName:"rect",attrs:{x:"2",y:"4",width:"20",height:"16",rx:"2"}},{tagName:"path",attrs:{d:"M10 4v4"}},{tagName:"path",attrs:{d:"M2 8h20"}},{tagName:"path",attrs:{d:"M6 4v4"}}],mobileApp:[{tagName:"rect",attrs:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M12 18h.01"}}],website:[{tagName:"path",attrs:{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54"}},{tagName:"path",attrs:{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"}},{tagName:"path",attrs:{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}}],apiClient:[{tagName:"path",attrs:{d:"m18 16 4-4-4-4"}},{tagName:"path",attrs:{d:"m6 8-4 4 4 4"}},{tagName:"path",attrs:{d:"m14.5 4-5 16"}}],service:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}},{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"6",y2:"6"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"18",y2:"18"}}],cpu:[{tagName:"path",attrs:{d:"M12 20v2"}},{tagName:"path",attrs:{d:"M12 2v2"}},{tagName:"path",attrs:{d:"M17 20v2"}},{tagName:"path",attrs:{d:"M17 2v2"}},{tagName:"path",attrs:{d:"M2 12h2"}},{tagName:"path",attrs:{d:"M2 17h2"}},{tagName:"path",attrs:{d:"M2 7h2"}},{tagName:"path",attrs:{d:"M20 12h2"}},{tagName:"path",attrs:{d:"M20 17h2"}},{tagName:"path",attrs:{d:"M20 7h2"}},{tagName:"path",attrs:{d:"M7 20v2"}},{tagName:"path",attrs:{d:"M7 2v2"}},{tagName:"rect",attrs:{x:"4",y:"4",width:"16",height:"16",rx:"2"}},{tagName:"rect",attrs:{x:"8",y:"8",width:"8",height:"8",rx:"1"}}],gpu:[{tagName:"path",attrs:{d:"M2 17h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H2"}},{tagName:"path",attrs:{d:"M2 21V3"}},{tagName:"path",attrs:{d:"M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3"}},{tagName:"circle",attrs:{cx:"16",cy:"11",r:"2"}},{tagName:"circle",attrs:{cx:"8",cy:"11",r:"2"}}],memory:[{tagName:"path",attrs:{d:"M12 12v-2"}},{tagName:"path",attrs:{d:"M12 18v-2"}},{tagName:"path",attrs:{d:"M16 12v-2"}},{tagName:"path",attrs:{d:"M16 18v-2"}},{tagName:"path",attrs:{d:"M2 11h1.5"}},{tagName:"path",attrs:{d:"M20 18v-2"}},{tagName:"path",attrs:{d:"M20.5 11H22"}},{tagName:"path",attrs:{d:"M4 18v-2"}},{tagName:"path",attrs:{d:"M8 12v-2"}},{tagName:"path",attrs:{d:"M8 18v-2"}},{tagName:"rect",attrs:{x:"2",y:"6",width:"20",height:"10",rx:"2"}}],virtualMachine:[{tagName:"path",attrs:{d:"m10.852 14.772-.383.923"}},{tagName:"path",attrs:{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.148 9.228.383-.923"}},{tagName:"path",attrs:{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 10.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 13.148.923.383"}},{tagName:"path",attrs:{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"}},{tagName:"path",attrs:{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"}},{tagName:"path",attrs:{d:"M6 18h.01"}},{tagName:"path",attrs:{d:"M6 6h.01"}},{tagName:"path",attrs:{d:"m9.228 10.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 13.148-.923.383"}}],container:[{tagName:"path",attrs:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"}},{tagName:"path",attrs:{d:"M10 21.9V14L2.1 9.1"}},{tagName:"path",attrs:{d:"m10 14 11.9-6.9"}},{tagName:"path",attrs:{d:"M14 19.8v-8.1"}},{tagName:"path",attrs:{d:"M18 17.5V9.4"}}],kubernetes:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"8"}},{tagName:"path",attrs:{d:"M12 2v7.5"}},{tagName:"path",attrs:{d:"m19 5-5.23 5.23"}},{tagName:"path",attrs:{d:"M22 12h-7.5"}},{tagName:"path",attrs:{d:"m19 19-5.23-5.23"}},{tagName:"path",attrs:{d:"M12 14.5V22"}},{tagName:"path",attrs:{d:"M10.23 13.77 5 19"}},{tagName:"path",attrs:{d:"M9.5 12H2"}},{tagName:"path",attrs:{d:"M10.23 10.23 5 5"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2.5"}}],serverless:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}},{tagName:"path",attrs:{d:"M9 11.2h5.7"}}],largeLanguageModel:[{tagName:"path",attrs:{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}},{tagName:"path",attrs:{d:"M9 13a4.5 4.5 0 0 0 3-4"}},{tagName:"path",attrs:{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}},{tagName:"path",attrs:{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}},{tagName:"path",attrs:{d:"M6 18a4 4 0 0 1-1.967-.516"}},{tagName:"path",attrs:{d:"M12 13h4"}},{tagName:"path",attrs:{d:"M12 18h6a2 2 0 0 1 2 2v1"}},{tagName:"path",attrs:{d:"M12 8h8"}},{tagName:"path",attrs:{d:"M16 8V5a2 2 0 0 1 2-2"}},{tagName:"circle",attrs:{cx:"16",cy:"13",r:".5"}},{tagName:"circle",attrs:{cx:"18",cy:"3",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"21",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"8",r:".5"}}],multimodalModel:[{tagName:"path",attrs:{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}},{tagName:"path",attrs:{d:"M20 2v4"}},{tagName:"path",attrs:{d:"M22 4h-4"}},{tagName:"circle",attrs:{cx:"4",cy:"20",r:"2"}}],embeddingModel:[{tagName:"rect",attrs:{x:"14",y:"14",width:"4",height:"6",rx:"2"}},{tagName:"rect",attrs:{x:"6",y:"4",width:"4",height:"6",rx:"2"}},{tagName:"path",attrs:{d:"M6 20h4"}},{tagName:"path",attrs:{d:"M14 10h4"}},{tagName:"path",attrs:{d:"M6 14h2v6"}},{tagName:"path",attrs:{d:"M14 4h2v6"}}],reranker:[{tagName:"path",attrs:{d:"m3 16 4 4 4-4"}},{tagName:"path",attrs:{d:"M7 20V4"}},{tagName:"path",attrs:{d:"m21 8-4-4-4 4"}},{tagName:"path",attrs:{d:"M17 4v16"}}],modelInference:[{tagName:"path",attrs:{d:"M10 12h4"}},{tagName:"path",attrs:{d:"M10 17h4"}},{tagName:"path",attrs:{d:"M10 7h4"}},{tagName:"path",attrs:{d:"M18 12h2"}},{tagName:"path",attrs:{d:"M18 18h2"}},{tagName:"path",attrs:{d:"M18 6h2"}},{tagName:"path",attrs:{d:"M4 12h2"}},{tagName:"path",attrs:{d:"M4 18h2"}},{tagName:"path",attrs:{d:"M4 6h2"}},{tagName:"rect",attrs:{x:"6",y:"2",width:"12",height:"20",rx:"2"}}],vectorDatabase:[{tagName:"path",attrs:{d:"m10.586 5.414-5.172 5.172"}},{tagName:"path",attrs:{d:"m18.586 13.414-5.172 5.172"}},{tagName:"path",attrs:{d:"M6 12h12"}},{tagName:"circle",attrs:{cx:"12",cy:"20",r:"2"}},{tagName:"circle",attrs:{cx:"12",cy:"4",r:"2"}},{tagName:"circle",attrs:{cx:"20",cy:"12",r:"2"}},{tagName:"circle",attrs:{cx:"4",cy:"12",r:"2"}}],ragPipeline:[{tagName:"rect",attrs:{width:"8",height:"8",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M7 11v4a2 2 0 0 0 2 2h4"}},{tagName:"rect",attrs:{width:"8",height:"8",x:"13",y:"13",rx:"2"}}],aiAgent:[{tagName:"path",attrs:{d:"M12 8V4H8"}},{tagName:"rect",attrs:{width:"16",height:"12",x:"4",y:"8",rx:"2"}},{tagName:"path",attrs:{d:"M2 14h2"}},{tagName:"path",attrs:{d:"M20 14h2"}},{tagName:"path",attrs:{d:"M15 13v2"}},{tagName:"path",attrs:{d:"M9 13v2"}}],modelGateway:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2"}},{tagName:"path",attrs:{d:"M6.01 18H6"}},{tagName:"path",attrs:{d:"M10.01 18H10"}},{tagName:"path",attrs:{d:"M15 10v4"}},{tagName:"path",attrs:{d:"M17.84 7.17a4 4 0 0 0-5.66 0"}},{tagName:"path",attrs:{d:"M20.66 4.34a8 8 0 0 0-11.31 0"}}],mcpServer:[{tagName:"path",attrs:{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}},{tagName:"path",attrs:{d:"m2 22 3-3"}},{tagName:"path",attrs:{d:"M7.5 13.5 10 11"}},{tagName:"path",attrs:{d:"M10.5 16.5 13 14"}},{tagName:"path",attrs:{d:"m18 3-4 4h6l-4 4"}}],relationalDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 21 19V5"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 21 12"}}],noSqlDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 15 21.84"}},{tagName:"path",attrs:{d:"M21 5V8"}},{tagName:"path",attrs:{d:"M21 12L18 17H22L19 22"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 14.59 14.87"}}],cache:[{tagName:"path",attrs:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}}],dataWarehouse:[{tagName:"path",attrs:{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}},{tagName:"path",attrs:{d:"m7 16.5-4.74-2.85"}},{tagName:"path",attrs:{d:"m7 16.5 5-3"}},{tagName:"path",attrs:{d:"M7 16.5v5.17"}},{tagName:"path",attrs:{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}},{tagName:"path",attrs:{d:"m17 16.5-5-3"}},{tagName:"path",attrs:{d:"m17 16.5 4.74-2.85"}},{tagName:"path",attrs:{d:"M17 16.5v5.17"}},{tagName:"path",attrs:{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}},{tagName:"path",attrs:{d:"M12 8 7.26 5.15"}},{tagName:"path",attrs:{d:"m12 8 4.74-2.85"}},{tagName:"path",attrs:{d:"M12 13.5V8"}}],searchEngine:[{tagName:"path",attrs:{d:"m21 21-4.34-4.34"}},{tagName:"circle",attrs:{cx:"11",cy:"11",r:"8"}}],objectStorage:[{tagName:"path",attrs:{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"}}],fileStorage:[{tagName:"path",attrs:{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z"}}],blockStorage:[{tagName:"path",attrs:{d:"M10 16h.01"}},{tagName:"path",attrs:{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}},{tagName:"path",attrs:{d:"M21.946 12.013H2.054"}},{tagName:"path",attrs:{d:"M6 16h.01"}}],backup:[{tagName:"circle",attrs:{cx:"15",cy:"19",r:"2"}},{tagName:"path",attrs:{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1"}},{tagName:"path",attrs:{d:"M15 11v-1"}},{tagName:"path",attrs:{d:"M15 17v-2"}}],cdn:[{tagName:"path",attrs:{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}},{tagName:"path",attrs:{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}},{tagName:"path",attrs:{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}},{tagName:"path",attrs:{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2"}}],messageQueue:[{tagName:"path",attrs:{d:"M11 5h10"}},{tagName:"path",attrs:{d:"M11 12h10"}},{tagName:"path",attrs:{d:"M11 19h10"}},{tagName:"path",attrs:{d:"M4 4h1v5"}},{tagName:"path",attrs:{d:"M4 9h2"}},{tagName:"path",attrs:{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}}],eventBus:[{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"12",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"19",r:"3"}},{tagName:"line",attrs:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}},{tagName:"line",attrs:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}}],streamProcessing:[{tagName:"path",attrs:{d:"M2 12q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 19q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 5q2.5 2 5 0t5 0 5 0 5 0"}}],webhook:[{tagName:"path",attrs:{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}},{tagName:"path",attrs:{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}},{tagName:"path",attrs:{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"}}],serviceMesh:[{tagName:"path",attrs:{d:"M12 3v18"}},{tagName:"path",attrs:{d:"M3 12h18"}},{tagName:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}],apiGateway:[{tagName:"circle",attrs:{cx:"6",cy:"19",r:"3"}},{tagName:"path",attrs:{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}},{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}}],loadBalancer:[{tagName:"circle",attrs:{cx:"12",cy:"18",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"6",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"6",r:"3"}},{tagName:"path",attrs:{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}},{tagName:"path",attrs:{d:"M12 12v3"}}],dns:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"path",attrs:{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}}],vpc:[{tagName:"rect",attrs:{x:"16",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"2",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"9",y:"2",width:"6",height:"6",rx:"1"}},{tagName:"path",attrs:{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}},{tagName:"path",attrs:{d:"M12 12V8"}}],subnet:[{tagName:"path",attrs:{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"}},{tagName:"path",attrs:{d:"M17 21v-2"}},{tagName:"path",attrs:{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10"}},{tagName:"path",attrs:{d:"M21 21v-2"}},{tagName:"path",attrs:{d:"M3 5V3"}},{tagName:"path",attrs:{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"}},{tagName:"path",attrs:{d:"M7 5V3"}}],vpn:[{tagName:"path",attrs:{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}},{tagName:"path",attrs:{d:"M6 8v1"}},{tagName:"path",attrs:{d:"M10 8v1"}},{tagName:"path",attrs:{d:"M14 8v1"}},{tagName:"path",attrs:{d:"M18 8v1"}}],identity:[{tagName:"path",attrs:{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}},{tagName:"circle",attrs:{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}}],firewall:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M12 9v6"}},{tagName:"path",attrs:{d:"M16 15v6"}},{tagName:"path",attrs:{d:"M16 3v6"}},{tagName:"path",attrs:{d:"M3 15h18"}},{tagName:"path",attrs:{d:"M3 9h18"}},{tagName:"path",attrs:{d:"M8 15v6"}},{tagName:"path",attrs:{d:"M8 3v6"}}],waf:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"m9 12 2 2 4-4"}}],secretManager:[{tagName:"circle",attrs:{cx:"12",cy:"16",r:"1"}},{tagName:"rect",attrs:{x:"3",y:"10",width:"18",height:"12",rx:"2"}},{tagName:"path",attrs:{d:"M7 10V7a5 5 0 0 1 10 0v3"}}],certificate:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"M8 12h.01"}},{tagName:"path",attrs:{d:"M12 12h.01"}},{tagName:"path",attrs:{d:"M16 12h.01"}}],systemBoundary:[{tagName:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tagName:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tagName:"path",attrs:{d:"M12 22V12"}}],monitoring:[{tagName:"path",attrs:{d:"m12 14 4-4"}},{tagName:"path",attrs:{d:"M3.34 19a10 10 0 1 1 17.32 0"}}],logging:[{tagName:"path",attrs:{d:"M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85"}},{tagName:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tagName:"path",attrs:{d:"M8 14v2.2l1.6 1"}},{tagName:"circle",attrs:{cx:"8",cy:"16",r:"6"}}],metrics:[{tagName:"path",attrs:{d:"M12 16v5"}},{tagName:"path",attrs:{d:"M16 14.639V21"}},{tagName:"path",attrs:{d:"M20 10.656V21"}},{tagName:"path",attrs:{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15"}},{tagName:"path",attrs:{d:"M4 18.463V21"}},{tagName:"path",attrs:{d:"M8 14.656V21"}}],tracing:[{tagName:"path",attrs:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}}],alerting:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"line",attrs:{x1:"12",x2:"12",y1:"8",y2:"12"}},{tagName:"line",attrs:{x1:"12",x2:"12.01",y1:"16",y2:"16"}}],saas:[{tagName:"path",attrs:{d:"m10.852 19.772-.383.924"}},{tagName:"path",attrs:{d:"m13.148 14.228.383-.923"}},{tagName:"path",attrs:{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 15.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 18.148.923.383"}},{tagName:"path",attrs:{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2"}},{tagName:"path",attrs:{d:"m9.228 15.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 18.148-.923.383"}}],externalApi:[{tagName:"path",attrs:{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}},{tagName:"path",attrs:{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}}],thirdPartyService:[{tagName:"path",attrs:{d:"M15 3h6v6"}},{tagName:"path",attrs:{d:"M10 14 21 3"}},{tagName:"path",attrs:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}}]},PAe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',uDt=12,hDt=550,dDt=17,fDt=10,pDt=14,yW=34,gDt=10,mDt=(t,e)=>{const r=t.x+t.width,n=e.x+e.width;if(e.x>=r)return{source:"right",target:"left"};if(n<=t.x)return{source:"top",target:"top"};const i=t.y+t.height/2;return e.y+e.height/2>=i?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}},$Ae=["client","frontend","service","database","storage","queue","security","external"],yDt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},vDt={light:{canvas:ol,boundaryStroke:"#7B8F86",boundaryText:"#1C3D31",boundaryFill:"rgba(123, 143, 134, 0.05)",boundaryBadgeFill:"rgba(255, 255, 255, 0.95)",boundaryBadgeStroke:"rgba(123, 143, 134, 0.4)",nodes:{client:{fill:"#E9EFF5",stroke:"#3B6285",text:"#1A3B5C",accent:"#2B5A84",iconFrame:"#D4E2EE"},frontend:{fill:"#EEF2FF",stroke:"#4338CA",text:"#312E81",accent:"#4F46E5",iconFrame:"#E0E7FF"},service:{fill:"#E3F4EE",stroke:"#169567",text:"#19563E",accent:"#16A06E",iconFrame:"#D0ECE2"},database:{fill:"#EFE7FD",stroke:"#7437DC",text:"#472877",accent:"#7C3AED",iconFrame:"#E5D8FB"},storage:{fill:"#FAEFE1",stroke:"#CA6F07",text:"#71430F",accent:"#D97706",iconFrame:"#F7E4CD"},queue:{fill:"#FCEBE2",stroke:"#DA530D",text:"#793512",accent:"#EA580C",iconFrame:"#FBDECE"},security:{fill:"#FBE4E9",stroke:"#D11D44",text:"#751B2D",accent:"#E11D48",iconFrame:"#F9D2DA"},external:{fill:"#ECEEF1",stroke:"#5E6D82",text:"#3C424B",accent:"#64748B",iconFrame:"#E0E3E8"}},edges:{dependency:{stroke:"#64748B",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#0F8A5C",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#7C3AED",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#EA580C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}},dark:{canvas:ll,boundaryStroke:"#5B6F66",boundaryText:"#D7F4E8",boundaryFill:"rgba(91, 111, 102, 0.12)",boundaryBadgeFill:"rgba(16, 19, 17, 0.95)",boundaryBadgeStroke:"rgba(91, 111, 102, 0.5)",nodes:{client:{fill:"#132537",stroke:"#5A8EB9",text:"#DCE8F2",accent:"#5A8EB9",iconFrame:"#1C3752"},frontend:{fill:"#18214D",stroke:"#6366F1",text:"#E0E7FF",accent:"#6366F1",iconFrame:"#232F6B"},service:{fill:"#123A2B",stroke:"#49B58E",text:"#D5EEE5",accent:"#49B58E",iconFrame:"#13573E"},database:{fill:"#2E1E4F",stroke:"#9965F1",text:"#E7DCFC",accent:"#9965F1",iconFrame:"#44267B"},storage:{fill:"#482F0E",stroke:"#E1953D",text:"#F8E7D2",accent:"#E1953D",iconFrame:"#70430C"},queue:{fill:"#4D2610",stroke:"#EF7D41",text:"#FBE1D3",accent:"#EF7D41",iconFrame:"#79340F"},security:{fill:"#4B1620",stroke:"#E84F70",text:"#FAD6DE",accent:"#E84F70",iconFrame:"#74182B"},external:{fill:"#282E33",stroke:"#8693A5",text:"#E3E6EA",accent:"#8693A5",iconFrame:"#38424C"}},edges:{dependency:{stroke:"#94A3B8",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#4DB58B",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#A78BFA",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#FB923C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}}},SD=(t="light")=>vDt[t],bDt=(t,e)=>{const r=SD(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:$Ae.includes(t)?r.nodes[t]:r.nodes.service},xDt=(t,e)=>t==="database"||t==="queue"||t==="external"?Math.round(e/2):t==="security"?16:t==="frontend"?10:t==="service"?8:t==="client"||t==="storage"?6:11,bhe=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,wDt=t=>Math.round((t-yW)/2),BAe=(t,e)=>{const r=t??($Ae.includes(e)?yDt[e]:"service");return vhe[r]??vhe.service},TDt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=BAe(t,e);return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"iconFrame"},...r.map((n,i)=>({tagName:n.tagName,selector:`architectureIcon${i}`})),{tagName:"text",selector:"label"}]},CDt=(t,e,r,n)=>{const i=SD(e),s=bDt(t,e),a=t==="boundary",o=xDt(t,r.height),l=wDt(r.height),u=a?[]:BAe(n,t),h=Object.fromEntries(u.map((d,f)=>[`architectureIcon${f}`,{...d.attrs,transform:`translate(15 ${l+5})`,fill:"none",stroke:s.accent,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}]));return{markup:TDt(n,t),body:{fill:s.fill,stroke:s.stroke,strokeWidth:1.5,strokeDasharray:a||t==="external"?"7 5":void 0,rx:o,ry:o},label:{fill:s.text,fontSize:a?12:uDt,fontWeight:a?650:hDt,fontFamily:PAe,lineHeight:a?18:dDt,...a?{refX:20,refY:20,textAnchor:"start",textVerticalAnchor:"middle"}:{refX:54,refY:"50%",textAnchor:"start",textVerticalAnchor:"middle"}},attrs:a?{headerBadge:{ref:"label",refWidth:1,refHeight:1,refWidth2:16,refHeight2:6,refX:-8,refY:-3,fill:i.boundaryBadgeFill,stroke:i.boundaryBadgeStroke,strokeWidth:1,rx:4,ry:4,pointerEvents:"none"}}:{iconFrame:{x:gDt,y:l,width:yW,height:yW,rx:bhe(t),ry:bhe(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},kDt=(t,e,r=!1)=>{const n=SD(e).edges[t??"dependency"],i={name:"block",width:n.markerWidth,height:n.markerHeight};return{stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,sourceMarker:r?i:null,targetMarker:i,fill:"none"}},vW='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',SDt=10,EDt=14,ADt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},MDt=(t,e)=>{const r={x:t.x+t.width/2,y:t.y+t.height/2},n={x:e.x+e.width/2,y:e.y+e.height/2},i=n.x-r.x,s=n.y-r.y;return s<-t.height?{source:"left",target:"left"}:i<-t.width?{source:"top",target:"top"}:Math.abs(s)>=Math.abs(i)?s>=0?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}:i>=0?{source:"right",target:"left"}:{source:"left",target:"right"}},RDt=(t,e)=>{const r=e.x+e.width/2-(t.x+t.width/2),n=e.y+e.height/2-(t.y+t.height/2);return n<-t.height||r<-t.width?!1:Math.abs(r)<=1&&Math.abs(n)>8||Math.abs(n)<=1&&Math.abs(r)>8},_Dt=.85,LDt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],IDt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},NDt=t=>t&&LDt.includes(t)?t:t?IDt[t]??"brand":"plain",DDt={plain:{light:{canvas:ol,edge:"#737373",process:{fill:"#FFFFFF",stroke:"#D4D4D4",text:"#212121"},decision:{fill:"#F4F4F5",stroke:"#737373",text:"#212121"},terminator:{fill:"#707070",stroke:"#707070",text:"#FFFFFF"}},dark:{canvas:ll,edge:"#A3A3A3",process:{fill:"#1C1C1C",stroke:"#3A3A3A",text:"#F4F4F5"},decision:{fill:"#262626",stroke:"#A3A3A3",text:"#F4F4F5"},terminator:{fill:"#F5F5F5",stroke:"#F5F5F5",text:"#212121"}}},brand:{light:{canvas:ol,edge:"#5C7166",process:{fill:"#FFFFFF",stroke:"#6F9B88",text:"#1C3D31"},decision:{fill:"#FFF6E5",stroke:"#D4A24A",text:"#7A4A12"},terminator:{fill:"#E7F6EF",stroke:"#16A06E",text:"#145C40"}},dark:{canvas:ll,edge:"#8CA397",process:{fill:"#1B2420",stroke:"#5B7569",text:"#E8F2ED"},decision:{fill:"#2A2316",stroke:"#E0B35C",text:"#F8E4B8"},terminator:{fill:"#1A3329",stroke:"#4DB58B",text:"#D8F3E6"}}},ink:{light:{canvas:ol,edge:"#64748B",process:{fill:"#FFFFFF",stroke:"#7D8794",text:"#1C232C"},decision:{fill:"#E8EDF3",stroke:"#6E7C8F",text:"#243044"},terminator:{fill:"#E6EAEF",stroke:"#3A4656",text:"#1A222C"}},dark:{canvas:ll,edge:"#94A3B8",process:{fill:"#1B1E23",stroke:"#6B7380",text:"#E8ECF1"},decision:{fill:"#222830",stroke:"#8B9BB0",text:"#D5DDE8"},terminator:{fill:"#1A2028",stroke:"#A8B4C4",text:"#E8EEF4"}}},paper:{light:{canvas:ol,edge:"#78716C",process:{fill:"#FFFCF6",stroke:"#C4B396",text:"#3A3126"},decision:{fill:"#F4E4CC",stroke:"#C08A48",text:"#6A3F14"},terminator:{fill:"#F0E4D0",stroke:"#7A5230",text:"#3F2A16"}},dark:{canvas:ll,edge:"#A8A29E",process:{fill:"#221E19",stroke:"#7A6A56",text:"#F3EBE0"},decision:{fill:"#2C2418",stroke:"#D4A06A",text:"#F6E2C4"},terminator:{fill:"#2A2118",stroke:"#C4A07A",text:"#F0E4D4"}}},island:{light:{canvas:ol,edge:"#7C6F68",process:{fill:"#FFF8F3",stroke:"#C4A090",text:"#3A2A22"},decision:{fill:"#F3D8C8",stroke:"#C46A48",text:"#6A3220"},terminator:{fill:"#EBD0C0",stroke:"#8B4A32",text:"#3F2418"}},dark:{canvas:ll,edge:"#ABA09A",process:{fill:"#231C18",stroke:"#8A6A56",text:"#F3E8E0"},decision:{fill:"#2C2018",stroke:"#D49070",text:"#F6D8C4"},terminator:{fill:"#281A16",stroke:"#C48868",text:"#F0D8CC"}}},tea:{light:{canvas:ol,edge:"#657361",process:{fill:"#FFFFFF",stroke:"#8A9A72",text:"#2A3420"},decision:{fill:"#E8EED4",stroke:"#8A9A48",text:"#3F4A18"},terminator:{fill:"#DCE6C8",stroke:"#4F6A32",text:"#243018"}},dark:{canvas:ll,edge:"#97A693",process:{fill:"#1C2018",stroke:"#6A7A56",text:"#E8F0DC"},decision:{fill:"#222618",stroke:"#B8C46A",text:"#E8F0C4"},terminator:{fill:"#1A2418",stroke:"#8AAA5A",text:"#D8E8C4"}}},cosmos:{light:{canvas:ol,edge:"#5C6D7E",process:{fill:"#FFFFFF",stroke:"#7A94A8",text:"#1C2A38"},decision:{fill:"#E4EEF5",stroke:"#5A82A0",text:"#1E3A52"},terminator:{fill:"#D8E6F0",stroke:"#2A5470",text:"#163044"}},dark:{canvas:ll,edge:"#8EA0B2",process:{fill:"#181E26",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#1C2834",stroke:"#7AA0C0",text:"#D0E4F4"},terminator:{fill:"#162028",stroke:"#8AB4D0",text:"#D8E8F4"}}},sun:{light:{canvas:ol,edge:"#736B5E",process:{fill:"#FFFEF6",stroke:"#D4C47A",text:"#3A3418"},decision:{fill:"#FFF0C4",stroke:"#E0B040",text:"#6A4A08"},terminator:{fill:"#F8E8B0",stroke:"#C09020",text:"#4A3808"}},dark:{canvas:ll,edge:"#A8A092",process:{fill:"#242018",stroke:"#8A7A48",text:"#F6F0D8"},decision:{fill:"#2C2410",stroke:"#E0B848",text:"#F8E8B8"},terminator:{fill:"#28240C",stroke:"#D4B040",text:"#F4E8C0"}}},wa:{light:{canvas:ol,edge:"#5B6F7D",process:{fill:"#FFFFFF",stroke:"#8AA8C0",text:"#1C2C3A"},decision:{fill:"#FCE8DC",stroke:"#E09070",text:"#7A3A24"},terminator:{fill:"#DCE8F4",stroke:"#2A5A88",text:"#1A3858"}},dark:{canvas:ll,edge:"#8EA3B3",process:{fill:"#182028",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#2C2018",stroke:"#E0A080",text:"#F8DCC8"},terminator:{fill:"#162030",stroke:"#6A98C0",text:"#D4E4F4"}}},rose:{light:{canvas:ol,edge:"#75646B",process:{fill:"#FFFFFF",stroke:"#C49AAC",text:"#3A2430"},decision:{fill:"#F8E4EC",stroke:"#D0809A",text:"#7A3048"},terminator:{fill:"#F0D8E2",stroke:"#A04060",text:"#4A2030"}},dark:{canvas:ll,edge:"#A8969D",process:{fill:"#24181C",stroke:"#8A5A6A",text:"#F4E4EA"},decision:{fill:"#2C1A22",stroke:"#E090A8",text:"#F8D8E4"},terminator:{fill:"#28141C",stroke:"#E07090",text:"#F4D0DC"}}},mint:{light:{canvas:ol,edge:"#5A736F",process:{fill:"#FFFFFF",stroke:"#7AB0A8",text:"#1C3A38"},decision:{fill:"#E4F4F0",stroke:"#4AA89A",text:"#1A5A52"},terminator:{fill:"#D4EEE8",stroke:"#1A7A70",text:"#145048"}},dark:{canvas:ll,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},FAe=(t="light",e)=>DDt[NDt(e)][t],ODt=(t,e,r)=>{const n=FAe(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},PDt=(t,e,r,n)=>{const i=ODt(t,e,n),s=t==="terminator",a=t==="decision";return{body:{fill:i.fill,stroke:i.stroke,strokeWidth:1.5,rx:s?Math.round(r.height/2):10,ry:s?Math.round(r.height/2):10,...a?{refPoints:"0,10 10,0 20,10 10,20"}:{},style:{filter:e==="dark"?"drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3))":"drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06)) drop-shadow(0 2px 5px rgba(15, 23, 42, 0.04))"}},label:{fill:i.text,fontSize:13,fontWeight:s?650:a?600:500,fontFamily:vW,lineHeight:18}}},$Dt=1,BDt=2,FDt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],zDt="plain",VDt=["plain","brand","ocean","ink","classic","sky","sunset","violet","rose","sand","slate","aurora","mono","sun","wa","island","mint","cosmos","tea","naive","macaron","paper","dune","prism","sunrise","marine","blossom"],HDt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],GDt=[...HDt,"rect","diamond","cloud"],WDt={ocean:"brand",ink:"brand",paper:"brand",classic:"sunrise",sunset:"sunrise",sun:"sunrise",wa:"marine",island:"dune",sand:"dune",tea:"slate",mono:"slate",slate:"slate",sky:"cosmos",cosmos:"cosmos",rose:"blossom",violet:"blossom",aurora:"mint",naive:"prism",mint:"mint",macaron:"macaron"},SQ=t=>t&&FDt.includes(t)?t:t?WDt[t]??"brand":zDt,qDt=["client","webApp","mobileApp","website","apiClient","service","cpu","gpu","memory","virtualMachine","container","kubernetes","serverless","largeLanguageModel","multimodalModel","embeddingModel","reranker","modelInference","vectorDatabase","ragPipeline","aiAgent","modelGateway","mcpServer","relationalDatabase","noSqlDatabase","cache","dataWarehouse","searchEngine","objectStorage","fileStorage","blockStorage","backup","cdn","messageQueue","eventBus","streamProcessing","webhook","serviceMesh","apiGateway","loadBalancer","dns","vpc","subnet","vpn","identity","firewall","waf","secretManager","certificate","systemBoundary","monitoring","logging","metrics","tracing","alerting","saas","externalApi","thirdPartyService"],UDt="edgeever-diagram-v1",zAe=new RegExp(`\x3C!--\\s*${UDt}:([\\s\\S]*?)\\s*-->`),YDt=t=>cDt.decode(t),n8=t=>typeof t=="number"&&Number.isFinite(t),jDt=["mind-map","flowchart","architecture"],XDt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],xhe=["dependency","request","async","data"],KDt=t=>typeof t=="string"&&qDt.includes(t),ZDt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.label!="string"||!n8(e.x)||!n8(e.y)||!n8(e.width)||!n8(e.height)||!XDt.includes(e.shape)?null:{id:e.id,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height,shape:e.shape,...typeof e.parentId=="string"&&e.parentId?{parentId:e.parentId}:{},...KDt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},QDt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!xhe.includes(e.kind)||e.bidirectional!==void 0&&typeof e.bidirectional!="boolean"?null:{id:e.id,source:e.source,target:e.target,...typeof e.label=="string"&&e.label?{label:e.label}:{},...xhe.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},JDt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(zAe))==null?void 0:r[1])==null?void 0:n.replace(/\s+/g,"");if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;try{const i=JSON.parse(YDt(e));if(!jDt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==BDt:i.schemaVersion!==$Dt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=VDt.includes(i.theme)?i.theme:void 0,o=GDt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(ZDt),u=i.edges.map(QDt);if(l.some(f=>!f)||u.some(f=>!f))return null;const h=new Set(l.map(f=>f.id)),d=new Map(l.map(f=>[f.id,f]));if(h.size!==l.length||l.some(f=>f.parentId&&(f.parentId===f.id||!h.has(f.parentId)))||u.some(f=>!h.has(f.source)||!h.has(f.target)))return null;if(s){if(l.some(f=>f.shape==="topic"||f.shape==="process"||f.shape==="decision"||f.shape==="terminator")||l.some(f=>{var p;return f.parentId&&((p=d.get(f.parentId))==null?void 0:p.shape)!=="boundary"})||u.some(f=>{var p,g;return((p=d.get(f.source))==null?void 0:p.shape)==="boundary"||((g=d.get(f.target))==null?void 0:g.shape)==="boundary"}))return null}else if(l.some(f=>!["topic","process","decision","terminator"].includes(f.shape)))return null;return{schemaVersion:i.schemaVersion,kind:i.kind,...a?{theme:a}:{},...i.kind==="mind-map"&&o?{structure:o}:{},nodes:l,edges:u}}catch{return null}},eOt=t=>(t??"").replace(zAe,"").trimEnd(),tOt=1e5;er({prompt:Qe().trim().min(1).max(1e3),locale:Qe().trim().min(2).max(35).optional(),currentTemplate:Qe().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:Qe().max(tOt).default(""),candidates:ni(Qe().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:ni(er({prompt:Qe().max(1e3),response:Qe().max(2e3)})).max(12).default([])});const VAe={plain:{id:"plain",group:"classic",colors:["#707070","#8A8A8A","#A3A3A3","#BDBDBD","#D4D4D4","#FFFFFF"],accent:"#707070"},brand:{id:"brand",group:"classic",colors:["#16A06E","#059669","#0D9488","#10B981","#047857","#065F46"],accent:"#16A06E"},cosmos:{id:"cosmos",group:"classic",colors:["#2563EB","#0284C7","#4F46E5","#0D9488","#3B82F6","#1D4ED8"],accent:"#2563EB"},dune:{id:"dune",group:"classic",colors:["#C2410C","#D97706","#B45309","#A16207","#78350F","#9A3412"],accent:"#B45309"},slate:{id:"slate",group:"classic",colors:["#475569","#52525B","#4B5563","#334155","#64748B","#1E293B"],accent:"#475569"},prism:{id:"prism",group:"vivid",colors:["#E11D48","#EA580C","#D97706","#059669","#2563EB","#7C3AED"],accent:"#6366F1"},sunrise:{id:"sunrise",group:"vivid",colors:["#E11D48","#F97316","#F59E0B","#D97706","#DC2626","#EA580C"],accent:"#EA580C"},marine:{id:"marine",group:"vivid",colors:["#0284C7","#06B6D4","#0D9488","#2563EB","#0891B2","#1D4ED8"],accent:"#0284C7"},blossom:{id:"blossom",group:"vivid",colors:["#DB2777","#C026D3","#9333EA","#E11D48","#BE185D","#7C3AED"],accent:"#DB2777"},mint:{id:"mint",group:"vivid",colors:["#0D9488","#059669","#10B981","#0891B2","#16A34A","#047857"],accent:"#0D9488"},macaron:{id:"macaron",group:"vivid",colors:["#EC4899","#FB923C","#EAB308","#10B981","#38BDF8","#8B5CF6"],accent:"#EC4899"}},rOt=Object.fromEntries(Object.entries(VAe).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),bW=t=>{const e=t.replace("#","");return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]},nOt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,ul=(t,e,r)=>{const n=bW(t),i=bW(e);return nOt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},iOt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},HAe=t=>{const[e,r,n]=bW(t).map(iOt);return e*.2126+r*.7152+n*.0722},xW=t=>HAe(t)>.35?"#1C1917":"#FFFCF8",sOt=t=>rOt[SQ(t)].colors,aOt=t=>{const e=SQ(t);return e!=="brand"&&e!=="plain"},wW=(t,e)=>{const r=HAe(t);return e==="dark"?r<.22?ul(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?ul(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},oOt=(t,e)=>sOt(t).map(n=>{const i=wW(n,e),s=e==="dark"?ul(n,"#121518",.72):ul(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?ul(i,"#FFFFFF",.15):ul(i,"#1C1917",.12),text:xW(s),edge:i}}),lOt=(t,e)=>{const r=SQ(t),n=VAe[r],i=n.accent;if(r==="plain")return e==="dark"?{topicFill:"#F5F5F5",topicText:"#212121",nodeFill:"#1C1C1C",nodeText:"#F4F4F5",nodeStroke:"#3A3A3A",topicStroke:"#F5F5F5",mindMapEdge:"#A3A3A3",flowEdge:"#A3A3A3",canvas:ll}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:ol};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:ll}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:ol};if(e==="dark"){const a=wW(i,"dark");return{topicFill:i,topicText:xW(i),nodeFill:ul(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:ul(a,"#FFFFFF",.15),topicStroke:ul(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:ul(i,"#FFFFFF",.15),canvas:ll}}const s=wW(i,"light");return{topicFill:i,topicText:xW(i),nodeFill:ul(i,"#FFFFFF",.88),nodeText:ul(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:ul(s,"#FFFFFF",.5),topicStroke:ul(i,"#1C1917",.15),mindMapEdge:s,flowEdge:ul(i,"#1C1917",.15),canvas:ol}},EQ=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),cOt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},uOt=13,hOt=18,whe=.7,dOt=(t,e)=>t.split(` +`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&EQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),fOt=(t,e)=>{const r=cOt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*whe:a-s)/uOt),l=dOt(e,o),u=Math.max(l.length,1)*hOt,h=Math.max(r.height,n?Math.ceil(u/(1-whe)):u+(i?16:18));return{width:a,height:h,text:l.join(` +`)}},GAe="edgeever-mindmap",The='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',pOt=10,gOt=14,AQ=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",mOt=t=>{const e=AQ(t);return e==="map"||e==="logic"},p3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,MQ=(t,e="primary")=>p3(e,t)?"underline":t==="capsule"?"capsule":t==="ellipse"?"ellipse":t==="circle"?"circle":t==="hexagon"?"hexagon":t==="box"||t==="logic"||t==="org"?"rounded":e==="root"?"capsule":"rounded",yOt=(t,e="primary")=>{const r=MQ(t,e);return[r==="ellipse"||r==="circle"?{tagName:"ellipse",selector:"body"}:r==="diamond"||r==="hexagon"?{tagName:"polygon",selector:"body"}:r==="cloud"?{tagName:"path",selector:"body"}:{tagName:"rect",selector:"body"},{tagName:"path",selector:"underline"},{tagName:"text",selector:"label"}]},vOt={light:[{fill:"#E7F6EF",stroke:"#0F8A5C",text:"#145C40",edge:"#16A06E"},{fill:"#E7F0FE",stroke:"#2563EB",text:"#1E3A8A",edge:"#3B82F6"},{fill:"#F3E8FF",stroke:"#7C3AED",text:"#5B21B6",edge:"#8B5CF6"},{fill:"#FEF3C7",stroke:"#D97706",text:"#92400E",edge:"#F59E0B"},{fill:"#FCE7F3",stroke:"#DB2777",text:"#9D174D",edge:"#EC4899"},{fill:"#CFFAFE",stroke:"#0E7490",text:"#155E75",edge:"#06B6D4"}],dark:[{fill:"#1A2A22",stroke:"#4DB58B",text:"#D7F4E8",edge:"#4DB58B"},{fill:"#1A2438",stroke:"#60A5FA",text:"#DBEAFE",edge:"#60A5FA"},{fill:"#251B38",stroke:"#A78BFA",text:"#EDE9FE",edge:"#A78BFA"},{fill:"#2A2114",stroke:"#FBBF24",text:"#FEF3C7",edge:"#FBBF24"},{fill:"#2A1520",stroke:"#F472B6",text:"#FCE7F3",edge:"#F472B6"},{fill:"#15252B",stroke:"#22D3EE",text:"#CFFAFE",edge:"#22D3EE"}]},bOt=(t,e)=>t.split(` +`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&EQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),tr=t=>(Math.round(t*100)/100).toFixed(2),xOt=t=>aOt(t),GM=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=r.get(e);if(!(n!=null&&n.parentId))return"root";const i=r.get(n.parentId);return i!=null&&i.parentId?"nested":"primary"},wOt=(t,e)=>{const r=new Map(t.map(u=>[u.id,u])),n=r.get(e);if(!(n!=null&&n.parentId))return null;let i=n,s=n;const a=new Set;for(;s.parentId&&r.has(s.parentId)&&!a.has(s.id);){a.add(s.id);const u=r.get(s.parentId);if(!u)break;if(!u.parentId){i=s;break}s=u,i=s}const l=t.filter(u=>u.parentId===i.parentId).sort((u,h)=>(u.y??0)-(h.y??0)||(u.x??0)-(h.x??0)||u.id.localeCompare(h.id)).findIndex(u=>u.id===i.id);return l<0?0:l},TOt=(t,e,r)=>{if(t==null)return;const n=r?oOt(r,e):vOt[e];return n[t%n.length]},COt=(t,e="primary",r)=>{const n=e==="root",i=p3(e,r),s=MQ(r,e),a=n?36:i?22:s==="diamond"||s==="hexagon"||s==="circle"?36:28,o=Math.round(Math.min(n?180:s==="circle"?132:168,Math.max(n?124:i?88:s==="circle"?108:96,EQ(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},kOt=(t,e,r)=>{const n=COt(t,e,r),i=p3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=bOt(t,Math.max(4,(n.width-a)/13));return{...n,height:Math.max(n.height,o.length*s+(e==="root"?18:i?10:14)),text:o.join(` +`),fontSize:e==="root"?15:e==="primary"?14:13}},SOt=t=>Math.round(Math.max(1,t/2)),EOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,AOt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${tr(r*.18)} ${tr(n*.62)}`,`Q ${tr(r*.06)} ${tr(n*.6)} ${tr(r*.08)} ${tr(n*.44)}`,`Q ${tr(r*.02)} ${tr(n*.26)} ${tr(r*.22)} ${tr(n*.24)}`,`Q ${tr(r*.3)} ${tr(n*.06)} ${tr(r*.48)} ${tr(n*.14)}`,`Q ${tr(r*.6)} ${tr(n*.02)} ${tr(r*.72)} ${tr(n*.16)}`,`Q ${tr(r*.96)} ${tr(n*.14)} ${tr(r*.92)} ${tr(n*.4)}`,`Q ${tr(r*1.02)} ${tr(n*.56)} ${tr(r*.84)} ${tr(n*.64)}`,`Q ${tr(r*.8)} ${tr(n*.84)} ${tr(r*.58)} ${tr(n*.78)}`,`Q ${tr(r*.42)} ${tr(n*.92)} ${tr(r*.3)} ${tr(n*.76)}`,`Q ${tr(r*.12)} ${tr(n*.82)} ${tr(r*.18)} ${tr(n*.62)}`,"Z"].join(" ")},MOt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:AOt(e,r)}:{rx:n,ry:n},ROt=(t,e,r={})=>{const n=r.underline??p3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=MQ(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:The,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:EOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?SOt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...MOt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:The,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},Che=(t,e,r,n,i,s,a)=>{const o=GM(t,e),l=p3(o,a),u=xOt(n)?TOt(wOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:ROt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},_Ot=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},LOt=(t,e,r)=>{const n=AQ(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?sa+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},khe=(t,e,r,n)=>{const i=p3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},IOt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},She=(t,e)=>mOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},NOt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},DOt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},OOt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${tr(t.x)} ${tr(t.y)} L ${tr(e.x)} ${tr(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,x=NOt(o,l,u,h,v),b=DOt(o,l,u,h,v),T=Math.hypot(b.x,b.y)||1,C=((1-v)*r+v*n)/2,S=-b.y/T,k=b.x/T;f.push({x:x.x+S*C,y:x.y+k*C}),p.push({x:x.x-S*C,y:x.y-k*C})}const g=f[0],m=[`M ${tr(g.x)} ${tr(g.y)}`];for(let y=1;y=0;y-=1)m.push(`L ${tr(p[y].x)} ${tr(p[y].y)}`);return m.push("Z"),m.join(" ")},POt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${POt(e)}`).join(" "),$Ot=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Od([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Od([t,n,i,e])},BOt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:r,y:t.y},{x:r,y:e.y},e])},FOt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Od([t,{x:d-h,y:t.y}]),`M ${tr(d-h)} ${tr(o)}`,`C ${tr(d)} ${tr(o)} ${tr(d)} ${tr(o)} ${tr(d)} ${tr((o+u)/2)}`,`C ${tr(d)} ${tr(u)} ${tr(d+h)} ${tr(u)} ${tr(d+h)} ${tr(u)}`,`C ${tr(d)} ${tr(u)} ${tr(d)} ${tr(u)} ${tr(d)} ${tr((u+l)/2)}`,`C ${tr(d)} ${tr(l)} ${tr(d)} ${tr(l)} ${tr(d-h)} ${tr(l)}`,Od([{x:d,y:e.y},e])].join(" ")},zOt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:e.x,y:t.y},e]),VOt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Od([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Od([t,s,e])},HOt=(t,e,r,n={})=>{const i=AQ(n.structure);return i==="org"?$Ot(t,e):i==="tree"?BOt(t,e):i==="brace"?FOt(t,e,n.braceTop,n.braceBottom):i==="timeline"?zOt(t,e):i==="fishbone"?VOt(t,e):OOt(t,e,n.sourceWidth,n.targetWidth)},GOt=(t,e="light")=>lOt(t,e),WOt=(t,e)=>{const r=GOt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?FAe(e,t.theme):null,i=t.kind==="architecture"?SD(e):null,s=t.nodes.map(l=>{const u=t.kind==="mind-map"?GM(t.nodes,l.id):null,h=t.kind==="flowchart"?fOt(l.shape,l.label):u?kOt(l.label,u,t.structure):{width:l.width,height:l.height,text:l.label},d=u?Che(t.nodes,l.id,r,t.theme,e,h,t.structure):null,f=(d==null?void 0:d.visual)??null,p=t.kind==="flowchart"?PDt(l.shape,e,h,t.theme):null,g=t.kind==="architecture"?CDt(l.shape,e,h,l.resourceIcon):null,m=l.shape==="topic"&&!l.parentId,y=l.shape==="terminator",v=l.shape==="boundary",x=m||y,b=f?f.body.fill:p?p.body.fill:g?g.body.fill:x?r.topicFill:r.nodeFill,T=f?f.body.stroke:p?p.body.stroke:g?g.body.stroke:x?r.topicStroke:r.nodeStroke;return{id:l.id,shape:l.shape==="decision"?"polygon":"rect",x:l.x,y:l.y,width:h.width,height:h.height,zIndex:v?0:2,...g?{markup:g.markup}:u?{markup:yOt(t.structure,u)}:{},attrs:{body:{fill:b,stroke:T,strokeWidth:(f==null?void 0:f.body.strokeWidth)??(p==null?void 0:p.body.strokeWidth)??(g==null?void 0:g.body.strokeWidth)??1,strokeDasharray:(g==null?void 0:g.body.strokeDasharray)??(v?"7 5":void 0),...(f==null?void 0:f.body)??(p==null?void 0:p.body)??(g==null?void 0:g.body)??{rx:y?24:11,ry:y?24:11},...l.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:h.text,lineHeight:(f==null?void 0:f.label.lineHeight)??(p==null?void 0:p.label.lineHeight)??(g==null?void 0:g.label.lineHeight)??(u==="root"?20:18),fill:(f==null?void 0:f.label.fill)??(p==null?void 0:p.label.fill)??(g==null?void 0:g.label.fill)??(x?r.topicText:r.nodeText),fontSize:(f==null?void 0:f.label.fontSize)??(p==null?void 0:p.label.fontSize)??(g==null?void 0:g.label.fontSize)??(l.shape==="topic"?14:13),fontWeight:(f==null?void 0:f.label.fontWeight)??(p==null?void 0:p.label.fontWeight)??(g==null?void 0:g.label.fontWeight)??(x?650:500),fontFamily:(f==null?void 0:f.label.fontFamily)??(p==null?void 0:p.label.fontFamily)??(g==null?void 0:g.label.fontFamily)??vW,...f?{refX:f.label.refX,refY:f.label.refY,textAnchor:f.label.textAnchor,textVerticalAnchor:f.label.textVerticalAnchor}:{},...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{}},...f?{underline:f.underline}:{},...(g==null?void 0:g.attrs)??{}}}}),a=new Map(s.map(l=>[l.id,l])),o=t.edges.map(l=>{const u=l.kind??(t.kind==="architecture"?"dependency":void 0),h=a.get(l.source),d=a.get(l.target),f=t.kind==="mind-map"?GM(t.nodes,l.source):null,p=t.kind==="mind-map"?GM(t.nodes,l.target):null,g=t.kind==="mind-map"?Che(t.nodes,l.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,m=f?_Ot(f,r,g):null,y=h&&d?LOt(h,d,t.structure):{source:"right",target:"left"},v=h&&f?khe(h,f,y.source,t.structure):null,x=d&&p?khe(d,p,y.target,t.structure):null,b=t.kind==="mind-map"&&t.structure==="brace"?IOt(t.nodes,l.source):null,T=t.kind==="architecture"?kDt(u,e,l.bidirectional):null,C=(T==null?void 0:T.stroke)??(m==null?void 0:m.stroke)??(n==null?void 0:n.edge)??r.flowEdge,S=h&&d?t.kind==="architecture"?mDt(h,d):t.kind==="flowchart"?MDt(h,d):null:null,k=!!(S&&h&&d&&RDt(h,d));return{id:l.id,source:t.kind==="mind-map"?{cell:l.source,...v??{anchor:{name:y.source}}}:S?{cell:l.source,port:S.source}:{cell:l.source},target:t.kind==="mind-map"?{cell:l.target,...x??{anchor:{name:y.target}}}:S?{cell:l.target,port:S.target}:{cell:l.target},router:t.kind==="flowchart"||t.kind==="architecture"?k?{name:"normal"}:ADt:void 0,connector:t.kind==="mind-map"?{name:GAe,args:{sourceWidth:m==null?void 0:m.sourceWidth,targetWidth:m==null?void 0:m.targetWidth,structure:t.structure,...b?{braceTop:b.top,braceBottom:b.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{stroke:C,strokeWidth:(T==null?void 0:T.strokeWidth)??(m?She(t.structure,C).strokeWidth:1.5),strokeDasharray:T==null?void 0:T.strokeDasharray,sourceMarker:T?T.sourceMarker:l.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(T==null?void 0:T.targetMarker)??{name:"block",width:7,height:5},...m?She(t.structure,C):{fill:"none"}}},labels:l.label?[{attrs:{label:{text:l.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?fDt:t.kind==="flowchart"?SDt:pOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?pDt:t.kind==="flowchart"?EDt:gOt,fontFamily:t.kind==="architecture"?PAe:vW,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(T==null?void 0:T.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:o,nodes:s}},WAe={compact:560,standard:680,wide:800},qOt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,UOt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},m5={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},Ehe={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Ahe={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},YOt=(t,e)=>e&&m5[e]?e:t==="warm"?"sunset":t&&m5[t]?t:"slate",jOt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return qOt.test(n)?`_${n}`:n},dC=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),XOt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="slate",fontStyle:a="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=a==="mono",p=s==="notepad",g=f?`
    - ${cC(e||"note.md")} -
    `:"",m=p?'
    ':"",y=l&&!!e||h&&!!n||u&&r.length>0;let v="";if(y){const S=[];if(l&&e&&S.push(`${cC(e)}`),h&&n&&S.push(`${cC(n)}`),u&&r.length>0)for(const k of r)S.push(`#${cC(k)}`);v=`
    ${S.join("")}
    `}const x=o&&t?`

    ${cC(t)}

    `:"";return`
    + ${dC(e||"note.md")} +
    `:"",m=p?'
    ':"",y=l&&!!e||h&&!!n||u&&r.length>0;let v="";if(y){const S=[];if(l&&e&&S.push(`${dC(e)}`),h&&n&&S.push(`${dC(n)}`),u&&r.length>0)for(const k of r)S.push(`#${dC(k)}`);v=`
    ${S.join("")}
    `}const x=o&&t?`

    ${dC(t)}

    `:"";return`
    ${m} ${g} @@ -1864,7 +1871,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
    `:""} -
    `},$Ot=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=p5[t]||p5.slate,s=The[e]||The.sans,a=Che[r]||Che.md,o=BAe[n]||680;return` +`},KOt=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=m5[t]||m5.slate,s=Ehe[e]||Ehe.sans,a=Ahe[r]||Ahe.md,o=WAe[n]||680;return` :root { --ee-canvas-bg: ${i.canvasBg}; --ee-card-bg: ${i.cardBg}; @@ -2268,7 +2275,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. opacity: 0.9; } `:""} - `};rr({system:Qe().max(8e3),prompt:Qe().min(1).max(9e4),maxOutputTokens:ia().int().min(1).max(5e3).optional()}).strict();rr({url:Qe().min(1).max(8192),method:fi(["GET","HEAD"]).default("GET"),headers:wD(Qe().max(100),Qe().max(2e3)).default({})}).strict();const BOt=(t,e)=>{const r=n=>{if(n.ctrlKey||n.metaKey||n.altKey)return;const i=n.target;if(typeof Element<"u"&&i instanceof Element&&i.closest('input, textarea, select, [contenteditable="true"]'))return;const s=n.deltaMode===1?16:n.deltaMode===2?Math.max(1,t.clientHeight):1,a=(n.shiftKey&&n.deltaX===0?n.deltaY:n.deltaX)*s,o=(n.shiftKey&&n.deltaX===0?0:n.deltaY)*s;if(!a&&!o)return;n.preventDefault(),n.stopPropagation();const l=e.translate();e.translate(l.tx-a,l.ty-o)};return t.addEventListener("wheel",r,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",r,{capture:!0})},FOt=bDt,zOt=2.5,VOt=28,HOt=(t,e=FOt)=>t+1e-6>=e?"fit":"read",GOt=t=>{if(t.nodes.length){if(t.kind==="flowchart"){const e=new Set(t.edges.map(r=>r.target));return t.nodes.find(r=>!e.has(r.id))??t.nodes[0]}if(t.kind==="architecture"){const e=t.nodes.filter(r=>r.shape!=="boundary");return[...e.length?e:t.nodes].sort((r,n)=>r.x-n.x||r.y-n.y||r.id.localeCompare(n.id))[0]}return t.nodes.find(e=>!e.parentId)??t.nodes[0]}},WOt=(t,e,r,n=1)=>{const i=t.x+t.width/2,s=r==="flowchart"?t.y:t.y+t.height/2;return{tx:e.width/2-i*n,ty:(r==="flowchart"?32:e.height/2)-s*n}},qOt=(t,e,r,n=.1,i=zOt)=>e<8?t:Math.min(i,Math.max(n,t*(r/e))),khe=(t,e)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),UOt=(t,e,r)=>({x:(t.clientX+e.clientX)/2-r.left,y:(t.clientY+e.clientY)/2-r.top}),YOt=(t,e,r,n,i)=>{const s=BOt(e,t),a=e.parentElement;a==null||a.classList.add("edgeever-diagram-reader-host");const o=()=>{t.zoomToFit({maxScale:1,padding:VOt}),t.centerContent()},l=(x,b=1)=>{t.zoomTo(b);const T=WOt(x,{width:y,height:v},r.kind,b);t.translate(T.tx,T.ty)},u=()=>{const x=GOt(r);x&&l(x,1)},h=()=>{e.dataset.scale=`${Math.round(t.scale().sx*100)}`};t.on("scale",h);const d=x=>{var T,C;const b=(C=(T=x==null?void 0:x.node)==null?void 0:T.getBBox)==null?void 0:C.call(T);b&&l(b,Math.max(1,t.scale().sx))};t.on("node:click",d);let f=null;const p=x=>{var b;x.touches.length===2&&(f={distance:khe(x.touches[0],x.touches[1]),scale:t.scale().sx},(b=t.disablePanning)==null||b.call(t))},g=x=>{if(!f||x.touches.length!==2)return;x.preventDefault(),x.stopPropagation();const b=qOt(f.scale,f.distance,khe(x.touches[0],x.touches[1]));t.zoomTo(b,{center:UOt(x.touches[0],x.touches[1],e.getBoundingClientRect())})},m=x=>{var b;x.touches.length<2&&(f=null,(b=t.enablePanning)==null||b.call(t))};e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",g,{capture:!0,passive:!1}),e.addEventListener("touchend",m),e.addEventListener("touchcancel",m);let y=0,v=0;return{resize(x,b){if(x===y&&b===v)return;const T=y===0,C=t.translate(),S=(x-y)/2,k=(b-v)/2,E=T||v<80&&b>=160;y=x,v=b,t.resize(y,v),E?(o(),HOt(t.scale().sx)==="read"&&u()):t.translate(C.tx+S,C.ty+k),h()},dispose(){var x;s(),t.off("scale",h),t.off("node:click",d),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",g,!0),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m),(x=t.enablePanning)==null||x.call(t),a==null||a.classList.remove("edgeever-diagram-reader-host"),delete e.dataset.scale}}};let Yu=class FAe{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new FAe(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Cd=class zAe{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new zAe(r,Yu.range(this,e))}},Ut=class VAe{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15":">","<":"<",'"':""","'":"'"},JOt=/[&><"']/g;function ePt(t){return String(t).replace(JOt,e=>QOt[e])}var HAe=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},tPt=function(e){var r=HAe(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},rPt=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},nPt=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},Pr={contains:jOt,deflt:XOt,escape:ePt,hyphenate:ZOt,getBaseElem:HAe,isCharacterBox:tPt,protocolFromUrl:nPt},zM={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 "},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 ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function iPt(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let SQ=class{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r in zM)if(zM.hasOwnProperty(r)){var n=zM[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:iPt(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Ut("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=Pr.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},ap=class{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return ad[sPt[this.id]]}sub(){return ad[aPt[this.id]]}fracNum(){return ad[oPt[this.id]]}fracDen(){return ad[lPt[this.id]]}cramp(){return ad[cPt[this.id]]}text(){return ad[uPt[this.id]]}isTight(){return this.size>=2}};var EQ=0,tL=1,Ib=2,e0=3,N6=4,mu=5,g5=6,bl=7,ad=[new ap(EQ,0,!1),new ap(tL,0,!0),new ap(Ib,1,!1),new ap(e0,1,!0),new ap(N6,2,!1),new ap(mu,2,!0),new ap(g5,3,!1),new ap(bl,3,!0)],sPt=[N6,mu,N6,mu,g5,bl,g5,bl],aPt=[mu,mu,mu,mu,bl,bl,bl,bl],oPt=[Ib,e0,N6,mu,g5,bl,g5,bl],lPt=[e0,e0,mu,mu,bl,bl,bl,bl],cPt=[tL,tL,e0,e0,mu,mu,bl,bl],uPt=[EQ,tL,Ib,e0,Ib,e0,Ib,e0],Hr={DISPLAY:ad[EQ],TEXT:ad[Ib],SCRIPT:ad[N6],SCRIPTSCRIPT:ad[g5]},vW=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function hPt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var VM=[];vW.forEach(t=>t.blocks.forEach(e=>VM.push(...e)));function GAe(t){for(var e=0;e=VM[e]&&t<=VM[e+1])return!0;return!1}var Wv=80,dPt=function(e,r){return"M95,"+(622+e+r)+` + `};er({system:Qe().max(8e3),prompt:Qe().min(1).max(9e4),maxOutputTokens:ia().int().min(1).optional()}).strict();er({url:Qe().min(1).max(8192),method:pi(["GET","HEAD"]).default("GET"),headers:kD(Qe().max(100),Qe().max(2e3)).default({})}).strict();const ZOt=(t,e)=>{const r=n=>{if(n.ctrlKey||n.metaKey||n.altKey)return;const i=n.target;if(typeof Element<"u"&&i instanceof Element&&i.closest('input, textarea, select, [contenteditable="true"]'))return;const s=n.deltaMode===1?16:n.deltaMode===2?Math.max(1,t.clientHeight):1,a=(n.shiftKey&&n.deltaX===0?n.deltaY:n.deltaX)*s,o=(n.shiftKey&&n.deltaX===0?0:n.deltaY)*s;if(!a&&!o)return;n.preventDefault(),n.stopPropagation();const l=e.translate();e.translate(l.tx-a,l.ty-o)};return t.addEventListener("wheel",r,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",r,{capture:!0})},QOt=_Dt,JOt=2.5,ePt=28,tPt=(t,e=QOt)=>t+1e-6>=e?"fit":"read",rPt=t=>{if(t.nodes.length){if(t.kind==="flowchart"){const e=new Set(t.edges.map(r=>r.target));return t.nodes.find(r=>!e.has(r.id))??t.nodes[0]}if(t.kind==="architecture"){const e=t.nodes.filter(r=>r.shape!=="boundary");return[...e.length?e:t.nodes].sort((r,n)=>r.x-n.x||r.y-n.y||r.id.localeCompare(n.id))[0]}return t.nodes.find(e=>!e.parentId)??t.nodes[0]}},nPt=(t,e,r,n=1)=>{const i=t.x+t.width/2,s=r==="flowchart"?t.y:t.y+t.height/2;return{tx:e.width/2-i*n,ty:(r==="flowchart"?32:e.height/2)-s*n}},iPt=(t,e,r,n=.1,i=JOt)=>e<8?t:Math.min(i,Math.max(n,t*(r/e))),Mhe=(t,e)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),sPt=(t,e,r)=>({x:(t.clientX+e.clientX)/2-r.left,y:(t.clientY+e.clientY)/2-r.top}),aPt=(t,e,r,n,i)=>{const s=ZOt(e,t),a=e.parentElement;a==null||a.classList.add("edgeever-diagram-reader-host");const o=()=>{t.zoomToFit({maxScale:1,padding:ePt}),t.centerContent()},l=(x,b=1)=>{t.zoomTo(b);const T=nPt(x,{width:y,height:v},r.kind,b);t.translate(T.tx,T.ty)},u=()=>{const x=rPt(r);x&&l(x,1)},h=()=>{e.dataset.scale=`${Math.round(t.scale().sx*100)}`};t.on("scale",h);const d=x=>{var T,C;const b=(C=(T=x==null?void 0:x.node)==null?void 0:T.getBBox)==null?void 0:C.call(T);b&&l(b,Math.max(1,t.scale().sx))};t.on("node:click",d);let f=null;const p=x=>{var b;x.touches.length===2&&(f={distance:Mhe(x.touches[0],x.touches[1]),scale:t.scale().sx},(b=t.disablePanning)==null||b.call(t))},g=x=>{if(!f||x.touches.length!==2)return;x.preventDefault(),x.stopPropagation();const b=iPt(f.scale,f.distance,Mhe(x.touches[0],x.touches[1]));t.zoomTo(b,{center:sPt(x.touches[0],x.touches[1],e.getBoundingClientRect())})},m=x=>{var b;x.touches.length<2&&(f=null,(b=t.enablePanning)==null||b.call(t))};e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",g,{capture:!0,passive:!1}),e.addEventListener("touchend",m),e.addEventListener("touchcancel",m);let y=0,v=0;return{resize(x,b){if(x===y&&b===v)return;const T=y===0,C=t.translate(),S=(x-y)/2,k=(b-v)/2,E=T||v<80&&b>=160;y=x,v=b,t.resize(y,v),E?(o(),tPt(t.scale().sx)==="read"&&u()):t.translate(C.tx+S,C.ty+k),h()},dispose(){var x;s(),t.off("scale",h),t.off("node:click",d),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",g,!0),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m),(x=t.enablePanning)==null||x.call(t),a==null||a.classList.remove("edgeever-diagram-reader-host"),delete e.dataset.scale}}},Rhe=t=>{try{const e=t.state;t.view.updateState(Bf.create({doc:e.doc,plugins:e.plugins,schema:e.schema,selection:e.selection})),t.view.dispatch(t.state.tr.setMeta("addToHistory",!1).setMeta("preventUpdate",!0))}catch{try{const e=t.state;t.view.updateState(Bf.create({doc:e.doc,plugins:e.plugins,schema:e.schema}))}catch{}}};let Ku=class qAe{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new qAe(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Ed=class UAe{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new UAe(r,Ku.range(this,e))}},Ut=class YAe{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15":">","<":"<",'"':""","'":"'"},dPt=/[&><"']/g;function fPt(t){return String(t).replace(dPt,e=>hPt[e])}var jAe=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},pPt=function(e){var r=jAe(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},gPt=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},mPt=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},Pr={contains:oPt,deflt:lPt,escape:fPt,hyphenate:uPt,getBaseElem:jAe,isCharacterBox:pPt,protocolFromUrl:mPt},WM={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 "},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 ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function yPt(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let RQ=class{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r in WM)if(WM.hasOwnProperty(r)){var n=WM[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:yPt(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Ut("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=Pr.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},up=class{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return cd[vPt[this.id]]}sub(){return cd[bPt[this.id]]}fracNum(){return cd[xPt[this.id]]}fracDen(){return cd[wPt[this.id]]}cramp(){return cd[TPt[this.id]]}text(){return cd[CPt[this.id]]}isTight(){return this.size>=2}};var _Q=0,sL=1,Db=2,i0=3,P6=4,bu=5,y5=6,wl=7,cd=[new up(_Q,0,!1),new up(sL,0,!0),new up(Db,1,!1),new up(i0,1,!0),new up(P6,2,!1),new up(bu,2,!0),new up(y5,3,!1),new up(wl,3,!0)],vPt=[P6,bu,P6,bu,y5,wl,y5,wl],bPt=[bu,bu,bu,bu,wl,wl,wl,wl],xPt=[Db,i0,P6,bu,y5,wl,y5,wl],wPt=[i0,i0,bu,bu,wl,wl,wl,wl],TPt=[sL,sL,i0,i0,bu,bu,wl,wl],CPt=[_Q,sL,Db,i0,Db,i0,Db,i0],Hr={DISPLAY:cd[_Q],TEXT:cd[Db],SCRIPT:cd[P6],SCRIPTSCRIPT:cd[y5]},TW=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function kPt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var qM=[];TW.forEach(t=>t.blocks.forEach(e=>qM.push(...e)));function XAe(t){for(var e=0;e=qM[e]&&t<=qM[e+1])return!0;return!1}var Uv=80,SPt=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -2279,7 +2286,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},fPt=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},EPt=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -2289,7 +2296,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},pPt=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},APt=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -2298,7 +2305,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},gPt=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},MPt=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -2308,18 +2315,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},mPt=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},RPt=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},yPt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},vPt=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},_Pt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},LPt=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},bPt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=dPt(r,Wv);break;case"sqrtSize1":i=fPt(r,Wv);break;case"sqrtSize2":i=pPt(r,Wv);break;case"sqrtSize3":i=gPt(r,Wv);break;case"sqrtSize4":i=mPt(r,Wv);break;case"sqrtTall":i=vPt(r,Wv,n)}return i},xPt=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},She={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},IPt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=SPt(r,Uv);break;case"sqrtSize1":i=EPt(r,Uv);break;case"sqrtSize2":i=APt(r,Uv);break;case"sqrtSize3":i=MPt(r,Uv);break;case"sqrtSize4":i=RPt(r,Uv);break;case"sqrtTall":i=LPt(r,Uv,n)}return i},NPt=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},_he={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 @@ -2494,7 +2501,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` 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`},wPt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},DPt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -2522,14 +2529,14 @@ 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 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};let o7=class{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 Pr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText();return this.children.map(e).join("")}};var dd={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},t8={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ehe={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function TPt(t,e){dd[t]=e}function AQ(t,e,r){if(!dd[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=dd[e][n];if(!i&&t[0]in Ehe&&(n=Ehe[t[0]].charCodeAt(0),i=dd[e][n]),!i&&r==="text"&&GAe(n)&&(i=dd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var vB={};function CPt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!vB[e]){var r=vB[e]={cssEmPerMu:t8.quad[e]/18};for(var n in t8)t8.hasOwnProperty(n)&&(r[n]=t8[n][e])}return vB[e]}var kPt=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ahe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Mhe=function(e,r){return r.size<2?e:kPt[e-1][r.size-1]};let WAe=class qm{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||qm.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Ahe[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new qm(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Mhe(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Ahe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Mhe(qm.BASESIZE,e);return this.size===r&&this.textSize===qm.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==qm.BASESIZE?["sizing","reset-size"+this.size,"size"+qm.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=CPt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};WAe.BASESIZE=6;var bW={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},SPt={ex:!0,em:!0,mu:!0},qAe=function(e){return typeof e!="string"&&(e=e.unit),e in bW||e in SPt||e==="ex"},bs=function(e,r){var n;if(e.unit in bW)n=bW[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Ut("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Xt=function(e){return+e.toFixed(4)+"em"},vg=function(e){return e.filter(r=>r).join(" ")},UAe=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},YAe=function(e){var r=document.createElement(e);r.className=vg(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var s=0;s/=\x00-\x1f]/,jAe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Pr.escape(vg(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Pr.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+Pr.escape(n)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(EPt.test(s))throw new Ut("Invalid attribute name '"+s+"'");r+=" "+s+'="'+Pr.escape(this.attributes[s])+'"'}r+=">";for(var a=0;a",r};let l7=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,UAe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Pr.contains(this.classes,e)}toNode(){return YAe.call(this,"span")}toMarkup(){return jAe.call(this,"span")}},MQ=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,UAe.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Pr.contains(this.classes,e)}toNode(){return YAe.call(this,"a")}toMarkup(){return jAe.call(this,"a")}},APt=class{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Pr.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=''+Pr.escape(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Xt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=vg(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Pr.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Pr.escape(n)+'"');var s=Pr.escape(this.text);return e?(r+=">",r+=s,r+="",r):s}},g0=class{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},xW=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var _Pt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},LPt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Vi={math:{},text:{}};function Y(t,e,r,n,i,s){Vi[t][i]={font:e,group:r,replace:n},s&&n&&(Vi[t][n]=Vi[t][i])}var ae="math",Ot="text",be="main",Ge="ams",ds="accent-token",ur="bin",Pl="close",d3="inner",zr="mathord",fa="op-token",qc="open",CD="punct",Ue="rel",z0="spacing",et="textord";Y(ae,be,Ue,"≡","\\equiv",!0);Y(ae,be,Ue,"≺","\\prec",!0);Y(ae,be,Ue,"≻","\\succ",!0);Y(ae,be,Ue,"∼","\\sim",!0);Y(ae,be,Ue,"⊥","\\perp");Y(ae,be,Ue,"⪯","\\preceq",!0);Y(ae,be,Ue,"⪰","\\succeq",!0);Y(ae,be,Ue,"≃","\\simeq",!0);Y(ae,be,Ue,"∣","\\mid",!0);Y(ae,be,Ue,"≪","\\ll",!0);Y(ae,be,Ue,"≫","\\gg",!0);Y(ae,be,Ue,"≍","\\asymp",!0);Y(ae,be,Ue,"∥","\\parallel");Y(ae,be,Ue,"⋈","\\bowtie",!0);Y(ae,be,Ue,"⌣","\\smile",!0);Y(ae,be,Ue,"⊑","\\sqsubseteq",!0);Y(ae,be,Ue,"⊒","\\sqsupseteq",!0);Y(ae,be,Ue,"≐","\\doteq",!0);Y(ae,be,Ue,"⌢","\\frown",!0);Y(ae,be,Ue,"∋","\\ni",!0);Y(ae,be,Ue,"∝","\\propto",!0);Y(ae,be,Ue,"⊢","\\vdash",!0);Y(ae,be,Ue,"⊣","\\dashv",!0);Y(ae,be,Ue,"∋","\\owns");Y(ae,be,CD,".","\\ldotp");Y(ae,be,CD,"⋅","\\cdotp");Y(ae,be,et,"#","\\#");Y(Ot,be,et,"#","\\#");Y(ae,be,et,"&","\\&");Y(Ot,be,et,"&","\\&");Y(ae,be,et,"ℵ","\\aleph",!0);Y(ae,be,et,"∀","\\forall",!0);Y(ae,be,et,"ℏ","\\hbar",!0);Y(ae,be,et,"∃","\\exists",!0);Y(ae,be,et,"∇","\\nabla",!0);Y(ae,be,et,"♭","\\flat",!0);Y(ae,be,et,"ℓ","\\ell",!0);Y(ae,be,et,"♮","\\natural",!0);Y(ae,be,et,"♣","\\clubsuit",!0);Y(ae,be,et,"℘","\\wp",!0);Y(ae,be,et,"♯","\\sharp",!0);Y(ae,be,et,"♢","\\diamondsuit",!0);Y(ae,be,et,"ℜ","\\Re",!0);Y(ae,be,et,"♡","\\heartsuit",!0);Y(ae,be,et,"ℑ","\\Im",!0);Y(ae,be,et,"♠","\\spadesuit",!0);Y(ae,be,et,"§","\\S",!0);Y(Ot,be,et,"§","\\S");Y(ae,be,et,"¶","\\P",!0);Y(Ot,be,et,"¶","\\P");Y(ae,be,et,"†","\\dag");Y(Ot,be,et,"†","\\dag");Y(Ot,be,et,"†","\\textdagger");Y(ae,be,et,"‡","\\ddag");Y(Ot,be,et,"‡","\\ddag");Y(Ot,be,et,"‡","\\textdaggerdbl");Y(ae,be,Pl,"⎱","\\rmoustache",!0);Y(ae,be,qc,"⎰","\\lmoustache",!0);Y(ae,be,Pl,"⟯","\\rgroup",!0);Y(ae,be,qc,"⟮","\\lgroup",!0);Y(ae,be,ur,"∓","\\mp",!0);Y(ae,be,ur,"⊖","\\ominus",!0);Y(ae,be,ur,"⊎","\\uplus",!0);Y(ae,be,ur,"⊓","\\sqcap",!0);Y(ae,be,ur,"∗","\\ast");Y(ae,be,ur,"⊔","\\sqcup",!0);Y(ae,be,ur,"◯","\\bigcirc",!0);Y(ae,be,ur,"∙","\\bullet",!0);Y(ae,be,ur,"‡","\\ddagger");Y(ae,be,ur,"≀","\\wr",!0);Y(ae,be,ur,"⨿","\\amalg");Y(ae,be,ur,"&","\\And");Y(ae,be,Ue,"⟵","\\longleftarrow",!0);Y(ae,be,Ue,"⇐","\\Leftarrow",!0);Y(ae,be,Ue,"⟸","\\Longleftarrow",!0);Y(ae,be,Ue,"⟶","\\longrightarrow",!0);Y(ae,be,Ue,"⇒","\\Rightarrow",!0);Y(ae,be,Ue,"⟹","\\Longrightarrow",!0);Y(ae,be,Ue,"↔","\\leftrightarrow",!0);Y(ae,be,Ue,"⟷","\\longleftrightarrow",!0);Y(ae,be,Ue,"⇔","\\Leftrightarrow",!0);Y(ae,be,Ue,"⟺","\\Longleftrightarrow",!0);Y(ae,be,Ue,"↦","\\mapsto",!0);Y(ae,be,Ue,"⟼","\\longmapsto",!0);Y(ae,be,Ue,"↗","\\nearrow",!0);Y(ae,be,Ue,"↩","\\hookleftarrow",!0);Y(ae,be,Ue,"↪","\\hookrightarrow",!0);Y(ae,be,Ue,"↘","\\searrow",!0);Y(ae,be,Ue,"↼","\\leftharpoonup",!0);Y(ae,be,Ue,"⇀","\\rightharpoonup",!0);Y(ae,be,Ue,"↙","\\swarrow",!0);Y(ae,be,Ue,"↽","\\leftharpoondown",!0);Y(ae,be,Ue,"⇁","\\rightharpoondown",!0);Y(ae,be,Ue,"↖","\\nwarrow",!0);Y(ae,be,Ue,"⇌","\\rightleftharpoons",!0);Y(ae,Ge,Ue,"≮","\\nless",!0);Y(ae,Ge,Ue,"","\\@nleqslant");Y(ae,Ge,Ue,"","\\@nleqq");Y(ae,Ge,Ue,"⪇","\\lneq",!0);Y(ae,Ge,Ue,"≨","\\lneqq",!0);Y(ae,Ge,Ue,"","\\@lvertneqq");Y(ae,Ge,Ue,"⋦","\\lnsim",!0);Y(ae,Ge,Ue,"⪉","\\lnapprox",!0);Y(ae,Ge,Ue,"⊀","\\nprec",!0);Y(ae,Ge,Ue,"⋠","\\npreceq",!0);Y(ae,Ge,Ue,"⋨","\\precnsim",!0);Y(ae,Ge,Ue,"⪹","\\precnapprox",!0);Y(ae,Ge,Ue,"≁","\\nsim",!0);Y(ae,Ge,Ue,"","\\@nshortmid");Y(ae,Ge,Ue,"∤","\\nmid",!0);Y(ae,Ge,Ue,"⊬","\\nvdash",!0);Y(ae,Ge,Ue,"⊭","\\nvDash",!0);Y(ae,Ge,Ue,"⋪","\\ntriangleleft");Y(ae,Ge,Ue,"⋬","\\ntrianglelefteq",!0);Y(ae,Ge,Ue,"⊊","\\subsetneq",!0);Y(ae,Ge,Ue,"","\\@varsubsetneq");Y(ae,Ge,Ue,"⫋","\\subsetneqq",!0);Y(ae,Ge,Ue,"","\\@varsubsetneqq");Y(ae,Ge,Ue,"≯","\\ngtr",!0);Y(ae,Ge,Ue,"","\\@ngeqslant");Y(ae,Ge,Ue,"","\\@ngeqq");Y(ae,Ge,Ue,"⪈","\\gneq",!0);Y(ae,Ge,Ue,"≩","\\gneqq",!0);Y(ae,Ge,Ue,"","\\@gvertneqq");Y(ae,Ge,Ue,"⋧","\\gnsim",!0);Y(ae,Ge,Ue,"⪊","\\gnapprox",!0);Y(ae,Ge,Ue,"⊁","\\nsucc",!0);Y(ae,Ge,Ue,"⋡","\\nsucceq",!0);Y(ae,Ge,Ue,"⋩","\\succnsim",!0);Y(ae,Ge,Ue,"⪺","\\succnapprox",!0);Y(ae,Ge,Ue,"≆","\\ncong",!0);Y(ae,Ge,Ue,"","\\@nshortparallel");Y(ae,Ge,Ue,"∦","\\nparallel",!0);Y(ae,Ge,Ue,"⊯","\\nVDash",!0);Y(ae,Ge,Ue,"⋫","\\ntriangleright");Y(ae,Ge,Ue,"⋭","\\ntrianglerighteq",!0);Y(ae,Ge,Ue,"","\\@nsupseteqq");Y(ae,Ge,Ue,"⊋","\\supsetneq",!0);Y(ae,Ge,Ue,"","\\@varsupsetneq");Y(ae,Ge,Ue,"⫌","\\supsetneqq",!0);Y(ae,Ge,Ue,"","\\@varsupsetneqq");Y(ae,Ge,Ue,"⊮","\\nVdash",!0);Y(ae,Ge,Ue,"⪵","\\precneqq",!0);Y(ae,Ge,Ue,"⪶","\\succneqq",!0);Y(ae,Ge,Ue,"","\\@nsubseteqq");Y(ae,Ge,ur,"⊴","\\unlhd");Y(ae,Ge,ur,"⊵","\\unrhd");Y(ae,Ge,Ue,"↚","\\nleftarrow",!0);Y(ae,Ge,Ue,"↛","\\nrightarrow",!0);Y(ae,Ge,Ue,"⇍","\\nLeftarrow",!0);Y(ae,Ge,Ue,"⇏","\\nRightarrow",!0);Y(ae,Ge,Ue,"↮","\\nleftrightarrow",!0);Y(ae,Ge,Ue,"⇎","\\nLeftrightarrow",!0);Y(ae,Ge,Ue,"△","\\vartriangle");Y(ae,Ge,et,"ℏ","\\hslash");Y(ae,Ge,et,"▽","\\triangledown");Y(ae,Ge,et,"◊","\\lozenge");Y(ae,Ge,et,"Ⓢ","\\circledS");Y(ae,Ge,et,"®","\\circledR");Y(Ot,Ge,et,"®","\\circledR");Y(ae,Ge,et,"∡","\\measuredangle",!0);Y(ae,Ge,et,"∄","\\nexists");Y(ae,Ge,et,"℧","\\mho");Y(ae,Ge,et,"Ⅎ","\\Finv",!0);Y(ae,Ge,et,"⅁","\\Game",!0);Y(ae,Ge,et,"‵","\\backprime");Y(ae,Ge,et,"▲","\\blacktriangle");Y(ae,Ge,et,"▼","\\blacktriangledown");Y(ae,Ge,et,"■","\\blacksquare");Y(ae,Ge,et,"⧫","\\blacklozenge");Y(ae,Ge,et,"★","\\bigstar");Y(ae,Ge,et,"∢","\\sphericalangle",!0);Y(ae,Ge,et,"∁","\\complement",!0);Y(ae,Ge,et,"ð","\\eth",!0);Y(Ot,be,et,"ð","ð");Y(ae,Ge,et,"╱","\\diagup");Y(ae,Ge,et,"╲","\\diagdown");Y(ae,Ge,et,"□","\\square");Y(ae,Ge,et,"□","\\Box");Y(ae,Ge,et,"◊","\\Diamond");Y(ae,Ge,et,"¥","\\yen",!0);Y(Ot,Ge,et,"¥","\\yen",!0);Y(ae,Ge,et,"✓","\\checkmark",!0);Y(Ot,Ge,et,"✓","\\checkmark");Y(ae,Ge,et,"ℶ","\\beth",!0);Y(ae,Ge,et,"ℸ","\\daleth",!0);Y(ae,Ge,et,"ℷ","\\gimel",!0);Y(ae,Ge,et,"ϝ","\\digamma",!0);Y(ae,Ge,et,"ϰ","\\varkappa");Y(ae,Ge,qc,"┌","\\@ulcorner",!0);Y(ae,Ge,Pl,"┐","\\@urcorner",!0);Y(ae,Ge,qc,"└","\\@llcorner",!0);Y(ae,Ge,Pl,"┘","\\@lrcorner",!0);Y(ae,Ge,Ue,"≦","\\leqq",!0);Y(ae,Ge,Ue,"⩽","\\leqslant",!0);Y(ae,Ge,Ue,"⪕","\\eqslantless",!0);Y(ae,Ge,Ue,"≲","\\lesssim",!0);Y(ae,Ge,Ue,"⪅","\\lessapprox",!0);Y(ae,Ge,Ue,"≊","\\approxeq",!0);Y(ae,Ge,ur,"⋖","\\lessdot");Y(ae,Ge,Ue,"⋘","\\lll",!0);Y(ae,Ge,Ue,"≶","\\lessgtr",!0);Y(ae,Ge,Ue,"⋚","\\lesseqgtr",!0);Y(ae,Ge,Ue,"⪋","\\lesseqqgtr",!0);Y(ae,Ge,Ue,"≑","\\doteqdot");Y(ae,Ge,Ue,"≓","\\risingdotseq",!0);Y(ae,Ge,Ue,"≒","\\fallingdotseq",!0);Y(ae,Ge,Ue,"∽","\\backsim",!0);Y(ae,Ge,Ue,"⋍","\\backsimeq",!0);Y(ae,Ge,Ue,"⫅","\\subseteqq",!0);Y(ae,Ge,Ue,"⋐","\\Subset",!0);Y(ae,Ge,Ue,"⊏","\\sqsubset",!0);Y(ae,Ge,Ue,"≼","\\preccurlyeq",!0);Y(ae,Ge,Ue,"⋞","\\curlyeqprec",!0);Y(ae,Ge,Ue,"≾","\\precsim",!0);Y(ae,Ge,Ue,"⪷","\\precapprox",!0);Y(ae,Ge,Ue,"⊲","\\vartriangleleft");Y(ae,Ge,Ue,"⊴","\\trianglelefteq");Y(ae,Ge,Ue,"⊨","\\vDash",!0);Y(ae,Ge,Ue,"⊪","\\Vvdash",!0);Y(ae,Ge,Ue,"⌣","\\smallsmile");Y(ae,Ge,Ue,"⌢","\\smallfrown");Y(ae,Ge,Ue,"≏","\\bumpeq",!0);Y(ae,Ge,Ue,"≎","\\Bumpeq",!0);Y(ae,Ge,Ue,"≧","\\geqq",!0);Y(ae,Ge,Ue,"⩾","\\geqslant",!0);Y(ae,Ge,Ue,"⪖","\\eqslantgtr",!0);Y(ae,Ge,Ue,"≳","\\gtrsim",!0);Y(ae,Ge,Ue,"⪆","\\gtrapprox",!0);Y(ae,Ge,ur,"⋗","\\gtrdot");Y(ae,Ge,Ue,"⋙","\\ggg",!0);Y(ae,Ge,Ue,"≷","\\gtrless",!0);Y(ae,Ge,Ue,"⋛","\\gtreqless",!0);Y(ae,Ge,Ue,"⪌","\\gtreqqless",!0);Y(ae,Ge,Ue,"≖","\\eqcirc",!0);Y(ae,Ge,Ue,"≗","\\circeq",!0);Y(ae,Ge,Ue,"≜","\\triangleq",!0);Y(ae,Ge,Ue,"∼","\\thicksim");Y(ae,Ge,Ue,"≈","\\thickapprox");Y(ae,Ge,Ue,"⫆","\\supseteqq",!0);Y(ae,Ge,Ue,"⋑","\\Supset",!0);Y(ae,Ge,Ue,"⊐","\\sqsupset",!0);Y(ae,Ge,Ue,"≽","\\succcurlyeq",!0);Y(ae,Ge,Ue,"⋟","\\curlyeqsucc",!0);Y(ae,Ge,Ue,"≿","\\succsim",!0);Y(ae,Ge,Ue,"⪸","\\succapprox",!0);Y(ae,Ge,Ue,"⊳","\\vartriangleright");Y(ae,Ge,Ue,"⊵","\\trianglerighteq");Y(ae,Ge,Ue,"⊩","\\Vdash",!0);Y(ae,Ge,Ue,"∣","\\shortmid");Y(ae,Ge,Ue,"∥","\\shortparallel");Y(ae,Ge,Ue,"≬","\\between",!0);Y(ae,Ge,Ue,"⋔","\\pitchfork",!0);Y(ae,Ge,Ue,"∝","\\varpropto");Y(ae,Ge,Ue,"◀","\\blacktriangleleft");Y(ae,Ge,Ue,"∴","\\therefore",!0);Y(ae,Ge,Ue,"∍","\\backepsilon");Y(ae,Ge,Ue,"▶","\\blacktriangleright");Y(ae,Ge,Ue,"∵","\\because",!0);Y(ae,Ge,Ue,"⋘","\\llless");Y(ae,Ge,Ue,"⋙","\\gggtr");Y(ae,Ge,ur,"⊲","\\lhd");Y(ae,Ge,ur,"⊳","\\rhd");Y(ae,Ge,Ue,"≂","\\eqsim",!0);Y(ae,be,Ue,"⋈","\\Join");Y(ae,Ge,Ue,"≑","\\Doteq",!0);Y(ae,Ge,ur,"∔","\\dotplus",!0);Y(ae,Ge,ur,"∖","\\smallsetminus");Y(ae,Ge,ur,"⋒","\\Cap",!0);Y(ae,Ge,ur,"⋓","\\Cup",!0);Y(ae,Ge,ur,"⩞","\\doublebarwedge",!0);Y(ae,Ge,ur,"⊟","\\boxminus",!0);Y(ae,Ge,ur,"⊞","\\boxplus",!0);Y(ae,Ge,ur,"⋇","\\divideontimes",!0);Y(ae,Ge,ur,"⋉","\\ltimes",!0);Y(ae,Ge,ur,"⋊","\\rtimes",!0);Y(ae,Ge,ur,"⋋","\\leftthreetimes",!0);Y(ae,Ge,ur,"⋌","\\rightthreetimes",!0);Y(ae,Ge,ur,"⋏","\\curlywedge",!0);Y(ae,Ge,ur,"⋎","\\curlyvee",!0);Y(ae,Ge,ur,"⊝","\\circleddash",!0);Y(ae,Ge,ur,"⊛","\\circledast",!0);Y(ae,Ge,ur,"⋅","\\centerdot");Y(ae,Ge,ur,"⊺","\\intercal",!0);Y(ae,Ge,ur,"⋒","\\doublecap");Y(ae,Ge,ur,"⋓","\\doublecup");Y(ae,Ge,ur,"⊠","\\boxtimes",!0);Y(ae,Ge,Ue,"⇢","\\dashrightarrow",!0);Y(ae,Ge,Ue,"⇠","\\dashleftarrow",!0);Y(ae,Ge,Ue,"⇇","\\leftleftarrows",!0);Y(ae,Ge,Ue,"⇆","\\leftrightarrows",!0);Y(ae,Ge,Ue,"⇚","\\Lleftarrow",!0);Y(ae,Ge,Ue,"↞","\\twoheadleftarrow",!0);Y(ae,Ge,Ue,"↢","\\leftarrowtail",!0);Y(ae,Ge,Ue,"↫","\\looparrowleft",!0);Y(ae,Ge,Ue,"⇋","\\leftrightharpoons",!0);Y(ae,Ge,Ue,"↶","\\curvearrowleft",!0);Y(ae,Ge,Ue,"↺","\\circlearrowleft",!0);Y(ae,Ge,Ue,"↰","\\Lsh",!0);Y(ae,Ge,Ue,"⇈","\\upuparrows",!0);Y(ae,Ge,Ue,"↿","\\upharpoonleft",!0);Y(ae,Ge,Ue,"⇃","\\downharpoonleft",!0);Y(ae,be,Ue,"⊶","\\origof",!0);Y(ae,be,Ue,"⊷","\\imageof",!0);Y(ae,Ge,Ue,"⊸","\\multimap",!0);Y(ae,Ge,Ue,"↭","\\leftrightsquigarrow",!0);Y(ae,Ge,Ue,"⇉","\\rightrightarrows",!0);Y(ae,Ge,Ue,"⇄","\\rightleftarrows",!0);Y(ae,Ge,Ue,"↠","\\twoheadrightarrow",!0);Y(ae,Ge,Ue,"↣","\\rightarrowtail",!0);Y(ae,Ge,Ue,"↬","\\looparrowright",!0);Y(ae,Ge,Ue,"↷","\\curvearrowright",!0);Y(ae,Ge,Ue,"↻","\\circlearrowright",!0);Y(ae,Ge,Ue,"↱","\\Rsh",!0);Y(ae,Ge,Ue,"⇊","\\downdownarrows",!0);Y(ae,Ge,Ue,"↾","\\upharpoonright",!0);Y(ae,Ge,Ue,"⇂","\\downharpoonright",!0);Y(ae,Ge,Ue,"⇝","\\rightsquigarrow",!0);Y(ae,Ge,Ue,"⇝","\\leadsto");Y(ae,Ge,Ue,"⇛","\\Rrightarrow",!0);Y(ae,Ge,Ue,"↾","\\restriction");Y(ae,be,et,"‘","`");Y(ae,be,et,"$","\\$");Y(Ot,be,et,"$","\\$");Y(Ot,be,et,"$","\\textdollar");Y(ae,be,et,"%","\\%");Y(Ot,be,et,"%","\\%");Y(ae,be,et,"_","\\_");Y(Ot,be,et,"_","\\_");Y(Ot,be,et,"_","\\textunderscore");Y(ae,be,et,"∠","\\angle",!0);Y(ae,be,et,"∞","\\infty",!0);Y(ae,be,et,"′","\\prime");Y(ae,be,et,"△","\\triangle");Y(ae,be,et,"Γ","\\Gamma",!0);Y(ae,be,et,"Δ","\\Delta",!0);Y(ae,be,et,"Θ","\\Theta",!0);Y(ae,be,et,"Λ","\\Lambda",!0);Y(ae,be,et,"Ξ","\\Xi",!0);Y(ae,be,et,"Π","\\Pi",!0);Y(ae,be,et,"Σ","\\Sigma",!0);Y(ae,be,et,"Υ","\\Upsilon",!0);Y(ae,be,et,"Φ","\\Phi",!0);Y(ae,be,et,"Ψ","\\Psi",!0);Y(ae,be,et,"Ω","\\Omega",!0);Y(ae,be,et,"A","Α");Y(ae,be,et,"B","Β");Y(ae,be,et,"E","Ε");Y(ae,be,et,"Z","Ζ");Y(ae,be,et,"H","Η");Y(ae,be,et,"I","Ι");Y(ae,be,et,"K","Κ");Y(ae,be,et,"M","Μ");Y(ae,be,et,"N","Ν");Y(ae,be,et,"O","Ο");Y(ae,be,et,"P","Ρ");Y(ae,be,et,"T","Τ");Y(ae,be,et,"X","Χ");Y(ae,be,et,"¬","\\neg",!0);Y(ae,be,et,"¬","\\lnot");Y(ae,be,et,"⊤","\\top");Y(ae,be,et,"⊥","\\bot");Y(ae,be,et,"∅","\\emptyset");Y(ae,Ge,et,"∅","\\varnothing");Y(ae,be,zr,"α","\\alpha",!0);Y(ae,be,zr,"β","\\beta",!0);Y(ae,be,zr,"γ","\\gamma",!0);Y(ae,be,zr,"δ","\\delta",!0);Y(ae,be,zr,"ϵ","\\epsilon",!0);Y(ae,be,zr,"ζ","\\zeta",!0);Y(ae,be,zr,"η","\\eta",!0);Y(ae,be,zr,"θ","\\theta",!0);Y(ae,be,zr,"ι","\\iota",!0);Y(ae,be,zr,"κ","\\kappa",!0);Y(ae,be,zr,"λ","\\lambda",!0);Y(ae,be,zr,"μ","\\mu",!0);Y(ae,be,zr,"ν","\\nu",!0);Y(ae,be,zr,"ξ","\\xi",!0);Y(ae,be,zr,"ο","\\omicron",!0);Y(ae,be,zr,"π","\\pi",!0);Y(ae,be,zr,"ρ","\\rho",!0);Y(ae,be,zr,"σ","\\sigma",!0);Y(ae,be,zr,"τ","\\tau",!0);Y(ae,be,zr,"υ","\\upsilon",!0);Y(ae,be,zr,"ϕ","\\phi",!0);Y(ae,be,zr,"χ","\\chi",!0);Y(ae,be,zr,"ψ","\\psi",!0);Y(ae,be,zr,"ω","\\omega",!0);Y(ae,be,zr,"ε","\\varepsilon",!0);Y(ae,be,zr,"ϑ","\\vartheta",!0);Y(ae,be,zr,"ϖ","\\varpi",!0);Y(ae,be,zr,"ϱ","\\varrho",!0);Y(ae,be,zr,"ς","\\varsigma",!0);Y(ae,be,zr,"φ","\\varphi",!0);Y(ae,be,ur,"∗","*",!0);Y(ae,be,ur,"+","+");Y(ae,be,ur,"−","-",!0);Y(ae,be,ur,"⋅","\\cdot",!0);Y(ae,be,ur,"∘","\\circ",!0);Y(ae,be,ur,"÷","\\div",!0);Y(ae,be,ur,"±","\\pm",!0);Y(ae,be,ur,"×","\\times",!0);Y(ae,be,ur,"∩","\\cap",!0);Y(ae,be,ur,"∪","\\cup",!0);Y(ae,be,ur,"∖","\\setminus",!0);Y(ae,be,ur,"∧","\\land");Y(ae,be,ur,"∨","\\lor");Y(ae,be,ur,"∧","\\wedge",!0);Y(ae,be,ur,"∨","\\vee",!0);Y(ae,be,et,"√","\\surd");Y(ae,be,qc,"⟨","\\langle",!0);Y(ae,be,qc,"∣","\\lvert");Y(ae,be,qc,"∥","\\lVert");Y(ae,be,Pl,"?","?");Y(ae,be,Pl,"!","!");Y(ae,be,Pl,"⟩","\\rangle",!0);Y(ae,be,Pl,"∣","\\rvert");Y(ae,be,Pl,"∥","\\rVert");Y(ae,be,Ue,"=","=");Y(ae,be,Ue,":",":");Y(ae,be,Ue,"≈","\\approx",!0);Y(ae,be,Ue,"≅","\\cong",!0);Y(ae,be,Ue,"≥","\\ge");Y(ae,be,Ue,"≥","\\geq",!0);Y(ae,be,Ue,"←","\\gets");Y(ae,be,Ue,">","\\gt",!0);Y(ae,be,Ue,"∈","\\in",!0);Y(ae,be,Ue,"","\\@not");Y(ae,be,Ue,"⊂","\\subset",!0);Y(ae,be,Ue,"⊃","\\supset",!0);Y(ae,be,Ue,"⊆","\\subseteq",!0);Y(ae,be,Ue,"⊇","\\supseteq",!0);Y(ae,Ge,Ue,"⊈","\\nsubseteq",!0);Y(ae,Ge,Ue,"⊉","\\nsupseteq",!0);Y(ae,be,Ue,"⊨","\\models");Y(ae,be,Ue,"←","\\leftarrow",!0);Y(ae,be,Ue,"≤","\\le");Y(ae,be,Ue,"≤","\\leq",!0);Y(ae,be,Ue,"<","\\lt",!0);Y(ae,be,Ue,"→","\\rightarrow",!0);Y(ae,be,Ue,"→","\\to");Y(ae,Ge,Ue,"≱","\\ngeq",!0);Y(ae,Ge,Ue,"≰","\\nleq",!0);Y(ae,be,z0," ","\\ ");Y(ae,be,z0," ","\\space");Y(ae,be,z0," ","\\nobreakspace");Y(Ot,be,z0," ","\\ ");Y(Ot,be,z0," "," ");Y(Ot,be,z0," ","\\space");Y(Ot,be,z0," ","\\nobreakspace");Y(ae,be,z0,null,"\\nobreak");Y(ae,be,z0,null,"\\allowbreak");Y(ae,be,CD,",",",");Y(ae,be,CD,";",";");Y(ae,Ge,ur,"⊼","\\barwedge",!0);Y(ae,Ge,ur,"⊻","\\veebar",!0);Y(ae,be,ur,"⊙","\\odot",!0);Y(ae,be,ur,"⊕","\\oplus",!0);Y(ae,be,ur,"⊗","\\otimes",!0);Y(ae,be,et,"∂","\\partial",!0);Y(ae,be,ur,"⊘","\\oslash",!0);Y(ae,Ge,ur,"⊚","\\circledcirc",!0);Y(ae,Ge,ur,"⊡","\\boxdot",!0);Y(ae,be,ur,"△","\\bigtriangleup");Y(ae,be,ur,"▽","\\bigtriangledown");Y(ae,be,ur,"†","\\dagger");Y(ae,be,ur,"⋄","\\diamond");Y(ae,be,ur,"⋆","\\star");Y(ae,be,ur,"◃","\\triangleleft");Y(ae,be,ur,"▹","\\triangleright");Y(ae,be,qc,"{","\\{");Y(Ot,be,et,"{","\\{");Y(Ot,be,et,"{","\\textbraceleft");Y(ae,be,Pl,"}","\\}");Y(Ot,be,et,"}","\\}");Y(Ot,be,et,"}","\\textbraceright");Y(ae,be,qc,"{","\\lbrace");Y(ae,be,Pl,"}","\\rbrace");Y(ae,be,qc,"[","\\lbrack",!0);Y(Ot,be,et,"[","\\lbrack",!0);Y(ae,be,Pl,"]","\\rbrack",!0);Y(Ot,be,et,"]","\\rbrack",!0);Y(ae,be,qc,"(","\\lparen",!0);Y(ae,be,Pl,")","\\rparen",!0);Y(Ot,be,et,"<","\\textless",!0);Y(Ot,be,et,">","\\textgreater",!0);Y(ae,be,qc,"⌊","\\lfloor",!0);Y(ae,be,Pl,"⌋","\\rfloor",!0);Y(ae,be,qc,"⌈","\\lceil",!0);Y(ae,be,Pl,"⌉","\\rceil",!0);Y(ae,be,et,"\\","\\backslash");Y(ae,be,et,"∣","|");Y(ae,be,et,"∣","\\vert");Y(Ot,be,et,"|","\\textbar",!0);Y(ae,be,et,"∥","\\|");Y(ae,be,et,"∥","\\Vert");Y(Ot,be,et,"∥","\\textbardbl");Y(Ot,be,et,"~","\\textasciitilde");Y(Ot,be,et,"\\","\\textbackslash");Y(Ot,be,et,"^","\\textasciicircum");Y(ae,be,Ue,"↑","\\uparrow",!0);Y(ae,be,Ue,"⇑","\\Uparrow",!0);Y(ae,be,Ue,"↓","\\downarrow",!0);Y(ae,be,Ue,"⇓","\\Downarrow",!0);Y(ae,be,Ue,"↕","\\updownarrow",!0);Y(ae,be,Ue,"⇕","\\Updownarrow",!0);Y(ae,be,fa,"∐","\\coprod");Y(ae,be,fa,"⋁","\\bigvee");Y(ae,be,fa,"⋀","\\bigwedge");Y(ae,be,fa,"⨄","\\biguplus");Y(ae,be,fa,"⋂","\\bigcap");Y(ae,be,fa,"⋃","\\bigcup");Y(ae,be,fa,"∫","\\int");Y(ae,be,fa,"∫","\\intop");Y(ae,be,fa,"∬","\\iint");Y(ae,be,fa,"∭","\\iiint");Y(ae,be,fa,"∏","\\prod");Y(ae,be,fa,"∑","\\sum");Y(ae,be,fa,"⨂","\\bigotimes");Y(ae,be,fa,"⨁","\\bigoplus");Y(ae,be,fa,"⨀","\\bigodot");Y(ae,be,fa,"∮","\\oint");Y(ae,be,fa,"∯","\\oiint");Y(ae,be,fa,"∰","\\oiiint");Y(ae,be,fa,"⨆","\\bigsqcup");Y(ae,be,fa,"∫","\\smallint");Y(Ot,be,d3,"…","\\textellipsis");Y(ae,be,d3,"…","\\mathellipsis");Y(Ot,be,d3,"…","\\ldots",!0);Y(ae,be,d3,"…","\\ldots",!0);Y(ae,be,d3,"⋯","\\@cdots",!0);Y(ae,be,d3,"⋱","\\ddots",!0);Y(ae,be,et,"⋮","\\varvdots");Y(Ot,be,et,"⋮","\\varvdots");Y(ae,be,ds,"ˊ","\\acute");Y(ae,be,ds,"ˋ","\\grave");Y(ae,be,ds,"¨","\\ddot");Y(ae,be,ds,"~","\\tilde");Y(ae,be,ds,"ˉ","\\bar");Y(ae,be,ds,"˘","\\breve");Y(ae,be,ds,"ˇ","\\check");Y(ae,be,ds,"^","\\hat");Y(ae,be,ds,"⃗","\\vec");Y(ae,be,ds,"˙","\\dot");Y(ae,be,ds,"˚","\\mathring");Y(ae,be,zr,"","\\@imath");Y(ae,be,zr,"","\\@jmath");Y(ae,be,et,"ı","ı");Y(ae,be,et,"ȷ","ȷ");Y(Ot,be,et,"ı","\\i",!0);Y(Ot,be,et,"ȷ","\\j",!0);Y(Ot,be,et,"ß","\\ss",!0);Y(Ot,be,et,"æ","\\ae",!0);Y(Ot,be,et,"œ","\\oe",!0);Y(Ot,be,et,"ø","\\o",!0);Y(Ot,be,et,"Æ","\\AE",!0);Y(Ot,be,et,"Œ","\\OE",!0);Y(Ot,be,et,"Ø","\\O",!0);Y(Ot,be,ds,"ˊ","\\'");Y(Ot,be,ds,"ˋ","\\`");Y(Ot,be,ds,"ˆ","\\^");Y(Ot,be,ds,"˜","\\~");Y(Ot,be,ds,"ˉ","\\=");Y(Ot,be,ds,"˘","\\u");Y(Ot,be,ds,"˙","\\.");Y(Ot,be,ds,"¸","\\c");Y(Ot,be,ds,"˚","\\r");Y(Ot,be,ds,"ˇ","\\v");Y(Ot,be,ds,"¨",'\\"');Y(Ot,be,ds,"˝","\\H");Y(Ot,be,ds,"◯","\\textcircled");var XAe={"--":!0,"---":!0,"``":!0,"''":!0};Y(Ot,be,et,"–","--",!0);Y(Ot,be,et,"–","\\textendash");Y(Ot,be,et,"—","---",!0);Y(Ot,be,et,"—","\\textemdash");Y(Ot,be,et,"‘","`",!0);Y(Ot,be,et,"‘","\\textquoteleft");Y(Ot,be,et,"’","'",!0);Y(Ot,be,et,"’","\\textquoteright");Y(Ot,be,et,"“","``",!0);Y(Ot,be,et,"“","\\textquotedblleft");Y(Ot,be,et,"”","''",!0);Y(Ot,be,et,"”","\\textquotedblright");Y(ae,be,et,"°","\\degree",!0);Y(Ot,be,et,"°","\\degree");Y(Ot,be,et,"°","\\textdegree",!0);Y(ae,be,et,"£","\\pounds");Y(ae,be,et,"£","\\mathsterling",!0);Y(Ot,be,et,"£","\\pounds");Y(Ot,be,et,"£","\\textsterling",!0);Y(ae,Ge,et,"✠","\\maltese");Y(Ot,Ge,et,"✠","\\maltese");var _he='0123456789/@."';for(var bB=0;bB<_he.length;bB++){var Lhe=_he.charAt(bB);Y(ae,be,et,Lhe,Lhe)}var Ihe='0123456789!@*()-=+";:?/.,';for(var xB=0;xB0)return ju(s,u,i,r,a.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=DPt(s,i,r,a,n);d=p.fontName,f=[p.fontClass]}else o?(d=QAe[l].fontName,f=[l]):(d=s8(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(kD(s,d,i).metrics)return ju(s,d,i,r,a.concat(f));if(XAe.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m{if(vg(t.classes)!==vg(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},$Pt=t=>{for(var e=0;er&&(r=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Zl=function(e,r,n,i){var s=new l7(e,r,n,i);return RQ(s),s},KAe=(t,e,r,n)=>new l7(t,e,r,n),BPt=function(e,r,n){var i=Zl([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},FPt=function(e,r,n,i){var s=new MQ(e,r,n,i);return RQ(s),s},ZAe=function(e){var r=new o7(e);return RQ(r),r},zPt=function(e,r){return e instanceof o7?Zl([],[e],r):e},VPt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,a=1;a{var r=Zl(["mspace"],[],e),n=bs(t,e);return r.style.marginRight=Xt(n),r},s8=function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return r==="textbf"&&n==="textit"?s="BoldItalic":r==="textbf"?s="Bold":r==="textit"?s="Italic":s="Regular",i+"-"+s},QAe={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},JAe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},WPt=function(e,r){var[n,i,s]=JAe[e],a=new bg(n),o=new g0([a],{width:Xt(i),height:Xt(s),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=KAe(["overlay"],[o],r);return l.height=s,l.style.height=Xt(s),l.style.width=Xt(i),l},at={fontMap:QAe,makeSymbol:ju,mathsym:NPt,makeSpan:Zl,makeSvgSpan:KAe,makeLineSpan:BPt,makeAnchor:FPt,makeFragment:ZAe,wrapFragment:zPt,makeVList:HPt,makeOrd:OPt,makeGlue:GPt,staticSvg:WPt,svgData:JAe,tryCombineChars:$Pt},ys={number:3,unit:"mu"},Am={number:4,unit:"mu"},uf={number:5,unit:"mu"},qPt={mord:{mop:ys,mbin:Am,mrel:uf,minner:ys},mop:{mord:ys,mop:ys,mrel:uf,minner:ys},mbin:{mord:Am,mop:Am,mopen:Am,minner:Am},mrel:{mord:uf,mop:uf,mopen:uf,minner:uf},mopen:{},mclose:{mop:ys,mbin:Am,mrel:uf,minner:ys},mpunct:{mord:ys,mop:ys,mrel:uf,mopen:ys,mclose:ys,mpunct:ys,minner:ys},minner:{mord:ys,mop:ys,mbin:Am,mrel:uf,mopen:ys,mpunct:ys,minner:ys}},UPt={mord:{mop:ys},mop:{mord:ys,mop:ys},mbin:{},mrel:{},mopen:{},mclose:{mop:ys},mpunct:{},minner:{mop:ys}},e8e={},nL={},iL={};function ir(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&Pr.contains(jPt,v)?m.classes[0]="mord":v==="mbin"&&Pr.contains(YPt,y)&&(g.classes[0]="mord")},{node:d},f,p),Ohe(s,(g,m)=>{var y=TW(m),v=TW(g),x=y&&v?g.hasClass("mtight")?UPt[y][v]:qPt[y][v]:null;if(x)return at.makeGlue(x,u)},{node:d},f,p),s},Ohe=function t(e,r,n,i,s){i&&e.push(i);for(var a=0;af=>{e.splice(d+1,0,f),a++})(a)}i&&e.pop()},t8e=function(e){return e instanceof o7||e instanceof MQ||e instanceof l7&&e.hasClass("enclosing")?e:null},ZPt=function t(e,r){var n=t8e(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},TW=function(e,r){return e?(r&&(e=ZPt(e,r)),KPt[e.classes[0]]||null):null},D6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return m0(r.concat(n))},Xn=function(e,r,n){if(!e)return m0();if(nL[e.type]){var i=nL[e.type](e,r);if(n&&r.size!==n.size){i=m0(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Ut("Got group of unknown type: '"+e.type+"'")};function a8(t,e){var r=m0(["base"],t,e),n=m0(["strut"]);return n.style.height=Xt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Xt(-r.depth)),r.children.unshift(n),r}function CW(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Ra(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(a8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(a8(a,e));var u;r?(u=a8(Ra(r,e,!0)),u.classes=["tag"],s.push(u)):i&&s.push(i);var h=m0(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Xt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Xt(-h.depth))}return h}function r8e(t){return new o7(t)}let Lc=class{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=vg(this.classes));for(var n=0;n0&&(e+=' class ="'+Pr.escape(vg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},fd=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Pr.escape(this.toText())}toText(){return this.text}},QPt=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Xt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}};var Ht={MathNode:Lc,TextNode:fd,SpaceNode:QPt,newDocumentFragment:r8e},Mu=function(e,r,n){return Vi[r][e]&&Vi[r][e].replace&&e.charCodeAt(0)!==55349&&!(XAe.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Vi[r][e].replace),new Ht.TextNode(e)},_Q=function(e){return e.length===1?e[0]:new Ht.MathNode("mrow",e)},LQ=function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(Pr.contains(["\\imath","\\jmath"],s))return null;Vi[i][s]&&Vi[i][s].replace&&(s=Vi[i][s].replace);var a=at.fontMap[n].fontName;return AQ(s,a,i)?at.fontMap[n].variant:null};function CB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof fd&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof fd&&r.text===","}else return!1}var yc=function(e,r,n){if(e.length===1){var i=Ai(e[0],r);return n&&i instanceof Lc&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||CB(a))){var u=l.children[0];u instanceof Lc&&u.type==="mn"&&(u.children=[...a.children,...u.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof fd&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof fd&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},xg=function(e,r,n){return _Q(yc(e,r,n))},Ai=function(e,r){if(!e)return new Ht.MathNode("mrow");if(iL[e.type]){var n=iL[e.type](e,r);return n}else throw new Ut("Got group of unknown type: '"+e.type+"'")};function Phe(t,e,r,n,i){var s=yc(t,r),a;s.length===1&&s[0]instanceof Lc&&Pr.contains(["mrow","mtable"],s[0].type)?a=s[0]:a=new Ht.MathNode("mrow",s);var o=new Ht.MathNode("annotation",[new Ht.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new Ht.MathNode("semantics",[a,o]),u=new Ht.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return at.makeSpan([h],[u])}var n8e=function(e){return new WAe({style:e.displayMode?Hr.DISPLAY:Hr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},i8e=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=at.makeSpan(n,[e])}return e},JPt=function(e,r,n){var i=n8e(n),s;if(n.output==="mathml")return Phe(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=CW(e,i);s=at.makeSpan(["katex"],[a])}else{var o=Phe(e,r,i,n.displayMode,!1),l=CW(e,i);s=at.makeSpan(["katex"],[o,l])}return i8e(s,n)},e$t=function(e,r,n){var i=n8e(n),s=CW(e,i),a=at.makeSpan(["katex"],[s]);return i8e(a,n)},t$t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},r$t=function(e){var r=new Ht.MathNode("mo",[new Ht.TextNode(t$t[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},n$t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},i$t=function(e){return e.type==="ordgroup"?e.body.length:1},s$t=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Pr.contains(["widehat","widecheck","widetilde","utilde"],l)){var u=e,h=i$t(u.base),d,f,p;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,p=.42,f=l+"4"):(d=312,o=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=l+g):(o=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],f="tilde"+g)}var m=new bg(f),y=new g0([m],{width:"100%",height:Xt(p),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:at.makeSvgSpan([],[y],r),minWidth:0,height:p}}else{var v=[],x=n$t[l],[b,T,C]=x,S=C/1e3,k=b.length,E,A;if(k===1){var R=x[3];E=["hide-tail"],A=[R]}else if(k===2)E=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(k===3)E=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+k+" children.");for(var _=0;_0&&(i.style.minWidth=Xt(s)),i},a$t=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=at.makeSpan(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new xW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new xW({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new g0(u,{width:"100%",height:Xt(o)});a=at.makeSvgSpan([],[h],s)}return a.height=o,a.style.height=Xt(o),a},y0={encloseSpan:a$t,mathMLnode:r$t,svgSpan:s$t};function vn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function IQ(t){var e=SD(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function SD(t){return t&&(t.type==="atom"||LPt.hasOwnProperty(t.type))?t:null}var NQ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=vn(t.base,"accent"),r=n.base,t.base=r,i=RPt(Xn(t,e)),t.base=n):(n=vn(t,"accent"),r=n.base);var s=Xn(r,e.havingCrampedStyle()),a=n.isShifty&&Pr.isCharacterBox(r),o=0;if(a){var l=Pr.getBaseElem(r),u=Xn(l,e.havingCrampedStyle());o=Rhe(u).skew}var h=n.label==="\\c",d=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=y0.svgSpan(n,e),f=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=at.staticSvg("vec",e),g=at.svgData.vec[1]):(p=at.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=Rhe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=at.makeSpan(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var y=o;m||(y-=g/2),f.style.left=Xt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]},e)}var v=at.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},s8e=(t,e)=>{var r=t.isStretchy?y0.mathMLnode(t.label):new Ht.MathNode("mo",[Mu(t.label,t.mode)]),n=new Ht.MathNode("mover",[Ai(t.base,e),r]);return n.setAttribute("accent","true"),n},o$t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ir({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=sL(e[0]),n=!o$t.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:NQ,mathmlBuilder:s8e});ir({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:NQ,mathmlBuilder:s8e});ir({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=Xn(t.base,e),n=y0.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,s=at.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return at.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=y0.mathMLnode(t.label),n=new Ht.MathNode("munder",[Ai(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var o8=t=>{var e=new Ht.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ir({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=at.wrapFragment(Xn(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(n=e.havingStyle(r.sub()),a=at.wrapFragment(Xn(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=y0.svgSpan(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(a){var d=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l},{type:"elem",elem:a,shift:d}]},e)}else h=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),at.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=y0.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=o8(Ai(t.body,e));if(t.below){var s=o8(Ai(t.below,e));n=new Ht.MathNode("munderover",[r,s,i])}else n=new Ht.MathNode("mover",[r,i])}else if(t.below){var a=o8(Ai(t.below,e));n=new Ht.MathNode("munder",[r,a])}else n=o8(),n=new Ht.MathNode("mover",[r,n]);return n}});var l$t=at.makeSpan;function a8e(t,e){var r=Ra(t.body,e,!0);return l$t([t.mclass],r,e)}function o8e(t,e){var r,n=yc(t.body,e);return t.mclass==="minner"?r=new Ht.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Ht.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Ht.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}ir({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:js(i),isCharacterBox:Pr.isCharacterBox(i)}},htmlBuilder:a8e,mathmlBuilder:o8e});var ED=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};ir({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:ED(e[0]),body:js(e[1]),isCharacterBox:Pr.isCharacterBox(e[1])}}});ir({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],s=e[0],a;n!=="\\stackrel"?a=ED(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:js(i)},l={type:"supsub",mode:s.mode,base:o,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:r.mode,mclass:a,body:[l],isCharacterBox:Pr.isCharacterBox(l)}},htmlBuilder:a8e,mathmlBuilder:o8e});ir({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:ED(e[0]),body:js(e[0])}},htmlBuilder(t,e){var r=Ra(t.body,e,!0),n=at.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=yc(t.body,e),n=new Ht.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var c$t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},$he=()=>({type:"styling",body:[],mode:"math",style:"display"}),Bhe=t=>t.type==="textord"&&t.text==="@",u$t=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function h$t(t,e,r){var n=c$t[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},a=r.callFunction("\\Big",[s],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function d$t(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Ut("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;s-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',a[l]);var g=h$t(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=$he()}s%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ir({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=at.wrapFragment(Xn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Xt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Ht.MathNode("mrow",[Ai(t.label,e)]);return r=new Ht.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ht.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});ir({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=at.wrapFragment(Xn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Ht.MathNode("mrow",[Ai(t.fragment,e)])}});ir({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=vn(e[0],"ordgroup"),i=n.body,s="",a=0;a=1114111)throw new Ut("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var l8e=(t,e)=>{var r=Ra(t.body,e.withColor(t.color),!1);return at.makeFragment(r)},c8e=(t,e)=>{var r=yc(t.body,e.withColor(t.color)),n=new Ht.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n};ir({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=vn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:js(i)}},htmlBuilder:l8e,mathmlBuilder:c8e});ir({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=vn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}},htmlBuilder:l8e,mathmlBuilder:c8e});ir({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&vn(i,"size").value}},htmlBuilder(t,e){var r=at.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Xt(bs(t.size,e)))),r},mathmlBuilder(t,e){var r=new Ht.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Xt(bs(t.size,e)))),r}});var kW={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},u8e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Ut("Expected a control sequence",t);return e},f$t=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},h8e=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};ir({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(kW[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=kW[n.text]),vn(e.parseFunction(),"internal");throw new Ut("Invalid token after macro prefix",n)}});ir({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Ut("Expected a control sequence",n);for(var s=0,a,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Ut('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Ut('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if(n.text==="EOF")throw new Ut("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===kW[r]),{type:"internal",mode:e.mode}}});ir({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=u8e(e.gullet.popToken());e.gullet.consumeSpaces();var i=f$t(e);return h8e(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});ir({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=u8e(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return h8e(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ek=function(e,r,n){var i=Vi.math[e]&&Vi.math[e].replace,s=AQ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},DQ=function(e,r,n,i){var s=n.havingBaseStyle(r),a=at.makeSpan(i.concat(s.sizingClasses(n)),[e],n),o=s.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},d8e=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xt(s),e.height-=s,e.depth+=s},p$t=function(e,r,n,i,s,a){var o=at.makeSymbol(e,"Main-Regular",s,i),l=DQ(o,r,i,a);return n&&d8e(l,i,r),l},g$t=function(e,r,n,i){return at.makeSymbol(e,"Size"+r+"-Regular",n,i)},f8e=function(e,r,n,i,s,a){var o=g$t(e,r,s,i),l=DQ(at.makeSpan(["delimsizing","size"+r],[o],i),Hr.TEXT,i,a);return n&&d8e(l,i,Hr.TEXT),l},kB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=at.makeSpan(["delimsizinginner",i],[at.makeSpan([],[at.makeSymbol(e,r,n)])]);return{type:"elem",elem:s}},SB=function(e,r,n){var i=dd["Size4-Regular"][e.charCodeAt(0)]?dd["Size4-Regular"][e.charCodeAt(0)][4]:dd["Size1-Regular"][e.charCodeAt(0)][4],s=new bg("inner",xPt(e,Math.round(1e3*r))),a=new g0([s],{width:Xt(i),height:Xt(r),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=at.makeSvgSpan([],[a],n);return o.height=r,o.style.height=Xt(r),o.style.width=Xt(i),{type:"elem",elem:o}},SW=.008,l8={type:"kern",size:-1*SW},m$t=["|","\\lvert","\\rvert","\\vert"],y$t=["\\|","\\lVert","\\rVert","\\Vert"],p8e=function(e,r,n,i,s,a){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):Pr.contains(m$t,e)?(u="∣",d="vert",f=333):Pr.contains(y$t,e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=ek(o,p,s),m=g.height+g.depth,y=ek(u,p,s),v=y.height+y.depth,x=ek(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=ek(l,p,s);T=S.height+S.depth,C=2}var k=m+b+T,E=Math.max(0,Math.ceil((r-k)/(C*v))),A=k+E*C*v,R=i.fontMetrics().axisHeight;n&&(R*=i.sizeMultiplier);var _=A/2-R,P=[];if(d.length>0){var N=A-m-b,L=Math.round(A*1e3),I=wPt(d,Math.round(N*1e3)),$=new bg(d,I),O=(f/1e3).toFixed(3)+"em",D=(L/1e3).toFixed(3)+"em",F=new g0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=at.makeSvgSpan([],[F],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(kB(h,p,s)),P.push(l8),l===null){var V=A-m-b+2*SW;P.push(SB(u,V,i))}else{var B=(A-m-b-T)/2+2*SW;P.push(SB(u,B,i)),P.push(l8),P.push(kB(l,p,s)),P.push(l8),P.push(SB(u,B,i))}P.push(l8),P.push(kB(o,p,s))}var H=i.havingBaseStyle(Hr.TEXT),G=at.makeVList({positionType:"bottom",positionData:_,children:P},H);return DQ(at.makeSpan(["delimsizing","mult"],[G],H),Hr.TEXT,i,a)},EB=80,AB=.08,MB=function(e,r,n,i,s){var a=bPt(e,i,n),o=new bg(e,a),l=new g0([o],{width:"400em",height:Xt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return at.makeSvgSpan(["hide-tail"],[l],s)},v$t=function(e,r){var n=r.havingBaseSizing(),i=v8e("\\surd",e*n.sizeMultiplier,y8e,n),s=n.sizeMultiplier,a=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l=0,u=0,h=0,d;return i.type==="small"?(h=1e3+1e3*a+EB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+AB)/s,u=(1+a)/s,o=MB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+EB)*iS[i.size],u=(iS[i.size]+a)/s,l=(iS[i.size]+a+AB)/s,o=MB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+AB,u=e+a,h=Math.floor(1e3*e+a)+EB,o=MB("sqrtTall",l,h,a,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Xt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+a)*s}},g8e=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],b$t=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],m8e=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],iS=[0,1.2,1.8,2.4,3],x$t=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Pr.contains(g8e,e)||Pr.contains(m8e,e))return f8e(e,r,!1,n,i,s);if(Pr.contains(b$t,e))return p8e(e,iS[r],!1,n,i,s);throw new Ut("Illegal delimiter: '"+e+"'")},w$t=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],T$t=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"stack"}],y8e=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],C$t=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},v8e=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),a=s;ar)return n[a]}return n[n.length-1]},b8e=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Pr.contains(m8e,e)?o=w$t:Pr.contains(g8e,e)?o=y8e:o=T$t;var l=v8e(e,r,o,i);return l.type==="small"?p$t(e,l.style,n,i,s,a):l.type==="large"?f8e(e,l.size,n,i,s,a):p8e(e,r,n,i,s,a)},k$t=function(e,r,n,i,s,a){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return b8e(e,d,!0,i,s,a)},t0={sqrtImage:v$t,sizedDelim:x$t,sizeToMaxHeight:iS,customSizedDelim:b8e,leftRightDelim:k$t},Fhe={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},S$t=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function AD(t,e){var r=SD(t);if(r&&Pr.contains(S$t,r.text))return r;throw r?new Ut("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Ut("Invalid delimiter type '"+t.type+"'",t)}ir({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=AD(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Fhe[t.funcName].size,mclass:Fhe[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?at.makeSpan([t.mclass]):t0.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Mu(t.delim,t.mode));var r=new Ht.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Xt(t0.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function zhe(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ir({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Ut("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:AD(e[0],t).text,color:r}}});ir({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=AD(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=vn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{zhe(t);for(var r=Ra(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{zhe(t);var r=yc(t.body,e);if(t.left!=="."){var n=new Ht.MathNode("mo",[Mu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Ht.MathNode("mo",[Mu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return _Q(r)}});ir({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=AD(e[0],t);if(!t.parser.leftrightDepth)throw new Ut("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;if(t.delim===".")r=D6(e,[]);else{r=t0.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Mu("|","text"):Mu(t.delim,t.mode),n=new Ht.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var OQ=(t,e)=>{var r=at.wrapFragment(Xn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,a=0,o=Pr.isCharacterBox(t.body);if(n==="sout")s=at.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=bs({number:.6,unit:"pt"},e),u=bs({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Xt(d/2+l);var f=Math.floor(1e3*d*i),p=yPt(f),g=new g0([new bg("phase",p)],{width:"400em",height:Xt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=at.makeSvgSpan(["hide-tail"],[g],e),s.style.height=Xt(d),a=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m=0,y=0,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),s=y0.encloseSpan(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Xt(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Xt(v),s.style.borderRightWidth=Xt(v)),a=r.depth+y,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:r,shift:0}]},e);else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:b}]},e)}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?at.makeSpan(["mord","cancel-lap"],[x],e):at.makeSpan(["mord"],[x],e)},PQ=(t,e)=>{var r=0,n=new Ht.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Ai(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};ir({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=vn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:OQ,mathmlBuilder:PQ});ir({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=vn(e[0],"color-token").color,a=vn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,borderColor:s,body:o}},htmlBuilder:OQ,mathmlBuilder:PQ});ir({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});ir({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:OQ,mathmlBuilder:PQ});ir({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var x8e={};function Gd(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Ut("{"+t.envName+"} can be used only in display mode.")};function $Q(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function Zg(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)a=1;else if(a=parseFloat(p),!a||a<0)throw new Ut("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new Cd("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(Vhe(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),C={type:"ordgroup",mode:t.mode,body:C},r&&(C={type:"styling",mode:t.mode,style:r,body:[C]}),g.push(C);var S=t.fetch().text;if(S==="&"){if(d&&g.length===d){if(u||o)throw new Ut("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){T(),g.length===1&&C.type==="styling"&&C.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:ce[he]})}for(T(a[0]),n=0;n0&&(_+=x,k<_&&(k=_),_=0)),e.addJot&&(k+=m),E.height=S,E.depth=k,b+=S,E.pos=b,b+=k+_,l[n]=E,T(a[n+1])}var P=b/2+r.fontMetrics().axisHeight,N=e.cols||[],L=[],I,$,O=[];if(e.tags&&e.tags.some(ce=>ce))for(n=0;n=o)){var q=void 0;(i>0||e.hskipBeforeAndAfter)&&(q=Pr.deflt(B.pregap,f),q!==0&&(I=at.makeSpan(["arraycolsep"],[]),I.style.width=Xt(q),L.push(I)));var oe=[];for(n=0;n0){for(var ie=at.makeLineSpan("hline",r,h),me=at.makeLineSpan("hdashline",r,h),te=[{type:"elem",elem:l,shift:0}];u.length>0;){var _e=u.pop(),$e=_e.pos-P;_e.isDashed?te.push({type:"elem",elem:me,shift:$e}):te.push({type:"elem",elem:ie,shift:$e})}l=at.makeVList({positionType:"individualShift",children:te},r)}if(O.length===0)return at.makeSpan(["mord"],[l],r);var Fe=at.makeVList({positionType:"individualShift",children:O},r);return Fe=at.makeSpan(["tag"],[Fe],r),at.makeFragment([l,Fe])},E$t={c:"center ",l:"left ",r:"right "},qd=function(e,r){for(var n=[],i=new Ht.MathNode("mtd",[],["mtr-glue"]),s=new Ht.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var A=1;A-1?"alignat":"align",s=e.envName==="split",a=Zg(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:$Q(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),o,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",d=0;d0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return a.colSeparationType=p?"align":"alignat",a};Gd({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=SD(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=IQ(a),l=o.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ut("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Zg(t.parser,s,BQ(t.envName))},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new Ut("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=Zg(t.parser,n,BQ(t.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Zg(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=SD(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=IQ(a),l=o.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new Ut("Unknown column alignment: "+l,a)});if(i.length>1)throw new Ut("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Zg(t.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new Ut("{subarray} can contain only one column");return s},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Zg(t.parser,e,BQ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:T8e,htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Pr.contains(["gather","gather*"],t.envName)&&MD(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:$Q(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Zg(t.parser,e,"display")},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:T8e,htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){MD(t);var e={autoTag:$Q(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Zg(t.parser,e,"display")},htmlBuilder:Wd,mathmlBuilder:qd});Gd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return MD(t),d$t(t.parser)},htmlBuilder:Wd,mathmlBuilder:qd});ke("\\nonumber","\\gdef\\@eqnsw{0}");ke("\\notag","\\nonumber");ir({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Ut(t.funcName+" valid only within array environment")}});var Hhe=x8e;ir({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Ut("Invalid environment name",i);for(var s="",a=0;a{var r=t.font,n=e.withFont(r);return Xn(t.body,n)},k8e=(t,e)=>{var r=t.font,n=e.withFont(r);return Ai(t.body,n)},Ghe={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ir({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=sL(e[0]),s=n;return s in Ghe&&(s=Ghe[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:C8e,mathmlBuilder:k8e});ir({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0],i=Pr.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:ED(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});ir({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:s}=r,a=r.parseExpression(!0,i),o="math"+n.slice(1);return{type:"font",mode:s,font:o,body:{type:"ordgroup",mode:r.mode,body:a}}},htmlBuilder:C8e,mathmlBuilder:k8e});var S8e=(t,e)=>{var r=e;return t==="display"?r=r.id>=Hr.SCRIPT.id?r.text():Hr.DISPLAY:t==="text"&&r.size===Hr.DISPLAY.size?r=Hr.TEXT:t==="script"?r=Hr.SCRIPT:t==="scriptscript"&&(r=Hr.SCRIPTSCRIPT),r},FQ=(t,e)=>{var r=S8e(t.size,e.style),n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=Xn(t.numer,s,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-a.depth-(x+.5*d){var r=new Ht.MathNode("mfrac",[Ai(t.numer,e),Ai(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=bs(t.barSize,e);r.setAttribute("linethickness",Xt(n))}var i=S8e(t.size,e.style);if(i.size!==e.style.size){r=new Ht.MathNode("mstyle",[r]);var s=i.size===Hr.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",s),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var o=new Ht.MathNode("mo",[new Ht.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),a.push(o)}if(a.push(r),t.rightDelim!=null){var l=new Ht.MathNode("mo",[new Ht.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return _Q(a)}return r};ir({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1],a,o=null,l=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:l,size:u,barSize:null}},htmlBuilder:FQ,mathmlBuilder:zQ});ir({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});ir({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Whe=["display","text","script","scriptscript"],qhe=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};ir({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],s=sL(e[0]),a=s.type==="atom"&&s.family==="open"?qhe(s.text):null,o=sL(e[1]),l=o.type==="atom"&&o.family==="close"?qhe(o.text):null,u=vn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=vn(p.body[0],"textord");f=Whe[Number(g.text)]}}else p=vn(p,"textord"),f=Whe[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:a,rightDelim:l,size:f}},htmlBuilder:FQ,mathmlBuilder:zQ});ir({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:vn(e[0],"size").value,token:i}}});ir({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=rPt(vn(e[1],"infix").size),a=e[2],o=s.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:o,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:FQ,mathmlBuilder:zQ});var E8e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Xn(t.sup,e.havingStyle(r.sup()),e):Xn(t.sub,e.havingStyle(r.sub()),e),i=vn(t.base,"horizBrace")):i=vn(t,"horizBrace");var s=Xn(i.base,e.havingBaseStyle(Hr.DISPLAY)),a=y0.svgSpan(i,e),o;if(i.isOver?(o=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=at.makeVList({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=at.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e);i.isOver?o=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):o=at.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return at.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e)},A$t=(t,e)=>{var r=y0.mathMLnode(t.label);return new Ht.MathNode(t.isOver?"mover":"munder",[Ai(t.base,e),r])};ir({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:E8e,mathmlBuilder:A$t});ir({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=vn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:js(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Ra(t.body,e,!1);return at.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=xg(t.body,e);return r instanceof Lc||(r=new Lc("mrow",[r])),r.setAttribute("href",t.href),r}});ir({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=vn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:r,funcName:n,token:i}=t,s=vn(e[0],"raw").string,a=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=s,o={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,o={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,o={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),h=0;h{var r=Ra(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=at.makeSpan(n,r,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>xg(t.body,e)});ir({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:js(e[0]),mathml:js(e[1])}},htmlBuilder:(t,e)=>{var r=Ra(t.html,e,!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>xg(t.mathml,e)});var RB=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Ut("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!qAe(n))throw new Ut("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ir({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(r[0])for(var l=vn(r[0],"raw").string,u=l.split(","),h=0;h{var r=bs(t.height,e),n=0;t.totalheight.number>0&&(n=bs(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=bs(t.width,e));var s={height:Xt(r+n)};i>0&&(s.width=Xt(i)),n>0&&(s.verticalAlign=Xt(-n));var a=new APt(t.src,t.alt,s);return a.height=r,a.depth=n,a},mathmlBuilder:(t,e)=>{var r=new Ht.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=bs(t.height,e),i=0;if(t.totalheight.number>0&&(i=bs(t.totalheight,e)-n,r.setAttribute("valign",Xt(-i))),r.setAttribute("height",Xt(n+i)),t.width.number>0){var s=bs(t.width,e);r.setAttribute("width",Xt(s))}return r.setAttribute("src",t.src),r}});ir({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=vn(e[0],"size");if(r.settings.strict){var s=n[1]==="m",a=i.value.unit==="mu";s?(a||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):a&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return at.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=bs(t.dimension,e);return new Ht.SpaceNode(r)}});ir({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=at.makeSpan([],[Xn(t.body,e)]),r=at.makeSpan(["inner"],[r],e)):r=at.makeSpan(["inner"],[Xn(t.body,e)]);var n=at.makeSpan(["fix"],[]),i=at.makeSpan([t.alignment],[r,n],e),s=at.makeSpan(["strut"]);return s.style.height=Xt(i.height+i.depth),i.depth&&(s.style.verticalAlign=Xt(-i.depth)),i.children.unshift(s),i=at.makeSpan(["thinbox"],[i],e),at.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Ht.MathNode("mpadded",[Ai(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});ir({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var s=r==="\\("?"\\)":"$",a=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:a}}});ir({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Ut("Mismatched "+t.funcName)}});var Uhe=(t,e)=>{switch(e.style.size){case Hr.DISPLAY.size:return t.display;case Hr.TEXT.size:return t.text;case Hr.SCRIPT.size:return t.script;case Hr.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};ir({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:js(e[0]),text:js(e[1]),script:js(e[2]),scriptscript:js(e[3])}},htmlBuilder:(t,e)=>{var r=Uhe(t,e),n=Ra(r,e,!1);return at.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=Uhe(t,e);return xg(r,e)}});var A8e=(t,e,r,n,i,s,a)=>{t=at.makeSpan([],[t]);var o=r&&Pr.isCharacterBox(r),l,u;if(e){var h=Xn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Xn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+a;f=at.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var g=t.height-a;f=at.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},n)}else if(u){var m=t.depth+a;f=at.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var y=[f];if(l&&s!==0&&!o){var v=at.makeSpan(["mspace"],[],n);v.style.marginRight=Xt(s),y.unshift(v)}return at.makeSpan(["mop","op-limits"],y,n)},M8e=["\\smallint"],f3=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=vn(t.base,"op"),i=!0):s=vn(t,"op");var a=e.style,o=!1;a.size===Hr.DISPLAY.size&&s.symbol&&!Pr.contains(M8e,s.name)&&(o=!0);var l;if(s.symbol){var u=o?"Size2-Regular":"Size1-Regular",h="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(h=s.name.slice(1),s.name=h==="oiint"?"\\iint":"\\iiint"),l=at.makeSymbol(s.name,u,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,f=at.staticSvg(h+"Size"+(o?"2":"1"),e);l=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]},e),s.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var p=Ra(s.body,e,!0);p.length===1&&p[0]instanceof Au?(l=p[0],l.classes[0]="mop"):l=at.makeSpan(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Lc("mo",[Mu(t.name,t.mode)]),Pr.contains(M8e,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Lc("mo",yc(t.body,e));else{r=new Lc("mi",[new fd(t.name.slice(1))]);var n=new Lc("mo",[Mu("⁡","text")]);t.parentIsSupSub?r=new Lc("mrow",[r,n]):r=r8e([r,n])}return r},M$t={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ir({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=M$t[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:f3,mathmlBuilder:c7});ir({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:js(n)}},htmlBuilder:f3,mathmlBuilder:c7});var R$t={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ir({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:f3,mathmlBuilder:c7});ir({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:f3,mathmlBuilder:c7});ir({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=R$t[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:f3,mathmlBuilder:c7});var R8e=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=vn(t.base,"operatorname"),i=!0):s=vn(t,"operatorname");var a;if(s.body.length>0){for(var o=s.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Ra(o,e.withFont("mathrm"),!0),u=0;u{for(var r=yc(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Ht.TextNode(o)]}var l=new Ht.MathNode("mi",r);l.setAttribute("mathvariant","normal");var u=new Ht.MathNode("mo",[Mu("⁡","text")]);return t.parentIsSupSub?new Ht.MathNode("mrow",[l,u]):Ht.newDocumentFragment([l,u])};ir({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:js(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:R8e,mathmlBuilder:_$t});ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");ev({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?at.makeFragment(Ra(t.body,e,!1)):at.makeSpan(["mord"],Ra(t.body,e,!0),e)},mathmlBuilder(t,e){return xg(t.body,e,!0)}});ir({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=Xn(t.body,e.havingCrampedStyle()),n=at.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return at.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(t,e){var r=new Ht.MathNode("mo",[new Ht.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new Ht.MathNode("mover",[Ai(t.body,e),r]);return n.setAttribute("accent","true"),n}});ir({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:js(n)}},htmlBuilder:(t,e)=>{var r=Ra(t.body,e.withPhantom(),!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=yc(t.body,e);return new Ht.MathNode("mphantom",r)}});ir({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=at.makeSpan([],[Xn(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=yc(js(t.body),e),n=new Ht.MathNode("mphantom",r),i=new Ht.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});ir({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=at.makeSpan(["inner"],[Xn(t.body,e.withPhantom())]),n=at.makeSpan(["fix"],[]);return at.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=yc(js(t.body),e),n=new Ht.MathNode("mphantom",r),i=new Ht.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});ir({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=vn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Xn(t.body,e),n=bs(t.dy,e);return at.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new Ht.MathNode("mpadded",[Ai(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});ir({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});ir({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],s=vn(e[0],"size"),a=vn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&vn(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var r=at.makeSpan(["mord","rule"],[],e),n=bs(t.width,e),i=bs(t.height,e),s=t.shift?bs(t.shift,e):0;return r.style.borderRightWidth=Xt(n),r.style.borderTopWidth=Xt(i),r.style.bottom=Xt(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=bs(t.width,e),n=bs(t.height,e),i=t.shift?bs(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new Ht.MathNode("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Xt(r)),a.setAttribute("height",Xt(n));var o=new Ht.MathNode("mpadded",[a]);return i>=0?o.setAttribute("height",Xt(i)):(o.setAttribute("height",Xt(i)),o.setAttribute("depth",Xt(-i))),o.setAttribute("voffset",Xt(i)),o}});function _8e(t,e,r){for(var n=Ra(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return _8e(t.body,r,e)};ir({type:"sizing",names:Yhe,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:Yhe.indexOf(n)+1,body:s}},htmlBuilder:L$t,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=yc(t.body,r),i=new Ht.MathNode("mstyle",n);return i.setAttribute("mathsize",Xt(r.sizeMultiplier)),i}});ir({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,s=!1,a=r[0]&&vn(r[0],"ordgroup");if(a)for(var o="",l=0;l{var r=at.makeSpan([],[Xn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new Ht.MathNode("mpadded",[Ai(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});ir({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=Xn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=at.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idr.height+r.depth+a&&(a=(a+d-r.height-r.depth)/2);var f=l.height-r.height-a-u;r.style.paddingLeft=Xt(h);var p=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(t.index){var g=e.havingStyle(Hr.SCRIPTSCRIPT),m=Xn(t.index,g,e),y=.6*(p.height-p.depth),v=at.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]},e),x=at.makeSpan(["root"],[v]);return at.makeSpan(["mord","sqrt"],[x,p],e)}else return at.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Ht.MathNode("mroot",[Ai(r,e),Ai(n,e)]):new Ht.MathNode("msqrt",[Ai(r,e)])}});var jhe={display:Hr.DISPLAY,text:Hr.TEXT,script:Hr.SCRIPT,scriptscript:Hr.SCRIPTSCRIPT};ir({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!0,r),a=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=jhe[t.style],n=e.havingStyle(r).withFont("");return _8e(t.body,n,e)},mathmlBuilder(t,e){var r=jhe[t.style],n=e.havingStyle(r),i=yc(t.body,n),s=new Ht.MathNode("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var I$t=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Hr.DISPLAY.size||n.alwaysHandleSupSub);return i?f3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===Hr.DISPLAY.size||n.limits);return s?R8e:null}else{if(n.type==="accent")return Pr.isCharacterBox(n.base)?NQ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?E8e:null}else return null}else return null};ev({type:"supsub",htmlBuilder(t,e){var r=I$t(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=Xn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Pr.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());o=Xn(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=Xn(s,g,e),f||(d=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Hr.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Xt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof Au||b)&&(x=Xt(-a.italic))}var T;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var C=u.defaultRuleThickness,S=4*C;if(h-o.depth-(l.height-d)0&&(h+=k,d-=k)}var E=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];T=at.makeVList({positionType:"individualShift",children:E},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];T=at.makeVList({positionType:"shift",positionData:d,children:A},e)}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=at.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]},e);else throw new Error("supsub must have either sup or sub.");var R=TW(a,"right")||"mord";return at.makeSpan([R],[a,at.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Ai(t.base,e)];t.sub&&s.push(Ai(t.sub,e)),t.sup&&s.push(Ai(t.sup,e));var a;if(r)a=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Hr.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Hr.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Hr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Hr.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Hr.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Hr.DISPLAY)?a="mover":a="msup"}return new Ht.MathNode(a,s)}});ev({type:"atom",htmlBuilder(t,e){return at.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Ht.MathNode("mo",[Mu(t.text,t.mode)]);if(t.family==="bin"){var n=LQ(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var L8e={mi:"italic",mn:"normal",mtext:"normal"};ev({type:"mathord",htmlBuilder(t,e){return at.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new Ht.MathNode("mi",[Mu(t.text,t.mode,e)]),n=LQ(t,e)||"italic";return n!==L8e[r.type]&&r.setAttribute("mathvariant",n),r}});ev({type:"textord",htmlBuilder(t,e){return at.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=Mu(t.text,t.mode,e),n=LQ(t,e)||"normal",i;return t.mode==="text"?i=new Ht.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new Ht.MathNode("mn",[r]):t.text==="\\prime"?i=new Ht.MathNode("mo",[r]):i=new Ht.MathNode("mi",[r]),n!==L8e[i.type]&&i.setAttribute("mathvariant",n),i}});var _B={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},LB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ev({type:"spacing",htmlBuilder(t,e){if(LB.hasOwnProperty(t.text)){var r=LB[t.text].className||"";if(t.mode==="text"){var n=at.makeOrd(t,e,"textord");return n.classes.push(r),n}else return at.makeSpan(["mspace",r],[at.mathsym(t.text,t.mode,e)],e)}else{if(_B.hasOwnProperty(t.text))return at.makeSpan(["mspace",_B[t.text]],[],e);throw new Ut('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(LB.hasOwnProperty(t.text))r=new Ht.MathNode("mtext",[new Ht.TextNode(" ")]);else{if(_B.hasOwnProperty(t.text))return new Ht.MathNode("mspace");throw new Ut('Unknown type of space "'+t.text+'"')}return r}});var Xhe=()=>{var t=new Ht.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};ev({type:"tag",mathmlBuilder(t,e){var r=new Ht.MathNode("mtable",[new Ht.MathNode("mtr",[Xhe(),new Ht.MathNode("mtd",[xg(t.body,e)]),Xhe(),new Ht.MathNode("mtd",[xg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Khe={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Zhe={"\\textbf":"textbf","\\textmd":"textmd"},N$t={"\\textit":"textit","\\textup":"textup"},Qhe=(t,e)=>{var r=t.font;if(r){if(Khe[r])return e.withTextFontFamily(Khe[r]);if(Zhe[r])return e.withTextFontWeight(Zhe[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(N$t[r])};ir({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:js(i),font:n}},htmlBuilder(t,e){var r=Qhe(t,e),n=Ra(t.body,r,!0);return at.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Qhe(t,e);return xg(t.body,r)}});ir({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Xn(t.body,e),n=at.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=at.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return at.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(t,e){var r=new Ht.MathNode("mo",[new Ht.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new Ht.MathNode("munder",[Ai(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});ir({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Xn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return at.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new Ht.MathNode("mpadded",[Ai(t.body,e)],["vcenter"])}});ir({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Ut("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Jhe(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),Fp=e8e,I8e=`[ \r - ]`,D$t="\\\\[a-zA-Z@]+",O$t="\\\\[^\uD800-\uDFFF]",P$t="("+D$t+")"+I8e+"*",$$t=`\\\\( +-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.")}};let u7=class{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 Pr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText();return this.children.map(e).join("")}};var gd={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},i8={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Lhe={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function OPt(t,e){gd[t]=e}function LQ(t,e,r){if(!gd[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=gd[e][n];if(!i&&t[0]in Lhe&&(n=Lhe[t[0]].charCodeAt(0),i=gd[e][n]),!i&&r==="text"&&XAe(n)&&(i=gd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var wB={};function PPt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!wB[e]){var r=wB[e]={cssEmPerMu:i8.quad[e]/18};for(var n in i8)i8.hasOwnProperty(n)&&(r[n]=i8[n][e])}return wB[e]}var $Pt=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ihe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Nhe=function(e,r){return r.size<2?e:$Pt[e-1][r.size-1]};let KAe=class jm{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||jm.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Ihe[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new jm(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Nhe(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Ihe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Nhe(jm.BASESIZE,e);return this.size===r&&this.textSize===jm.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==jm.BASESIZE?["sizing","reset-size"+this.size,"size"+jm.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=PPt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};KAe.BASESIZE=6;var CW={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},BPt={ex:!0,em:!0,mu:!0},ZAe=function(e){return typeof e!="string"&&(e=e.unit),e in CW||e in BPt||e==="ex"},bs=function(e,r){var n;if(e.unit in CW)n=CW[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Ut("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Xt=function(e){return+e.toFixed(4)+"em"},wg=function(e){return e.filter(r=>r).join(" ")},QAe=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},JAe=function(e){var r=document.createElement(e);r.className=wg(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var s=0;s/=\x00-\x1f]/,e8e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Pr.escape(wg(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Pr.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+Pr.escape(n)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(FPt.test(s))throw new Ut("Invalid attribute name '"+s+"'");r+=" "+s+'="'+Pr.escape(this.attributes[s])+'"'}r+=">";for(var a=0;a",r};let h7=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,QAe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Pr.contains(this.classes,e)}toNode(){return JAe.call(this,"span")}toMarkup(){return e8e.call(this,"span")}},IQ=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,QAe.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Pr.contains(this.classes,e)}toNode(){return JAe.call(this,"a")}toMarkup(){return e8e.call(this,"a")}},zPt=class{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Pr.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=''+Pr.escape(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Xt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=wg(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Pr.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Pr.escape(n)+'"');var s=Pr.escape(this.text);return e?(r+=">",r+=s,r+="",r):s}},x0=class{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},kW=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var GPt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},WPt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Vi={math:{},text:{}};function Y(t,e,r,n,i,s){Vi[t][i]={font:e,group:r,replace:n},s&&n&&(Vi[t][n]=Vi[t][i])}var ae="math",Ot="text",be="main",Ge="ams",ds="accent-token",ur="bin",Bl="close",g3="inner",zr="mathord",fa="op-token",jc="open",ED="punct",Ue="rel",W0="spacing",et="textord";Y(ae,be,Ue,"≡","\\equiv",!0);Y(ae,be,Ue,"≺","\\prec",!0);Y(ae,be,Ue,"≻","\\succ",!0);Y(ae,be,Ue,"∼","\\sim",!0);Y(ae,be,Ue,"⊥","\\perp");Y(ae,be,Ue,"⪯","\\preceq",!0);Y(ae,be,Ue,"⪰","\\succeq",!0);Y(ae,be,Ue,"≃","\\simeq",!0);Y(ae,be,Ue,"∣","\\mid",!0);Y(ae,be,Ue,"≪","\\ll",!0);Y(ae,be,Ue,"≫","\\gg",!0);Y(ae,be,Ue,"≍","\\asymp",!0);Y(ae,be,Ue,"∥","\\parallel");Y(ae,be,Ue,"⋈","\\bowtie",!0);Y(ae,be,Ue,"⌣","\\smile",!0);Y(ae,be,Ue,"⊑","\\sqsubseteq",!0);Y(ae,be,Ue,"⊒","\\sqsupseteq",!0);Y(ae,be,Ue,"≐","\\doteq",!0);Y(ae,be,Ue,"⌢","\\frown",!0);Y(ae,be,Ue,"∋","\\ni",!0);Y(ae,be,Ue,"∝","\\propto",!0);Y(ae,be,Ue,"⊢","\\vdash",!0);Y(ae,be,Ue,"⊣","\\dashv",!0);Y(ae,be,Ue,"∋","\\owns");Y(ae,be,ED,".","\\ldotp");Y(ae,be,ED,"⋅","\\cdotp");Y(ae,be,et,"#","\\#");Y(Ot,be,et,"#","\\#");Y(ae,be,et,"&","\\&");Y(Ot,be,et,"&","\\&");Y(ae,be,et,"ℵ","\\aleph",!0);Y(ae,be,et,"∀","\\forall",!0);Y(ae,be,et,"ℏ","\\hbar",!0);Y(ae,be,et,"∃","\\exists",!0);Y(ae,be,et,"∇","\\nabla",!0);Y(ae,be,et,"♭","\\flat",!0);Y(ae,be,et,"ℓ","\\ell",!0);Y(ae,be,et,"♮","\\natural",!0);Y(ae,be,et,"♣","\\clubsuit",!0);Y(ae,be,et,"℘","\\wp",!0);Y(ae,be,et,"♯","\\sharp",!0);Y(ae,be,et,"♢","\\diamondsuit",!0);Y(ae,be,et,"ℜ","\\Re",!0);Y(ae,be,et,"♡","\\heartsuit",!0);Y(ae,be,et,"ℑ","\\Im",!0);Y(ae,be,et,"♠","\\spadesuit",!0);Y(ae,be,et,"§","\\S",!0);Y(Ot,be,et,"§","\\S");Y(ae,be,et,"¶","\\P",!0);Y(Ot,be,et,"¶","\\P");Y(ae,be,et,"†","\\dag");Y(Ot,be,et,"†","\\dag");Y(Ot,be,et,"†","\\textdagger");Y(ae,be,et,"‡","\\ddag");Y(Ot,be,et,"‡","\\ddag");Y(Ot,be,et,"‡","\\textdaggerdbl");Y(ae,be,Bl,"⎱","\\rmoustache",!0);Y(ae,be,jc,"⎰","\\lmoustache",!0);Y(ae,be,Bl,"⟯","\\rgroup",!0);Y(ae,be,jc,"⟮","\\lgroup",!0);Y(ae,be,ur,"∓","\\mp",!0);Y(ae,be,ur,"⊖","\\ominus",!0);Y(ae,be,ur,"⊎","\\uplus",!0);Y(ae,be,ur,"⊓","\\sqcap",!0);Y(ae,be,ur,"∗","\\ast");Y(ae,be,ur,"⊔","\\sqcup",!0);Y(ae,be,ur,"◯","\\bigcirc",!0);Y(ae,be,ur,"∙","\\bullet",!0);Y(ae,be,ur,"‡","\\ddagger");Y(ae,be,ur,"≀","\\wr",!0);Y(ae,be,ur,"⨿","\\amalg");Y(ae,be,ur,"&","\\And");Y(ae,be,Ue,"⟵","\\longleftarrow",!0);Y(ae,be,Ue,"⇐","\\Leftarrow",!0);Y(ae,be,Ue,"⟸","\\Longleftarrow",!0);Y(ae,be,Ue,"⟶","\\longrightarrow",!0);Y(ae,be,Ue,"⇒","\\Rightarrow",!0);Y(ae,be,Ue,"⟹","\\Longrightarrow",!0);Y(ae,be,Ue,"↔","\\leftrightarrow",!0);Y(ae,be,Ue,"⟷","\\longleftrightarrow",!0);Y(ae,be,Ue,"⇔","\\Leftrightarrow",!0);Y(ae,be,Ue,"⟺","\\Longleftrightarrow",!0);Y(ae,be,Ue,"↦","\\mapsto",!0);Y(ae,be,Ue,"⟼","\\longmapsto",!0);Y(ae,be,Ue,"↗","\\nearrow",!0);Y(ae,be,Ue,"↩","\\hookleftarrow",!0);Y(ae,be,Ue,"↪","\\hookrightarrow",!0);Y(ae,be,Ue,"↘","\\searrow",!0);Y(ae,be,Ue,"↼","\\leftharpoonup",!0);Y(ae,be,Ue,"⇀","\\rightharpoonup",!0);Y(ae,be,Ue,"↙","\\swarrow",!0);Y(ae,be,Ue,"↽","\\leftharpoondown",!0);Y(ae,be,Ue,"⇁","\\rightharpoondown",!0);Y(ae,be,Ue,"↖","\\nwarrow",!0);Y(ae,be,Ue,"⇌","\\rightleftharpoons",!0);Y(ae,Ge,Ue,"≮","\\nless",!0);Y(ae,Ge,Ue,"","\\@nleqslant");Y(ae,Ge,Ue,"","\\@nleqq");Y(ae,Ge,Ue,"⪇","\\lneq",!0);Y(ae,Ge,Ue,"≨","\\lneqq",!0);Y(ae,Ge,Ue,"","\\@lvertneqq");Y(ae,Ge,Ue,"⋦","\\lnsim",!0);Y(ae,Ge,Ue,"⪉","\\lnapprox",!0);Y(ae,Ge,Ue,"⊀","\\nprec",!0);Y(ae,Ge,Ue,"⋠","\\npreceq",!0);Y(ae,Ge,Ue,"⋨","\\precnsim",!0);Y(ae,Ge,Ue,"⪹","\\precnapprox",!0);Y(ae,Ge,Ue,"≁","\\nsim",!0);Y(ae,Ge,Ue,"","\\@nshortmid");Y(ae,Ge,Ue,"∤","\\nmid",!0);Y(ae,Ge,Ue,"⊬","\\nvdash",!0);Y(ae,Ge,Ue,"⊭","\\nvDash",!0);Y(ae,Ge,Ue,"⋪","\\ntriangleleft");Y(ae,Ge,Ue,"⋬","\\ntrianglelefteq",!0);Y(ae,Ge,Ue,"⊊","\\subsetneq",!0);Y(ae,Ge,Ue,"","\\@varsubsetneq");Y(ae,Ge,Ue,"⫋","\\subsetneqq",!0);Y(ae,Ge,Ue,"","\\@varsubsetneqq");Y(ae,Ge,Ue,"≯","\\ngtr",!0);Y(ae,Ge,Ue,"","\\@ngeqslant");Y(ae,Ge,Ue,"","\\@ngeqq");Y(ae,Ge,Ue,"⪈","\\gneq",!0);Y(ae,Ge,Ue,"≩","\\gneqq",!0);Y(ae,Ge,Ue,"","\\@gvertneqq");Y(ae,Ge,Ue,"⋧","\\gnsim",!0);Y(ae,Ge,Ue,"⪊","\\gnapprox",!0);Y(ae,Ge,Ue,"⊁","\\nsucc",!0);Y(ae,Ge,Ue,"⋡","\\nsucceq",!0);Y(ae,Ge,Ue,"⋩","\\succnsim",!0);Y(ae,Ge,Ue,"⪺","\\succnapprox",!0);Y(ae,Ge,Ue,"≆","\\ncong",!0);Y(ae,Ge,Ue,"","\\@nshortparallel");Y(ae,Ge,Ue,"∦","\\nparallel",!0);Y(ae,Ge,Ue,"⊯","\\nVDash",!0);Y(ae,Ge,Ue,"⋫","\\ntriangleright");Y(ae,Ge,Ue,"⋭","\\ntrianglerighteq",!0);Y(ae,Ge,Ue,"","\\@nsupseteqq");Y(ae,Ge,Ue,"⊋","\\supsetneq",!0);Y(ae,Ge,Ue,"","\\@varsupsetneq");Y(ae,Ge,Ue,"⫌","\\supsetneqq",!0);Y(ae,Ge,Ue,"","\\@varsupsetneqq");Y(ae,Ge,Ue,"⊮","\\nVdash",!0);Y(ae,Ge,Ue,"⪵","\\precneqq",!0);Y(ae,Ge,Ue,"⪶","\\succneqq",!0);Y(ae,Ge,Ue,"","\\@nsubseteqq");Y(ae,Ge,ur,"⊴","\\unlhd");Y(ae,Ge,ur,"⊵","\\unrhd");Y(ae,Ge,Ue,"↚","\\nleftarrow",!0);Y(ae,Ge,Ue,"↛","\\nrightarrow",!0);Y(ae,Ge,Ue,"⇍","\\nLeftarrow",!0);Y(ae,Ge,Ue,"⇏","\\nRightarrow",!0);Y(ae,Ge,Ue,"↮","\\nleftrightarrow",!0);Y(ae,Ge,Ue,"⇎","\\nLeftrightarrow",!0);Y(ae,Ge,Ue,"△","\\vartriangle");Y(ae,Ge,et,"ℏ","\\hslash");Y(ae,Ge,et,"▽","\\triangledown");Y(ae,Ge,et,"◊","\\lozenge");Y(ae,Ge,et,"Ⓢ","\\circledS");Y(ae,Ge,et,"®","\\circledR");Y(Ot,Ge,et,"®","\\circledR");Y(ae,Ge,et,"∡","\\measuredangle",!0);Y(ae,Ge,et,"∄","\\nexists");Y(ae,Ge,et,"℧","\\mho");Y(ae,Ge,et,"Ⅎ","\\Finv",!0);Y(ae,Ge,et,"⅁","\\Game",!0);Y(ae,Ge,et,"‵","\\backprime");Y(ae,Ge,et,"▲","\\blacktriangle");Y(ae,Ge,et,"▼","\\blacktriangledown");Y(ae,Ge,et,"■","\\blacksquare");Y(ae,Ge,et,"⧫","\\blacklozenge");Y(ae,Ge,et,"★","\\bigstar");Y(ae,Ge,et,"∢","\\sphericalangle",!0);Y(ae,Ge,et,"∁","\\complement",!0);Y(ae,Ge,et,"ð","\\eth",!0);Y(Ot,be,et,"ð","ð");Y(ae,Ge,et,"╱","\\diagup");Y(ae,Ge,et,"╲","\\diagdown");Y(ae,Ge,et,"□","\\square");Y(ae,Ge,et,"□","\\Box");Y(ae,Ge,et,"◊","\\Diamond");Y(ae,Ge,et,"¥","\\yen",!0);Y(Ot,Ge,et,"¥","\\yen",!0);Y(ae,Ge,et,"✓","\\checkmark",!0);Y(Ot,Ge,et,"✓","\\checkmark");Y(ae,Ge,et,"ℶ","\\beth",!0);Y(ae,Ge,et,"ℸ","\\daleth",!0);Y(ae,Ge,et,"ℷ","\\gimel",!0);Y(ae,Ge,et,"ϝ","\\digamma",!0);Y(ae,Ge,et,"ϰ","\\varkappa");Y(ae,Ge,jc,"┌","\\@ulcorner",!0);Y(ae,Ge,Bl,"┐","\\@urcorner",!0);Y(ae,Ge,jc,"└","\\@llcorner",!0);Y(ae,Ge,Bl,"┘","\\@lrcorner",!0);Y(ae,Ge,Ue,"≦","\\leqq",!0);Y(ae,Ge,Ue,"⩽","\\leqslant",!0);Y(ae,Ge,Ue,"⪕","\\eqslantless",!0);Y(ae,Ge,Ue,"≲","\\lesssim",!0);Y(ae,Ge,Ue,"⪅","\\lessapprox",!0);Y(ae,Ge,Ue,"≊","\\approxeq",!0);Y(ae,Ge,ur,"⋖","\\lessdot");Y(ae,Ge,Ue,"⋘","\\lll",!0);Y(ae,Ge,Ue,"≶","\\lessgtr",!0);Y(ae,Ge,Ue,"⋚","\\lesseqgtr",!0);Y(ae,Ge,Ue,"⪋","\\lesseqqgtr",!0);Y(ae,Ge,Ue,"≑","\\doteqdot");Y(ae,Ge,Ue,"≓","\\risingdotseq",!0);Y(ae,Ge,Ue,"≒","\\fallingdotseq",!0);Y(ae,Ge,Ue,"∽","\\backsim",!0);Y(ae,Ge,Ue,"⋍","\\backsimeq",!0);Y(ae,Ge,Ue,"⫅","\\subseteqq",!0);Y(ae,Ge,Ue,"⋐","\\Subset",!0);Y(ae,Ge,Ue,"⊏","\\sqsubset",!0);Y(ae,Ge,Ue,"≼","\\preccurlyeq",!0);Y(ae,Ge,Ue,"⋞","\\curlyeqprec",!0);Y(ae,Ge,Ue,"≾","\\precsim",!0);Y(ae,Ge,Ue,"⪷","\\precapprox",!0);Y(ae,Ge,Ue,"⊲","\\vartriangleleft");Y(ae,Ge,Ue,"⊴","\\trianglelefteq");Y(ae,Ge,Ue,"⊨","\\vDash",!0);Y(ae,Ge,Ue,"⊪","\\Vvdash",!0);Y(ae,Ge,Ue,"⌣","\\smallsmile");Y(ae,Ge,Ue,"⌢","\\smallfrown");Y(ae,Ge,Ue,"≏","\\bumpeq",!0);Y(ae,Ge,Ue,"≎","\\Bumpeq",!0);Y(ae,Ge,Ue,"≧","\\geqq",!0);Y(ae,Ge,Ue,"⩾","\\geqslant",!0);Y(ae,Ge,Ue,"⪖","\\eqslantgtr",!0);Y(ae,Ge,Ue,"≳","\\gtrsim",!0);Y(ae,Ge,Ue,"⪆","\\gtrapprox",!0);Y(ae,Ge,ur,"⋗","\\gtrdot");Y(ae,Ge,Ue,"⋙","\\ggg",!0);Y(ae,Ge,Ue,"≷","\\gtrless",!0);Y(ae,Ge,Ue,"⋛","\\gtreqless",!0);Y(ae,Ge,Ue,"⪌","\\gtreqqless",!0);Y(ae,Ge,Ue,"≖","\\eqcirc",!0);Y(ae,Ge,Ue,"≗","\\circeq",!0);Y(ae,Ge,Ue,"≜","\\triangleq",!0);Y(ae,Ge,Ue,"∼","\\thicksim");Y(ae,Ge,Ue,"≈","\\thickapprox");Y(ae,Ge,Ue,"⫆","\\supseteqq",!0);Y(ae,Ge,Ue,"⋑","\\Supset",!0);Y(ae,Ge,Ue,"⊐","\\sqsupset",!0);Y(ae,Ge,Ue,"≽","\\succcurlyeq",!0);Y(ae,Ge,Ue,"⋟","\\curlyeqsucc",!0);Y(ae,Ge,Ue,"≿","\\succsim",!0);Y(ae,Ge,Ue,"⪸","\\succapprox",!0);Y(ae,Ge,Ue,"⊳","\\vartriangleright");Y(ae,Ge,Ue,"⊵","\\trianglerighteq");Y(ae,Ge,Ue,"⊩","\\Vdash",!0);Y(ae,Ge,Ue,"∣","\\shortmid");Y(ae,Ge,Ue,"∥","\\shortparallel");Y(ae,Ge,Ue,"≬","\\between",!0);Y(ae,Ge,Ue,"⋔","\\pitchfork",!0);Y(ae,Ge,Ue,"∝","\\varpropto");Y(ae,Ge,Ue,"◀","\\blacktriangleleft");Y(ae,Ge,Ue,"∴","\\therefore",!0);Y(ae,Ge,Ue,"∍","\\backepsilon");Y(ae,Ge,Ue,"▶","\\blacktriangleright");Y(ae,Ge,Ue,"∵","\\because",!0);Y(ae,Ge,Ue,"⋘","\\llless");Y(ae,Ge,Ue,"⋙","\\gggtr");Y(ae,Ge,ur,"⊲","\\lhd");Y(ae,Ge,ur,"⊳","\\rhd");Y(ae,Ge,Ue,"≂","\\eqsim",!0);Y(ae,be,Ue,"⋈","\\Join");Y(ae,Ge,Ue,"≑","\\Doteq",!0);Y(ae,Ge,ur,"∔","\\dotplus",!0);Y(ae,Ge,ur,"∖","\\smallsetminus");Y(ae,Ge,ur,"⋒","\\Cap",!0);Y(ae,Ge,ur,"⋓","\\Cup",!0);Y(ae,Ge,ur,"⩞","\\doublebarwedge",!0);Y(ae,Ge,ur,"⊟","\\boxminus",!0);Y(ae,Ge,ur,"⊞","\\boxplus",!0);Y(ae,Ge,ur,"⋇","\\divideontimes",!0);Y(ae,Ge,ur,"⋉","\\ltimes",!0);Y(ae,Ge,ur,"⋊","\\rtimes",!0);Y(ae,Ge,ur,"⋋","\\leftthreetimes",!0);Y(ae,Ge,ur,"⋌","\\rightthreetimes",!0);Y(ae,Ge,ur,"⋏","\\curlywedge",!0);Y(ae,Ge,ur,"⋎","\\curlyvee",!0);Y(ae,Ge,ur,"⊝","\\circleddash",!0);Y(ae,Ge,ur,"⊛","\\circledast",!0);Y(ae,Ge,ur,"⋅","\\centerdot");Y(ae,Ge,ur,"⊺","\\intercal",!0);Y(ae,Ge,ur,"⋒","\\doublecap");Y(ae,Ge,ur,"⋓","\\doublecup");Y(ae,Ge,ur,"⊠","\\boxtimes",!0);Y(ae,Ge,Ue,"⇢","\\dashrightarrow",!0);Y(ae,Ge,Ue,"⇠","\\dashleftarrow",!0);Y(ae,Ge,Ue,"⇇","\\leftleftarrows",!0);Y(ae,Ge,Ue,"⇆","\\leftrightarrows",!0);Y(ae,Ge,Ue,"⇚","\\Lleftarrow",!0);Y(ae,Ge,Ue,"↞","\\twoheadleftarrow",!0);Y(ae,Ge,Ue,"↢","\\leftarrowtail",!0);Y(ae,Ge,Ue,"↫","\\looparrowleft",!0);Y(ae,Ge,Ue,"⇋","\\leftrightharpoons",!0);Y(ae,Ge,Ue,"↶","\\curvearrowleft",!0);Y(ae,Ge,Ue,"↺","\\circlearrowleft",!0);Y(ae,Ge,Ue,"↰","\\Lsh",!0);Y(ae,Ge,Ue,"⇈","\\upuparrows",!0);Y(ae,Ge,Ue,"↿","\\upharpoonleft",!0);Y(ae,Ge,Ue,"⇃","\\downharpoonleft",!0);Y(ae,be,Ue,"⊶","\\origof",!0);Y(ae,be,Ue,"⊷","\\imageof",!0);Y(ae,Ge,Ue,"⊸","\\multimap",!0);Y(ae,Ge,Ue,"↭","\\leftrightsquigarrow",!0);Y(ae,Ge,Ue,"⇉","\\rightrightarrows",!0);Y(ae,Ge,Ue,"⇄","\\rightleftarrows",!0);Y(ae,Ge,Ue,"↠","\\twoheadrightarrow",!0);Y(ae,Ge,Ue,"↣","\\rightarrowtail",!0);Y(ae,Ge,Ue,"↬","\\looparrowright",!0);Y(ae,Ge,Ue,"↷","\\curvearrowright",!0);Y(ae,Ge,Ue,"↻","\\circlearrowright",!0);Y(ae,Ge,Ue,"↱","\\Rsh",!0);Y(ae,Ge,Ue,"⇊","\\downdownarrows",!0);Y(ae,Ge,Ue,"↾","\\upharpoonright",!0);Y(ae,Ge,Ue,"⇂","\\downharpoonright",!0);Y(ae,Ge,Ue,"⇝","\\rightsquigarrow",!0);Y(ae,Ge,Ue,"⇝","\\leadsto");Y(ae,Ge,Ue,"⇛","\\Rrightarrow",!0);Y(ae,Ge,Ue,"↾","\\restriction");Y(ae,be,et,"‘","`");Y(ae,be,et,"$","\\$");Y(Ot,be,et,"$","\\$");Y(Ot,be,et,"$","\\textdollar");Y(ae,be,et,"%","\\%");Y(Ot,be,et,"%","\\%");Y(ae,be,et,"_","\\_");Y(Ot,be,et,"_","\\_");Y(Ot,be,et,"_","\\textunderscore");Y(ae,be,et,"∠","\\angle",!0);Y(ae,be,et,"∞","\\infty",!0);Y(ae,be,et,"′","\\prime");Y(ae,be,et,"△","\\triangle");Y(ae,be,et,"Γ","\\Gamma",!0);Y(ae,be,et,"Δ","\\Delta",!0);Y(ae,be,et,"Θ","\\Theta",!0);Y(ae,be,et,"Λ","\\Lambda",!0);Y(ae,be,et,"Ξ","\\Xi",!0);Y(ae,be,et,"Π","\\Pi",!0);Y(ae,be,et,"Σ","\\Sigma",!0);Y(ae,be,et,"Υ","\\Upsilon",!0);Y(ae,be,et,"Φ","\\Phi",!0);Y(ae,be,et,"Ψ","\\Psi",!0);Y(ae,be,et,"Ω","\\Omega",!0);Y(ae,be,et,"A","Α");Y(ae,be,et,"B","Β");Y(ae,be,et,"E","Ε");Y(ae,be,et,"Z","Ζ");Y(ae,be,et,"H","Η");Y(ae,be,et,"I","Ι");Y(ae,be,et,"K","Κ");Y(ae,be,et,"M","Μ");Y(ae,be,et,"N","Ν");Y(ae,be,et,"O","Ο");Y(ae,be,et,"P","Ρ");Y(ae,be,et,"T","Τ");Y(ae,be,et,"X","Χ");Y(ae,be,et,"¬","\\neg",!0);Y(ae,be,et,"¬","\\lnot");Y(ae,be,et,"⊤","\\top");Y(ae,be,et,"⊥","\\bot");Y(ae,be,et,"∅","\\emptyset");Y(ae,Ge,et,"∅","\\varnothing");Y(ae,be,zr,"α","\\alpha",!0);Y(ae,be,zr,"β","\\beta",!0);Y(ae,be,zr,"γ","\\gamma",!0);Y(ae,be,zr,"δ","\\delta",!0);Y(ae,be,zr,"ϵ","\\epsilon",!0);Y(ae,be,zr,"ζ","\\zeta",!0);Y(ae,be,zr,"η","\\eta",!0);Y(ae,be,zr,"θ","\\theta",!0);Y(ae,be,zr,"ι","\\iota",!0);Y(ae,be,zr,"κ","\\kappa",!0);Y(ae,be,zr,"λ","\\lambda",!0);Y(ae,be,zr,"μ","\\mu",!0);Y(ae,be,zr,"ν","\\nu",!0);Y(ae,be,zr,"ξ","\\xi",!0);Y(ae,be,zr,"ο","\\omicron",!0);Y(ae,be,zr,"π","\\pi",!0);Y(ae,be,zr,"ρ","\\rho",!0);Y(ae,be,zr,"σ","\\sigma",!0);Y(ae,be,zr,"τ","\\tau",!0);Y(ae,be,zr,"υ","\\upsilon",!0);Y(ae,be,zr,"ϕ","\\phi",!0);Y(ae,be,zr,"χ","\\chi",!0);Y(ae,be,zr,"ψ","\\psi",!0);Y(ae,be,zr,"ω","\\omega",!0);Y(ae,be,zr,"ε","\\varepsilon",!0);Y(ae,be,zr,"ϑ","\\vartheta",!0);Y(ae,be,zr,"ϖ","\\varpi",!0);Y(ae,be,zr,"ϱ","\\varrho",!0);Y(ae,be,zr,"ς","\\varsigma",!0);Y(ae,be,zr,"φ","\\varphi",!0);Y(ae,be,ur,"∗","*",!0);Y(ae,be,ur,"+","+");Y(ae,be,ur,"−","-",!0);Y(ae,be,ur,"⋅","\\cdot",!0);Y(ae,be,ur,"∘","\\circ",!0);Y(ae,be,ur,"÷","\\div",!0);Y(ae,be,ur,"±","\\pm",!0);Y(ae,be,ur,"×","\\times",!0);Y(ae,be,ur,"∩","\\cap",!0);Y(ae,be,ur,"∪","\\cup",!0);Y(ae,be,ur,"∖","\\setminus",!0);Y(ae,be,ur,"∧","\\land");Y(ae,be,ur,"∨","\\lor");Y(ae,be,ur,"∧","\\wedge",!0);Y(ae,be,ur,"∨","\\vee",!0);Y(ae,be,et,"√","\\surd");Y(ae,be,jc,"⟨","\\langle",!0);Y(ae,be,jc,"∣","\\lvert");Y(ae,be,jc,"∥","\\lVert");Y(ae,be,Bl,"?","?");Y(ae,be,Bl,"!","!");Y(ae,be,Bl,"⟩","\\rangle",!0);Y(ae,be,Bl,"∣","\\rvert");Y(ae,be,Bl,"∥","\\rVert");Y(ae,be,Ue,"=","=");Y(ae,be,Ue,":",":");Y(ae,be,Ue,"≈","\\approx",!0);Y(ae,be,Ue,"≅","\\cong",!0);Y(ae,be,Ue,"≥","\\ge");Y(ae,be,Ue,"≥","\\geq",!0);Y(ae,be,Ue,"←","\\gets");Y(ae,be,Ue,">","\\gt",!0);Y(ae,be,Ue,"∈","\\in",!0);Y(ae,be,Ue,"","\\@not");Y(ae,be,Ue,"⊂","\\subset",!0);Y(ae,be,Ue,"⊃","\\supset",!0);Y(ae,be,Ue,"⊆","\\subseteq",!0);Y(ae,be,Ue,"⊇","\\supseteq",!0);Y(ae,Ge,Ue,"⊈","\\nsubseteq",!0);Y(ae,Ge,Ue,"⊉","\\nsupseteq",!0);Y(ae,be,Ue,"⊨","\\models");Y(ae,be,Ue,"←","\\leftarrow",!0);Y(ae,be,Ue,"≤","\\le");Y(ae,be,Ue,"≤","\\leq",!0);Y(ae,be,Ue,"<","\\lt",!0);Y(ae,be,Ue,"→","\\rightarrow",!0);Y(ae,be,Ue,"→","\\to");Y(ae,Ge,Ue,"≱","\\ngeq",!0);Y(ae,Ge,Ue,"≰","\\nleq",!0);Y(ae,be,W0," ","\\ ");Y(ae,be,W0," ","\\space");Y(ae,be,W0," ","\\nobreakspace");Y(Ot,be,W0," ","\\ ");Y(Ot,be,W0," "," ");Y(Ot,be,W0," ","\\space");Y(Ot,be,W0," ","\\nobreakspace");Y(ae,be,W0,null,"\\nobreak");Y(ae,be,W0,null,"\\allowbreak");Y(ae,be,ED,",",",");Y(ae,be,ED,";",";");Y(ae,Ge,ur,"⊼","\\barwedge",!0);Y(ae,Ge,ur,"⊻","\\veebar",!0);Y(ae,be,ur,"⊙","\\odot",!0);Y(ae,be,ur,"⊕","\\oplus",!0);Y(ae,be,ur,"⊗","\\otimes",!0);Y(ae,be,et,"∂","\\partial",!0);Y(ae,be,ur,"⊘","\\oslash",!0);Y(ae,Ge,ur,"⊚","\\circledcirc",!0);Y(ae,Ge,ur,"⊡","\\boxdot",!0);Y(ae,be,ur,"△","\\bigtriangleup");Y(ae,be,ur,"▽","\\bigtriangledown");Y(ae,be,ur,"†","\\dagger");Y(ae,be,ur,"⋄","\\diamond");Y(ae,be,ur,"⋆","\\star");Y(ae,be,ur,"◃","\\triangleleft");Y(ae,be,ur,"▹","\\triangleright");Y(ae,be,jc,"{","\\{");Y(Ot,be,et,"{","\\{");Y(Ot,be,et,"{","\\textbraceleft");Y(ae,be,Bl,"}","\\}");Y(Ot,be,et,"}","\\}");Y(Ot,be,et,"}","\\textbraceright");Y(ae,be,jc,"{","\\lbrace");Y(ae,be,Bl,"}","\\rbrace");Y(ae,be,jc,"[","\\lbrack",!0);Y(Ot,be,et,"[","\\lbrack",!0);Y(ae,be,Bl,"]","\\rbrack",!0);Y(Ot,be,et,"]","\\rbrack",!0);Y(ae,be,jc,"(","\\lparen",!0);Y(ae,be,Bl,")","\\rparen",!0);Y(Ot,be,et,"<","\\textless",!0);Y(Ot,be,et,">","\\textgreater",!0);Y(ae,be,jc,"⌊","\\lfloor",!0);Y(ae,be,Bl,"⌋","\\rfloor",!0);Y(ae,be,jc,"⌈","\\lceil",!0);Y(ae,be,Bl,"⌉","\\rceil",!0);Y(ae,be,et,"\\","\\backslash");Y(ae,be,et,"∣","|");Y(ae,be,et,"∣","\\vert");Y(Ot,be,et,"|","\\textbar",!0);Y(ae,be,et,"∥","\\|");Y(ae,be,et,"∥","\\Vert");Y(Ot,be,et,"∥","\\textbardbl");Y(Ot,be,et,"~","\\textasciitilde");Y(Ot,be,et,"\\","\\textbackslash");Y(Ot,be,et,"^","\\textasciicircum");Y(ae,be,Ue,"↑","\\uparrow",!0);Y(ae,be,Ue,"⇑","\\Uparrow",!0);Y(ae,be,Ue,"↓","\\downarrow",!0);Y(ae,be,Ue,"⇓","\\Downarrow",!0);Y(ae,be,Ue,"↕","\\updownarrow",!0);Y(ae,be,Ue,"⇕","\\Updownarrow",!0);Y(ae,be,fa,"∐","\\coprod");Y(ae,be,fa,"⋁","\\bigvee");Y(ae,be,fa,"⋀","\\bigwedge");Y(ae,be,fa,"⨄","\\biguplus");Y(ae,be,fa,"⋂","\\bigcap");Y(ae,be,fa,"⋃","\\bigcup");Y(ae,be,fa,"∫","\\int");Y(ae,be,fa,"∫","\\intop");Y(ae,be,fa,"∬","\\iint");Y(ae,be,fa,"∭","\\iiint");Y(ae,be,fa,"∏","\\prod");Y(ae,be,fa,"∑","\\sum");Y(ae,be,fa,"⨂","\\bigotimes");Y(ae,be,fa,"⨁","\\bigoplus");Y(ae,be,fa,"⨀","\\bigodot");Y(ae,be,fa,"∮","\\oint");Y(ae,be,fa,"∯","\\oiint");Y(ae,be,fa,"∰","\\oiiint");Y(ae,be,fa,"⨆","\\bigsqcup");Y(ae,be,fa,"∫","\\smallint");Y(Ot,be,g3,"…","\\textellipsis");Y(ae,be,g3,"…","\\mathellipsis");Y(Ot,be,g3,"…","\\ldots",!0);Y(ae,be,g3,"…","\\ldots",!0);Y(ae,be,g3,"⋯","\\@cdots",!0);Y(ae,be,g3,"⋱","\\ddots",!0);Y(ae,be,et,"⋮","\\varvdots");Y(Ot,be,et,"⋮","\\varvdots");Y(ae,be,ds,"ˊ","\\acute");Y(ae,be,ds,"ˋ","\\grave");Y(ae,be,ds,"¨","\\ddot");Y(ae,be,ds,"~","\\tilde");Y(ae,be,ds,"ˉ","\\bar");Y(ae,be,ds,"˘","\\breve");Y(ae,be,ds,"ˇ","\\check");Y(ae,be,ds,"^","\\hat");Y(ae,be,ds,"⃗","\\vec");Y(ae,be,ds,"˙","\\dot");Y(ae,be,ds,"˚","\\mathring");Y(ae,be,zr,"","\\@imath");Y(ae,be,zr,"","\\@jmath");Y(ae,be,et,"ı","ı");Y(ae,be,et,"ȷ","ȷ");Y(Ot,be,et,"ı","\\i",!0);Y(Ot,be,et,"ȷ","\\j",!0);Y(Ot,be,et,"ß","\\ss",!0);Y(Ot,be,et,"æ","\\ae",!0);Y(Ot,be,et,"œ","\\oe",!0);Y(Ot,be,et,"ø","\\o",!0);Y(Ot,be,et,"Æ","\\AE",!0);Y(Ot,be,et,"Œ","\\OE",!0);Y(Ot,be,et,"Ø","\\O",!0);Y(Ot,be,ds,"ˊ","\\'");Y(Ot,be,ds,"ˋ","\\`");Y(Ot,be,ds,"ˆ","\\^");Y(Ot,be,ds,"˜","\\~");Y(Ot,be,ds,"ˉ","\\=");Y(Ot,be,ds,"˘","\\u");Y(Ot,be,ds,"˙","\\.");Y(Ot,be,ds,"¸","\\c");Y(Ot,be,ds,"˚","\\r");Y(Ot,be,ds,"ˇ","\\v");Y(Ot,be,ds,"¨",'\\"');Y(Ot,be,ds,"˝","\\H");Y(Ot,be,ds,"◯","\\textcircled");var t8e={"--":!0,"---":!0,"``":!0,"''":!0};Y(Ot,be,et,"–","--",!0);Y(Ot,be,et,"–","\\textendash");Y(Ot,be,et,"—","---",!0);Y(Ot,be,et,"—","\\textemdash");Y(Ot,be,et,"‘","`",!0);Y(Ot,be,et,"‘","\\textquoteleft");Y(Ot,be,et,"’","'",!0);Y(Ot,be,et,"’","\\textquoteright");Y(Ot,be,et,"“","``",!0);Y(Ot,be,et,"“","\\textquotedblleft");Y(Ot,be,et,"”","''",!0);Y(Ot,be,et,"”","\\textquotedblright");Y(ae,be,et,"°","\\degree",!0);Y(Ot,be,et,"°","\\degree");Y(Ot,be,et,"°","\\textdegree",!0);Y(ae,be,et,"£","\\pounds");Y(ae,be,et,"£","\\mathsterling",!0);Y(Ot,be,et,"£","\\pounds");Y(Ot,be,et,"£","\\textsterling",!0);Y(ae,Ge,et,"✠","\\maltese");Y(Ot,Ge,et,"✠","\\maltese");var Ohe='0123456789/@."';for(var TB=0;TB0)return Zu(s,u,i,r,a.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=YPt(s,i,r,a,n);d=p.fontName,f=[p.fontClass]}else o?(d=i8e[l].fontName,f=[l]):(d=l8(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(AD(s,d,i).metrics)return Zu(s,d,i,r,a.concat(f));if(t8e.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m{if(wg(t.classes)!==wg(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},KPt=t=>{for(var e=0;er&&(r=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Jl=function(e,r,n,i){var s=new h7(e,r,n,i);return NQ(s),s},r8e=(t,e,r,n)=>new h7(t,e,r,n),ZPt=function(e,r,n){var i=Jl([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},QPt=function(e,r,n,i){var s=new IQ(e,r,n,i);return NQ(s),s},n8e=function(e){var r=new u7(e);return NQ(r),r},JPt=function(e,r){return e instanceof u7?Jl([],[e],r):e},e$t=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,a=1;a{var r=Jl(["mspace"],[],e),n=bs(t,e);return r.style.marginRight=Xt(n),r},l8=function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return r==="textbf"&&n==="textit"?s="BoldItalic":r==="textbf"?s="Bold":r==="textit"?s="Italic":s="Regular",i+"-"+s},i8e={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},s8e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},n$t=function(e,r){var[n,i,s]=s8e[e],a=new Tg(n),o=new x0([a],{width:Xt(i),height:Xt(s),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=r8e(["overlay"],[o],r);return l.height=s,l.style.height=Xt(s),l.style.width=Xt(i),l},at={fontMap:i8e,makeSymbol:Zu,mathsym:UPt,makeSpan:Jl,makeSvgSpan:r8e,makeLineSpan:ZPt,makeAnchor:QPt,makeFragment:n8e,wrapFragment:JPt,makeVList:t$t,makeOrd:jPt,makeGlue:r$t,staticSvg:n$t,svgData:s8e,tryCombineChars:KPt},ys={number:3,unit:"mu"},_m={number:4,unit:"mu"},ff={number:5,unit:"mu"},i$t={mord:{mop:ys,mbin:_m,mrel:ff,minner:ys},mop:{mord:ys,mop:ys,mrel:ff,minner:ys},mbin:{mord:_m,mop:_m,mopen:_m,minner:_m},mrel:{mord:ff,mop:ff,mopen:ff,minner:ff},mopen:{},mclose:{mop:ys,mbin:_m,mrel:ff,minner:ys},mpunct:{mord:ys,mop:ys,mrel:ff,mopen:ys,mclose:ys,mpunct:ys,minner:ys},minner:{mord:ys,mop:ys,mbin:_m,mrel:ff,mopen:ys,mpunct:ys,minner:ys}},s$t={mord:{mop:ys},mop:{mord:ys,mop:ys},mbin:{},mrel:{},mopen:{},mclose:{mop:ys},mpunct:{},minner:{mop:ys}},a8e={},oL={},lL={};function ir(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&Pr.contains(o$t,v)?m.classes[0]="mord":v==="mbin"&&Pr.contains(a$t,y)&&(g.classes[0]="mord")},{node:d},f,p),zhe(s,(g,m)=>{var y=EW(m),v=EW(g),x=y&&v?g.hasClass("mtight")?s$t[y][v]:i$t[y][v]:null;if(x)return at.makeGlue(x,u)},{node:d},f,p),s},zhe=function t(e,r,n,i,s){i&&e.push(i);for(var a=0;af=>{e.splice(d+1,0,f),a++})(a)}i&&e.pop()},o8e=function(e){return e instanceof u7||e instanceof IQ||e instanceof h7&&e.hasClass("enclosing")?e:null},u$t=function t(e,r){var n=o8e(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},EW=function(e,r){return e?(r&&(e=u$t(e,r)),c$t[e.classes[0]]||null):null},$6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return w0(r.concat(n))},Xn=function(e,r,n){if(!e)return w0();if(oL[e.type]){var i=oL[e.type](e,r);if(n&&r.size!==n.size){i=w0(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Ut("Got group of unknown type: '"+e.type+"'")};function c8(t,e){var r=w0(["base"],t,e),n=w0(["strut"]);return n.style.height=Xt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Xt(-r.depth)),r.children.unshift(n),r}function AW(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Ra(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(c8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(c8(a,e));var u;r?(u=c8(Ra(r,e,!0)),u.classes=["tag"],s.push(u)):i&&s.push(i);var h=w0(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Xt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Xt(-h.depth))}return h}function l8e(t){return new u7(t)}let Dc=class{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=wg(this.classes));for(var n=0;n0&&(e+=' class ="'+Pr.escape(wg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},md=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Pr.escape(this.toText())}toText(){return this.text}},h$t=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Xt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}};var Ht={MathNode:Dc,TextNode:md,SpaceNode:h$t,newDocumentFragment:l8e},Lu=function(e,r,n){return Vi[r][e]&&Vi[r][e].replace&&e.charCodeAt(0)!==55349&&!(t8e.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Vi[r][e].replace),new Ht.TextNode(e)},DQ=function(e){return e.length===1?e[0]:new Ht.MathNode("mrow",e)},OQ=function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(Pr.contains(["\\imath","\\jmath"],s))return null;Vi[i][s]&&Vi[i][s].replace&&(s=Vi[i][s].replace);var a=at.fontMap[n].fontName;return LQ(s,a,i)?at.fontMap[n].variant:null};function EB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof md&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof md&&r.text===","}else return!1}var xc=function(e,r,n){if(e.length===1){var i=Ai(e[0],r);return n&&i instanceof Dc&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||EB(a))){var u=l.children[0];u instanceof Dc&&u.type==="mn"&&(u.children=[...a.children,...u.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof md&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof md&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},Cg=function(e,r,n){return DQ(xc(e,r,n))},Ai=function(e,r){if(!e)return new Ht.MathNode("mrow");if(lL[e.type]){var n=lL[e.type](e,r);return n}else throw new Ut("Got group of unknown type: '"+e.type+"'")};function Vhe(t,e,r,n,i){var s=xc(t,r),a;s.length===1&&s[0]instanceof Dc&&Pr.contains(["mrow","mtable"],s[0].type)?a=s[0]:a=new Ht.MathNode("mrow",s);var o=new Ht.MathNode("annotation",[new Ht.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new Ht.MathNode("semantics",[a,o]),u=new Ht.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return at.makeSpan([h],[u])}var c8e=function(e){return new KAe({style:e.displayMode?Hr.DISPLAY:Hr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},u8e=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=at.makeSpan(n,[e])}return e},d$t=function(e,r,n){var i=c8e(n),s;if(n.output==="mathml")return Vhe(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=AW(e,i);s=at.makeSpan(["katex"],[a])}else{var o=Vhe(e,r,i,n.displayMode,!1),l=AW(e,i);s=at.makeSpan(["katex"],[o,l])}return u8e(s,n)},f$t=function(e,r,n){var i=c8e(n),s=AW(e,i),a=at.makeSpan(["katex"],[s]);return u8e(a,n)},p$t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},g$t=function(e){var r=new Ht.MathNode("mo",[new Ht.TextNode(p$t[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},m$t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},y$t=function(e){return e.type==="ordgroup"?e.body.length:1},v$t=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Pr.contains(["widehat","widecheck","widetilde","utilde"],l)){var u=e,h=y$t(u.base),d,f,p;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,p=.42,f=l+"4"):(d=312,o=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=l+g):(o=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],f="tilde"+g)}var m=new Tg(f),y=new x0([m],{width:"100%",height:Xt(p),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:at.makeSvgSpan([],[y],r),minWidth:0,height:p}}else{var v=[],x=m$t[l],[b,T,C]=x,S=C/1e3,k=b.length,E,A;if(k===1){var R=x[3];E=["hide-tail"],A=[R]}else if(k===2)E=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(k===3)E=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+k+" children.");for(var _=0;_0&&(i.style.minWidth=Xt(s)),i},b$t=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=at.makeSpan(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new kW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new kW({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new x0(u,{width:"100%",height:Xt(o)});a=at.makeSvgSpan([],[h],s)}return a.height=o,a.style.height=Xt(o),a},T0={encloseSpan:b$t,mathMLnode:g$t,svgSpan:v$t};function vn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function PQ(t){var e=MD(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function MD(t){return t&&(t.type==="atom"||WPt.hasOwnProperty(t.type))?t:null}var $Q=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=vn(t.base,"accent"),r=n.base,t.base=r,i=HPt(Xn(t,e)),t.base=n):(n=vn(t,"accent"),r=n.base);var s=Xn(r,e.havingCrampedStyle()),a=n.isShifty&&Pr.isCharacterBox(r),o=0;if(a){var l=Pr.getBaseElem(r),u=Xn(l,e.havingCrampedStyle());o=Dhe(u).skew}var h=n.label==="\\c",d=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=T0.svgSpan(n,e),f=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=at.staticSvg("vec",e),g=at.svgData.vec[1]):(p=at.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=Dhe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=at.makeSpan(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var y=o;m||(y-=g/2),f.style.left=Xt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]},e)}var v=at.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},h8e=(t,e)=>{var r=t.isStretchy?T0.mathMLnode(t.label):new Ht.MathNode("mo",[Lu(t.label,t.mode)]),n=new Ht.MathNode("mover",[Ai(t.base,e),r]);return n.setAttribute("accent","true"),n},x$t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ir({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=cL(e[0]),n=!x$t.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:$Q,mathmlBuilder:h8e});ir({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:$Q,mathmlBuilder:h8e});ir({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=Xn(t.base,e),n=T0.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,s=at.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return at.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=T0.mathMLnode(t.label),n=new Ht.MathNode("munder",[Ai(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var u8=t=>{var e=new Ht.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ir({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=at.wrapFragment(Xn(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(n=e.havingStyle(r.sub()),a=at.wrapFragment(Xn(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=T0.svgSpan(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(a){var d=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l},{type:"elem",elem:a,shift:d}]},e)}else h=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),at.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=T0.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=u8(Ai(t.body,e));if(t.below){var s=u8(Ai(t.below,e));n=new Ht.MathNode("munderover",[r,s,i])}else n=new Ht.MathNode("mover",[r,i])}else if(t.below){var a=u8(Ai(t.below,e));n=new Ht.MathNode("munder",[r,a])}else n=u8(),n=new Ht.MathNode("mover",[r,n]);return n}});var w$t=at.makeSpan;function d8e(t,e){var r=Ra(t.body,e,!0);return w$t([t.mclass],r,e)}function f8e(t,e){var r,n=xc(t.body,e);return t.mclass==="minner"?r=new Ht.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Ht.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Ht.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}ir({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:js(i),isCharacterBox:Pr.isCharacterBox(i)}},htmlBuilder:d8e,mathmlBuilder:f8e});var RD=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};ir({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:RD(e[0]),body:js(e[1]),isCharacterBox:Pr.isCharacterBox(e[1])}}});ir({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],s=e[0],a;n!=="\\stackrel"?a=RD(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:js(i)},l={type:"supsub",mode:s.mode,base:o,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:r.mode,mclass:a,body:[l],isCharacterBox:Pr.isCharacterBox(l)}},htmlBuilder:d8e,mathmlBuilder:f8e});ir({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:RD(e[0]),body:js(e[0])}},htmlBuilder(t,e){var r=Ra(t.body,e,!0),n=at.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=xc(t.body,e),n=new Ht.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var T$t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Hhe=()=>({type:"styling",body:[],mode:"math",style:"display"}),Ghe=t=>t.type==="textord"&&t.text==="@",C$t=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function k$t(t,e,r){var n=T$t[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},a=r.callFunction("\\Big",[s],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function S$t(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Ut("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;s-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',a[l]);var g=k$t(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=Hhe()}s%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ir({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=at.wrapFragment(Xn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Xt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Ht.MathNode("mrow",[Ai(t.label,e)]);return r=new Ht.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ht.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});ir({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=at.wrapFragment(Xn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Ht.MathNode("mrow",[Ai(t.fragment,e)])}});ir({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=vn(e[0],"ordgroup"),i=n.body,s="",a=0;a=1114111)throw new Ut("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var p8e=(t,e)=>{var r=Ra(t.body,e.withColor(t.color),!1);return at.makeFragment(r)},g8e=(t,e)=>{var r=xc(t.body,e.withColor(t.color)),n=new Ht.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n};ir({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=vn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:js(i)}},htmlBuilder:p8e,mathmlBuilder:g8e});ir({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=vn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}},htmlBuilder:p8e,mathmlBuilder:g8e});ir({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&vn(i,"size").value}},htmlBuilder(t,e){var r=at.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Xt(bs(t.size,e)))),r},mathmlBuilder(t,e){var r=new Ht.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Xt(bs(t.size,e)))),r}});var MW={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},m8e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Ut("Expected a control sequence",t);return e},E$t=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},y8e=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};ir({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(MW[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=MW[n.text]),vn(e.parseFunction(),"internal");throw new Ut("Invalid token after macro prefix",n)}});ir({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Ut("Expected a control sequence",n);for(var s=0,a,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Ut('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Ut('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if(n.text==="EOF")throw new Ut("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===MW[r]),{type:"internal",mode:e.mode}}});ir({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=m8e(e.gullet.popToken());e.gullet.consumeSpaces();var i=E$t(e);return y8e(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});ir({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=m8e(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return y8e(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var nk=function(e,r,n){var i=Vi.math[e]&&Vi.math[e].replace,s=LQ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},BQ=function(e,r,n,i){var s=n.havingBaseStyle(r),a=at.makeSpan(i.concat(s.sizingClasses(n)),[e],n),o=s.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},v8e=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xt(s),e.height-=s,e.depth+=s},A$t=function(e,r,n,i,s,a){var o=at.makeSymbol(e,"Main-Regular",s,i),l=BQ(o,r,i,a);return n&&v8e(l,i,r),l},M$t=function(e,r,n,i){return at.makeSymbol(e,"Size"+r+"-Regular",n,i)},b8e=function(e,r,n,i,s,a){var o=M$t(e,r,s,i),l=BQ(at.makeSpan(["delimsizing","size"+r],[o],i),Hr.TEXT,i,a);return n&&v8e(l,i,Hr.TEXT),l},AB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=at.makeSpan(["delimsizinginner",i],[at.makeSpan([],[at.makeSymbol(e,r,n)])]);return{type:"elem",elem:s}},MB=function(e,r,n){var i=gd["Size4-Regular"][e.charCodeAt(0)]?gd["Size4-Regular"][e.charCodeAt(0)][4]:gd["Size1-Regular"][e.charCodeAt(0)][4],s=new Tg("inner",NPt(e,Math.round(1e3*r))),a=new x0([s],{width:Xt(i),height:Xt(r),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=at.makeSvgSpan([],[a],n);return o.height=r,o.style.height=Xt(r),o.style.width=Xt(i),{type:"elem",elem:o}},RW=.008,h8={type:"kern",size:-1*RW},R$t=["|","\\lvert","\\rvert","\\vert"],_$t=["\\|","\\lVert","\\rVert","\\Vert"],x8e=function(e,r,n,i,s,a){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):Pr.contains(R$t,e)?(u="∣",d="vert",f=333):Pr.contains(_$t,e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=nk(o,p,s),m=g.height+g.depth,y=nk(u,p,s),v=y.height+y.depth,x=nk(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=nk(l,p,s);T=S.height+S.depth,C=2}var k=m+b+T,E=Math.max(0,Math.ceil((r-k)/(C*v))),A=k+E*C*v,R=i.fontMetrics().axisHeight;n&&(R*=i.sizeMultiplier);var _=A/2-R,P=[];if(d.length>0){var N=A-m-b,L=Math.round(A*1e3),I=DPt(d,Math.round(N*1e3)),$=new Tg(d,I),O=(f/1e3).toFixed(3)+"em",D=(L/1e3).toFixed(3)+"em",F=new x0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=at.makeSvgSpan([],[F],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(AB(h,p,s)),P.push(h8),l===null){var V=A-m-b+2*RW;P.push(MB(u,V,i))}else{var B=(A-m-b-T)/2+2*RW;P.push(MB(u,B,i)),P.push(h8),P.push(AB(l,p,s)),P.push(h8),P.push(MB(u,B,i))}P.push(h8),P.push(AB(o,p,s))}var H=i.havingBaseStyle(Hr.TEXT),G=at.makeVList({positionType:"bottom",positionData:_,children:P},H);return BQ(at.makeSpan(["delimsizing","mult"],[G],H),Hr.TEXT,i,a)},RB=80,_B=.08,LB=function(e,r,n,i,s){var a=IPt(e,i,n),o=new Tg(e,a),l=new x0([o],{width:"400em",height:Xt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return at.makeSvgSpan(["hide-tail"],[l],s)},L$t=function(e,r){var n=r.havingBaseSizing(),i=k8e("\\surd",e*n.sizeMultiplier,C8e,n),s=n.sizeMultiplier,a=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l=0,u=0,h=0,d;return i.type==="small"?(h=1e3+1e3*a+RB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+_B)/s,u=(1+a)/s,o=LB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+RB)*oS[i.size],u=(oS[i.size]+a)/s,l=(oS[i.size]+a+_B)/s,o=LB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+_B,u=e+a,h=Math.floor(1e3*e+a)+RB,o=LB("sqrtTall",l,h,a,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Xt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+a)*s}},w8e=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],I$t=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],T8e=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],oS=[0,1.2,1.8,2.4,3],N$t=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Pr.contains(w8e,e)||Pr.contains(T8e,e))return b8e(e,r,!1,n,i,s);if(Pr.contains(I$t,e))return x8e(e,oS[r],!1,n,i,s);throw new Ut("Illegal delimiter: '"+e+"'")},D$t=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],O$t=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"stack"}],C8e=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],P$t=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},k8e=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),a=s;ar)return n[a]}return n[n.length-1]},S8e=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Pr.contains(T8e,e)?o=D$t:Pr.contains(w8e,e)?o=C8e:o=O$t;var l=k8e(e,r,o,i);return l.type==="small"?A$t(e,l.style,n,i,s,a):l.type==="large"?b8e(e,l.size,n,i,s,a):x8e(e,r,n,i,s,a)},$$t=function(e,r,n,i,s,a){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return S8e(e,d,!0,i,s,a)},s0={sqrtImage:L$t,sizedDelim:N$t,sizeToMaxHeight:oS,customSizedDelim:S8e,leftRightDelim:$$t},Whe={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},B$t=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function _D(t,e){var r=MD(t);if(r&&Pr.contains(B$t,r.text))return r;throw r?new Ut("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Ut("Invalid delimiter type '"+t.type+"'",t)}ir({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=_D(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Whe[t.funcName].size,mclass:Whe[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?at.makeSpan([t.mclass]):s0.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Lu(t.delim,t.mode));var r=new Ht.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Xt(s0.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function qhe(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ir({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Ut("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:_D(e[0],t).text,color:r}}});ir({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=_D(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=vn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{qhe(t);for(var r=Ra(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{qhe(t);var r=xc(t.body,e);if(t.left!=="."){var n=new Ht.MathNode("mo",[Lu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Ht.MathNode("mo",[Lu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return DQ(r)}});ir({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=_D(e[0],t);if(!t.parser.leftrightDepth)throw new Ut("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;if(t.delim===".")r=$6(e,[]);else{r=s0.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Lu("|","text"):Lu(t.delim,t.mode),n=new Ht.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var FQ=(t,e)=>{var r=at.wrapFragment(Xn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,a=0,o=Pr.isCharacterBox(t.body);if(n==="sout")s=at.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=bs({number:.6,unit:"pt"},e),u=bs({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Xt(d/2+l);var f=Math.floor(1e3*d*i),p=_Pt(f),g=new x0([new Tg("phase",p)],{width:"400em",height:Xt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=at.makeSvgSpan(["hide-tail"],[g],e),s.style.height=Xt(d),a=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m=0,y=0,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),s=T0.encloseSpan(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Xt(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Xt(v),s.style.borderRightWidth=Xt(v)),a=r.depth+y,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:r,shift:0}]},e);else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:b}]},e)}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?at.makeSpan(["mord","cancel-lap"],[x],e):at.makeSpan(["mord"],[x],e)},zQ=(t,e)=>{var r=0,n=new Ht.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Ai(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};ir({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=vn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:FQ,mathmlBuilder:zQ});ir({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=vn(e[0],"color-token").color,a=vn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,borderColor:s,body:o}},htmlBuilder:FQ,mathmlBuilder:zQ});ir({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});ir({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:FQ,mathmlBuilder:zQ});ir({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var E8e={};function Ud(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Ut("{"+t.envName+"} can be used only in display mode.")};function VQ(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function em(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)a=1;else if(a=parseFloat(p),!a||a<0)throw new Ut("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new Ed("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(Uhe(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),C={type:"ordgroup",mode:t.mode,body:C},r&&(C={type:"styling",mode:t.mode,style:r,body:[C]}),g.push(C);var S=t.fetch().text;if(S==="&"){if(d&&g.length===d){if(u||o)throw new Ut("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){T(),g.length===1&&C.type==="styling"&&C.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:ce[he]})}for(T(a[0]),n=0;n0&&(_+=x,k<_&&(k=_),_=0)),e.addJot&&(k+=m),E.height=S,E.depth=k,b+=S,E.pos=b,b+=k+_,l[n]=E,T(a[n+1])}var P=b/2+r.fontMetrics().axisHeight,N=e.cols||[],L=[],I,$,O=[];if(e.tags&&e.tags.some(ce=>ce))for(n=0;n=o)){var q=void 0;(i>0||e.hskipBeforeAndAfter)&&(q=Pr.deflt(B.pregap,f),q!==0&&(I=at.makeSpan(["arraycolsep"],[]),I.style.width=Xt(q),L.push(I)));var oe=[];for(n=0;n0){for(var ie=at.makeLineSpan("hline",r,h),me=at.makeLineSpan("hdashline",r,h),te=[{type:"elem",elem:l,shift:0}];u.length>0;){var _e=u.pop(),$e=_e.pos-P;_e.isDashed?te.push({type:"elem",elem:me,shift:$e}):te.push({type:"elem",elem:ie,shift:$e})}l=at.makeVList({positionType:"individualShift",children:te},r)}if(O.length===0)return at.makeSpan(["mord"],[l],r);var Fe=at.makeVList({positionType:"individualShift",children:O},r);return Fe=at.makeSpan(["tag"],[Fe],r),at.makeFragment([l,Fe])},F$t={c:"center ",l:"left ",r:"right "},jd=function(e,r){for(var n=[],i=new Ht.MathNode("mtd",[],["mtr-glue"]),s=new Ht.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var A=1;A-1?"alignat":"align",s=e.envName==="split",a=em(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:VQ(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),o,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",d=0;d0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return a.colSeparationType=p?"align":"alignat",a};Ud({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=MD(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=PQ(a),l=o.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ut("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return em(t.parser,s,HQ(t.envName))},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new Ut("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=em(t.parser,n,HQ(t.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=em(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=MD(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=PQ(a),l=o.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new Ut("Unknown column alignment: "+l,a)});if(i.length>1)throw new Ut("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=em(t.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new Ut("{subarray} can contain only one column");return s},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=em(t.parser,e,HQ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:M8e,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Pr.contains(["gather","gather*"],t.envName)&&LD(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:VQ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return em(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:M8e,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){LD(t);var e={autoTag:VQ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return em(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["CD"],props:{numArgs:0},handler(t){return LD(t),S$t(t.parser)},htmlBuilder:Yd,mathmlBuilder:jd});ke("\\nonumber","\\gdef\\@eqnsw{0}");ke("\\notag","\\nonumber");ir({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Ut(t.funcName+" valid only within array environment")}});var Yhe=E8e;ir({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Ut("Invalid environment name",i);for(var s="",a=0;a{var r=t.font,n=e.withFont(r);return Xn(t.body,n)},_8e=(t,e)=>{var r=t.font,n=e.withFont(r);return Ai(t.body,n)},jhe={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ir({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=cL(e[0]),s=n;return s in jhe&&(s=jhe[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:R8e,mathmlBuilder:_8e});ir({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0],i=Pr.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:RD(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});ir({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:s}=r,a=r.parseExpression(!0,i),o="math"+n.slice(1);return{type:"font",mode:s,font:o,body:{type:"ordgroup",mode:r.mode,body:a}}},htmlBuilder:R8e,mathmlBuilder:_8e});var L8e=(t,e)=>{var r=e;return t==="display"?r=r.id>=Hr.SCRIPT.id?r.text():Hr.DISPLAY:t==="text"&&r.size===Hr.DISPLAY.size?r=Hr.TEXT:t==="script"?r=Hr.SCRIPT:t==="scriptscript"&&(r=Hr.SCRIPTSCRIPT),r},GQ=(t,e)=>{var r=L8e(t.size,e.style),n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=Xn(t.numer,s,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-a.depth-(x+.5*d){var r=new Ht.MathNode("mfrac",[Ai(t.numer,e),Ai(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=bs(t.barSize,e);r.setAttribute("linethickness",Xt(n))}var i=L8e(t.size,e.style);if(i.size!==e.style.size){r=new Ht.MathNode("mstyle",[r]);var s=i.size===Hr.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",s),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var o=new Ht.MathNode("mo",[new Ht.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),a.push(o)}if(a.push(r),t.rightDelim!=null){var l=new Ht.MathNode("mo",[new Ht.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return DQ(a)}return r};ir({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1],a,o=null,l=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:l,size:u,barSize:null}},htmlBuilder:GQ,mathmlBuilder:WQ});ir({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});ir({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Xhe=["display","text","script","scriptscript"],Khe=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};ir({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],s=cL(e[0]),a=s.type==="atom"&&s.family==="open"?Khe(s.text):null,o=cL(e[1]),l=o.type==="atom"&&o.family==="close"?Khe(o.text):null,u=vn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=vn(p.body[0],"textord");f=Xhe[Number(g.text)]}}else p=vn(p,"textord"),f=Xhe[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:a,rightDelim:l,size:f}},htmlBuilder:GQ,mathmlBuilder:WQ});ir({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:vn(e[0],"size").value,token:i}}});ir({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=gPt(vn(e[1],"infix").size),a=e[2],o=s.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:o,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:GQ,mathmlBuilder:WQ});var I8e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Xn(t.sup,e.havingStyle(r.sup()),e):Xn(t.sub,e.havingStyle(r.sub()),e),i=vn(t.base,"horizBrace")):i=vn(t,"horizBrace");var s=Xn(i.base,e.havingBaseStyle(Hr.DISPLAY)),a=T0.svgSpan(i,e),o;if(i.isOver?(o=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=at.makeVList({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=at.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e);i.isOver?o=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):o=at.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return at.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e)},z$t=(t,e)=>{var r=T0.mathMLnode(t.label);return new Ht.MathNode(t.isOver?"mover":"munder",[Ai(t.base,e),r])};ir({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:I8e,mathmlBuilder:z$t});ir({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=vn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:js(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Ra(t.body,e,!1);return at.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Cg(t.body,e);return r instanceof Dc||(r=new Dc("mrow",[r])),r.setAttribute("href",t.href),r}});ir({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=vn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:r,funcName:n,token:i}=t,s=vn(e[0],"raw").string,a=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=s,o={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,o={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,o={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),h=0;h{var r=Ra(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=at.makeSpan(n,r,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>Cg(t.body,e)});ir({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:js(e[0]),mathml:js(e[1])}},htmlBuilder:(t,e)=>{var r=Ra(t.html,e,!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>Cg(t.mathml,e)});var IB=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Ut("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!ZAe(n))throw new Ut("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ir({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(r[0])for(var l=vn(r[0],"raw").string,u=l.split(","),h=0;h{var r=bs(t.height,e),n=0;t.totalheight.number>0&&(n=bs(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=bs(t.width,e));var s={height:Xt(r+n)};i>0&&(s.width=Xt(i)),n>0&&(s.verticalAlign=Xt(-n));var a=new zPt(t.src,t.alt,s);return a.height=r,a.depth=n,a},mathmlBuilder:(t,e)=>{var r=new Ht.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=bs(t.height,e),i=0;if(t.totalheight.number>0&&(i=bs(t.totalheight,e)-n,r.setAttribute("valign",Xt(-i))),r.setAttribute("height",Xt(n+i)),t.width.number>0){var s=bs(t.width,e);r.setAttribute("width",Xt(s))}return r.setAttribute("src",t.src),r}});ir({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=vn(e[0],"size");if(r.settings.strict){var s=n[1]==="m",a=i.value.unit==="mu";s?(a||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):a&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return at.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=bs(t.dimension,e);return new Ht.SpaceNode(r)}});ir({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=at.makeSpan([],[Xn(t.body,e)]),r=at.makeSpan(["inner"],[r],e)):r=at.makeSpan(["inner"],[Xn(t.body,e)]);var n=at.makeSpan(["fix"],[]),i=at.makeSpan([t.alignment],[r,n],e),s=at.makeSpan(["strut"]);return s.style.height=Xt(i.height+i.depth),i.depth&&(s.style.verticalAlign=Xt(-i.depth)),i.children.unshift(s),i=at.makeSpan(["thinbox"],[i],e),at.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Ht.MathNode("mpadded",[Ai(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});ir({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var s=r==="\\("?"\\)":"$",a=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:a}}});ir({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Ut("Mismatched "+t.funcName)}});var Zhe=(t,e)=>{switch(e.style.size){case Hr.DISPLAY.size:return t.display;case Hr.TEXT.size:return t.text;case Hr.SCRIPT.size:return t.script;case Hr.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};ir({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:js(e[0]),text:js(e[1]),script:js(e[2]),scriptscript:js(e[3])}},htmlBuilder:(t,e)=>{var r=Zhe(t,e),n=Ra(r,e,!1);return at.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=Zhe(t,e);return Cg(r,e)}});var N8e=(t,e,r,n,i,s,a)=>{t=at.makeSpan([],[t]);var o=r&&Pr.isCharacterBox(r),l,u;if(e){var h=Xn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Xn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+a;f=at.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var g=t.height-a;f=at.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},n)}else if(u){var m=t.depth+a;f=at.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var y=[f];if(l&&s!==0&&!o){var v=at.makeSpan(["mspace"],[],n);v.style.marginRight=Xt(s),y.unshift(v)}return at.makeSpan(["mop","op-limits"],y,n)},D8e=["\\smallint"],m3=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=vn(t.base,"op"),i=!0):s=vn(t,"op");var a=e.style,o=!1;a.size===Hr.DISPLAY.size&&s.symbol&&!Pr.contains(D8e,s.name)&&(o=!0);var l;if(s.symbol){var u=o?"Size2-Regular":"Size1-Regular",h="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(h=s.name.slice(1),s.name=h==="oiint"?"\\iint":"\\iiint"),l=at.makeSymbol(s.name,u,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,f=at.staticSvg(h+"Size"+(o?"2":"1"),e);l=at.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]},e),s.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var p=Ra(s.body,e,!0);p.length===1&&p[0]instanceof _u?(l=p[0],l.classes[0]="mop"):l=at.makeSpan(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Dc("mo",[Lu(t.name,t.mode)]),Pr.contains(D8e,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Dc("mo",xc(t.body,e));else{r=new Dc("mi",[new md(t.name.slice(1))]);var n=new Dc("mo",[Lu("⁡","text")]);t.parentIsSupSub?r=new Dc("mrow",[r,n]):r=l8e([r,n])}return r},V$t={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ir({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=V$t[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:m3,mathmlBuilder:d7});ir({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:js(n)}},htmlBuilder:m3,mathmlBuilder:d7});var H$t={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ir({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:m3,mathmlBuilder:d7});ir({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:m3,mathmlBuilder:d7});ir({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=H$t[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:m3,mathmlBuilder:d7});var O8e=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=vn(t.base,"operatorname"),i=!0):s=vn(t,"operatorname");var a;if(s.body.length>0){for(var o=s.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=Ra(o,e.withFont("mathrm"),!0),u=0;u{for(var r=xc(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Ht.TextNode(o)]}var l=new Ht.MathNode("mi",r);l.setAttribute("mathvariant","normal");var u=new Ht.MathNode("mo",[Lu("⁡","text")]);return t.parentIsSupSub?new Ht.MathNode("mrow",[l,u]):Ht.newDocumentFragment([l,u])};ir({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:js(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:O8e,mathmlBuilder:G$t});ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?at.makeFragment(Ra(t.body,e,!1)):at.makeSpan(["mord"],Ra(t.body,e,!0),e)},mathmlBuilder(t,e){return Cg(t.body,e,!0)}});ir({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=Xn(t.body,e.havingCrampedStyle()),n=at.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return at.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(t,e){var r=new Ht.MathNode("mo",[new Ht.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new Ht.MathNode("mover",[Ai(t.body,e),r]);return n.setAttribute("accent","true"),n}});ir({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:js(n)}},htmlBuilder:(t,e)=>{var r=Ra(t.body,e.withPhantom(),!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=xc(t.body,e);return new Ht.MathNode("mphantom",r)}});ir({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=at.makeSpan([],[Xn(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=xc(js(t.body),e),n=new Ht.MathNode("mphantom",r),i=new Ht.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});ir({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=at.makeSpan(["inner"],[Xn(t.body,e.withPhantom())]),n=at.makeSpan(["fix"],[]);return at.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=xc(js(t.body),e),n=new Ht.MathNode("mphantom",r),i=new Ht.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});ir({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=vn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Xn(t.body,e),n=bs(t.dy,e);return at.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new Ht.MathNode("mpadded",[Ai(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});ir({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});ir({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],s=vn(e[0],"size"),a=vn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&vn(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var r=at.makeSpan(["mord","rule"],[],e),n=bs(t.width,e),i=bs(t.height,e),s=t.shift?bs(t.shift,e):0;return r.style.borderRightWidth=Xt(n),r.style.borderTopWidth=Xt(i),r.style.bottom=Xt(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=bs(t.width,e),n=bs(t.height,e),i=t.shift?bs(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new Ht.MathNode("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Xt(r)),a.setAttribute("height",Xt(n));var o=new Ht.MathNode("mpadded",[a]);return i>=0?o.setAttribute("height",Xt(i)):(o.setAttribute("height",Xt(i)),o.setAttribute("depth",Xt(-i))),o.setAttribute("voffset",Xt(i)),o}});function P8e(t,e,r){for(var n=Ra(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return P8e(t.body,r,e)};ir({type:"sizing",names:Qhe,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:Qhe.indexOf(n)+1,body:s}},htmlBuilder:W$t,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=xc(t.body,r),i=new Ht.MathNode("mstyle",n);return i.setAttribute("mathsize",Xt(r.sizeMultiplier)),i}});ir({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,s=!1,a=r[0]&&vn(r[0],"ordgroup");if(a)for(var o="",l=0;l{var r=at.makeSpan([],[Xn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new Ht.MathNode("mpadded",[Ai(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});ir({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=Xn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=at.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idr.height+r.depth+a&&(a=(a+d-r.height-r.depth)/2);var f=l.height-r.height-a-u;r.style.paddingLeft=Xt(h);var p=at.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(t.index){var g=e.havingStyle(Hr.SCRIPTSCRIPT),m=Xn(t.index,g,e),y=.6*(p.height-p.depth),v=at.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]},e),x=at.makeSpan(["root"],[v]);return at.makeSpan(["mord","sqrt"],[x,p],e)}else return at.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Ht.MathNode("mroot",[Ai(r,e),Ai(n,e)]):new Ht.MathNode("msqrt",[Ai(r,e)])}});var Jhe={display:Hr.DISPLAY,text:Hr.TEXT,script:Hr.SCRIPT,scriptscript:Hr.SCRIPTSCRIPT};ir({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!0,r),a=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=Jhe[t.style],n=e.havingStyle(r).withFont("");return P8e(t.body,n,e)},mathmlBuilder(t,e){var r=Jhe[t.style],n=e.havingStyle(r),i=xc(t.body,n),s=new Ht.MathNode("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var q$t=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Hr.DISPLAY.size||n.alwaysHandleSupSub);return i?m3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===Hr.DISPLAY.size||n.limits);return s?O8e:null}else{if(n.type==="accent")return Pr.isCharacterBox(n.base)?$Q:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?I8e:null}else return null}else return null};rv({type:"supsub",htmlBuilder(t,e){var r=q$t(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=Xn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Pr.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());o=Xn(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=Xn(s,g,e),f||(d=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Hr.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Xt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof _u||b)&&(x=Xt(-a.italic))}var T;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var C=u.defaultRuleThickness,S=4*C;if(h-o.depth-(l.height-d)0&&(h+=k,d-=k)}var E=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];T=at.makeVList({positionType:"individualShift",children:E},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];T=at.makeVList({positionType:"shift",positionData:d,children:A},e)}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=at.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]},e);else throw new Error("supsub must have either sup or sub.");var R=EW(a,"right")||"mord";return at.makeSpan([R],[a,at.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Ai(t.base,e)];t.sub&&s.push(Ai(t.sub,e)),t.sup&&s.push(Ai(t.sup,e));var a;if(r)a=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Hr.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Hr.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Hr.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Hr.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Hr.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Hr.DISPLAY)?a="mover":a="msup"}return new Ht.MathNode(a,s)}});rv({type:"atom",htmlBuilder(t,e){return at.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Ht.MathNode("mo",[Lu(t.text,t.mode)]);if(t.family==="bin"){var n=OQ(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var $8e={mi:"italic",mn:"normal",mtext:"normal"};rv({type:"mathord",htmlBuilder(t,e){return at.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new Ht.MathNode("mi",[Lu(t.text,t.mode,e)]),n=OQ(t,e)||"italic";return n!==$8e[r.type]&&r.setAttribute("mathvariant",n),r}});rv({type:"textord",htmlBuilder(t,e){return at.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=Lu(t.text,t.mode,e),n=OQ(t,e)||"normal",i;return t.mode==="text"?i=new Ht.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new Ht.MathNode("mn",[r]):t.text==="\\prime"?i=new Ht.MathNode("mo",[r]):i=new Ht.MathNode("mi",[r]),n!==$8e[i.type]&&i.setAttribute("mathvariant",n),i}});var NB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},DB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rv({type:"spacing",htmlBuilder(t,e){if(DB.hasOwnProperty(t.text)){var r=DB[t.text].className||"";if(t.mode==="text"){var n=at.makeOrd(t,e,"textord");return n.classes.push(r),n}else return at.makeSpan(["mspace",r],[at.mathsym(t.text,t.mode,e)],e)}else{if(NB.hasOwnProperty(t.text))return at.makeSpan(["mspace",NB[t.text]],[],e);throw new Ut('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(DB.hasOwnProperty(t.text))r=new Ht.MathNode("mtext",[new Ht.TextNode(" ")]);else{if(NB.hasOwnProperty(t.text))return new Ht.MathNode("mspace");throw new Ut('Unknown type of space "'+t.text+'"')}return r}});var ede=()=>{var t=new Ht.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};rv({type:"tag",mathmlBuilder(t,e){var r=new Ht.MathNode("mtable",[new Ht.MathNode("mtr",[ede(),new Ht.MathNode("mtd",[Cg(t.body,e)]),ede(),new Ht.MathNode("mtd",[Cg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var tde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},rde={"\\textbf":"textbf","\\textmd":"textmd"},U$t={"\\textit":"textit","\\textup":"textup"},nde=(t,e)=>{var r=t.font;if(r){if(tde[r])return e.withTextFontFamily(tde[r]);if(rde[r])return e.withTextFontWeight(rde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(U$t[r])};ir({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:js(i),font:n}},htmlBuilder(t,e){var r=nde(t,e),n=Ra(t.body,r,!0);return at.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=nde(t,e);return Cg(t.body,r)}});ir({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Xn(t.body,e),n=at.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=at.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return at.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(t,e){var r=new Ht.MathNode("mo",[new Ht.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new Ht.MathNode("munder",[Ai(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});ir({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Xn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return at.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new Ht.MathNode("mpadded",[Ai(t.body,e)],["vcenter"])}});ir({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Ut("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=ide(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),Gp=a8e,B8e=`[ \r + ]`,Y$t="\\\\[a-zA-Z@]+",j$t="\\\\[^\uD800-\uDFFF]",X$t="("+Y$t+")"+B8e+"*",K$t=`\\\\( |[ \r ]+ -?)[ \r ]*`,EW="[̀-ͯ]",B$t=new RegExp(EW+"+$"),F$t="("+I8e+"+)|"+($$t+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(EW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(EW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+P$t)+("|"+O$t+")");let ede=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(F$t,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Cd("EOF",new Yu(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Ut("Unexpected character: '"+e[r]+"'",new Cd(e[r],new Yu(this,r,r+1)));var i=n[6]||n[3]||(n[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 Cd(i,new Yu(this,r,this.tokenRegex.lastIndex))}},z$t=class{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ut("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}};var V$t=w8e;ke("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ke("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ke("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ke("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ke("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ke("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var tde={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};ke("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Ut("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=tde[e.text],n==null||n>=r)throw new Ut("Invalid base-"+r+" digit "+e.text);for(var i;(i=tde[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Ut("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Ut("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new Ut("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ut("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};ke("\\newcommand",t=>VQ(t,!1,!0,!1));ke("\\renewcommand",t=>VQ(t,!0,!1,!1));ke("\\providecommand",t=>VQ(t,!0,!0,!0));ke("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ke("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ke("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Fp[r],Vi.math[r],Vi.text[r]),""});ke("\\bgroup","{");ke("\\egroup","}");ke("~","\\nobreakspace");ke("\\lq","`");ke("\\rq","'");ke("\\aa","\\r a");ke("\\AA","\\r A");ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ke("ℬ","\\mathscr{B}");ke("ℰ","\\mathscr{E}");ke("ℱ","\\mathscr{F}");ke("ℋ","\\mathscr{H}");ke("ℐ","\\mathscr{I}");ke("ℒ","\\mathscr{L}");ke("ℳ","\\mathscr{M}");ke("ℛ","\\mathscr{R}");ke("ℭ","\\mathfrak{C}");ke("ℌ","\\mathfrak{H}");ke("ℨ","\\mathfrak{Z}");ke("\\Bbbk","\\Bbb{k}");ke("·","\\cdotp");ke("\\llap","\\mathllap{\\textrm{#1}}");ke("\\rlap","\\mathrlap{\\textrm{#1}}");ke("\\clap","\\mathclap{\\textrm{#1}}");ke("\\mathstrut","\\vphantom{(}");ke("\\underbar","\\underline{\\text{#1}}");ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ke("\\ne","\\neq");ke("≠","\\neq");ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ke("∉","\\notin");ke("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ke("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ke("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ke("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ke("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ke("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ke("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ke("⟂","\\perp");ke("‼","\\mathclose{!\\mkern-0.8mu!}");ke("∌","\\notni");ke("⌜","\\ulcorner");ke("⌝","\\urcorner");ke("⌞","\\llcorner");ke("⌟","\\lrcorner");ke("©","\\copyright");ke("®","\\textregistered");ke("️","\\textregistered");ke("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ke("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ke("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ke("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ke("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ke("⋮","\\vdots");ke("\\varGamma","\\mathit{\\Gamma}");ke("\\varDelta","\\mathit{\\Delta}");ke("\\varTheta","\\mathit{\\Theta}");ke("\\varLambda","\\mathit{\\Lambda}");ke("\\varXi","\\mathit{\\Xi}");ke("\\varPi","\\mathit{\\Pi}");ke("\\varSigma","\\mathit{\\Sigma}");ke("\\varUpsilon","\\mathit{\\Upsilon}");ke("\\varPhi","\\mathit{\\Phi}");ke("\\varPsi","\\mathit{\\Psi}");ke("\\varOmega","\\mathit{\\Omega}");ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ke("\\boxed","\\fbox{$\\displaystyle{#1}$}");ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ke("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ke("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var rde={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in rde?e=rde[r]:(r.slice(0,4)==="\\not"||r in Vi.math&&Pr.contains(["bin","rel"],Vi.math[r].group))&&(e="\\dotsb"),e});var HQ={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ke("\\dotso",function(t){var e=t.future().text;return e in HQ?"\\ldots\\,":"\\ldots"});ke("\\dotsc",function(t){var e=t.future().text;return e in HQ&&e!==","?"\\ldots\\,":"\\ldots"});ke("\\cdots",function(t){var e=t.future().text;return e in HQ?"\\@cdots\\,":"\\@cdots"});ke("\\dotsb","\\cdots");ke("\\dotsm","\\cdots");ke("\\dotsi","\\!\\cdots");ke("\\dotsx","\\ldots\\,");ke("\\DOTSI","\\relax");ke("\\DOTSB","\\relax");ke("\\DOTSX","\\relax");ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ke("\\,","\\tmspace+{3mu}{.1667em}");ke("\\thinspace","\\,");ke("\\>","\\mskip{4mu}");ke("\\:","\\tmspace+{4mu}{.2222em}");ke("\\medspace","\\:");ke("\\;","\\tmspace+{5mu}{.2777em}");ke("\\thickspace","\\;");ke("\\!","\\tmspace-{3mu}{.1667em}");ke("\\negthinspace","\\!");ke("\\negmedspace","\\tmspace-{4mu}{.2222em}");ke("\\negthickspace","\\tmspace-{5mu}{.277em}");ke("\\enspace","\\kern.5em ");ke("\\enskip","\\hskip.5em\\relax");ke("\\quad","\\hskip1em\\relax");ke("\\qquad","\\hskip2em\\relax");ke("\\tag","\\@ifstar\\tag@literal\\tag@paren");ke("\\tag@paren","\\tag@literal{({#1})}");ke("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Ut("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ke("\\newline","\\\\\\relax");ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var N8e=Xt(dd["Main-Regular"][84][1]-.7*dd["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+N8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+N8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ke("\\hspace","\\@ifstar\\@hspacer\\@hspace");ke("\\@hspace","\\hskip #1\\relax");ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ke("\\ordinarycolon",":");ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ke("∷","\\dblcolon");ke("∹","\\eqcolon");ke("≔","\\coloneqq");ke("≕","\\eqqcolon");ke("⩴","\\Coloneqq");ke("\\ratio","\\vcentcolon");ke("\\coloncolon","\\dblcolon");ke("\\colonequals","\\coloneqq");ke("\\coloncolonequals","\\Coloneqq");ke("\\equalscolon","\\eqqcolon");ke("\\equalscoloncolon","\\Eqqcolon");ke("\\colonminus","\\coloneq");ke("\\coloncolonminus","\\Coloneq");ke("\\minuscolon","\\eqcolon");ke("\\minuscoloncolon","\\Eqcolon");ke("\\coloncolonapprox","\\Colonapprox");ke("\\coloncolonsim","\\Colonsim");ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ke("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ke("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ke("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ke("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ke("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ke("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ke("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ke("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ke("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ke("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ke("\\imath","\\html@mathml{\\@imath}{ı}");ke("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ke("⟦","\\llbracket");ke("⟧","\\rrbracket");ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ke("⦃","\\lBrace");ke("⦄","\\rBrace");ke("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ke("⦵","\\minuso");ke("\\darr","\\downarrow");ke("\\dArr","\\Downarrow");ke("\\Darr","\\Downarrow");ke("\\lang","\\langle");ke("\\rang","\\rangle");ke("\\uarr","\\uparrow");ke("\\uArr","\\Uparrow");ke("\\Uarr","\\Uparrow");ke("\\N","\\mathbb{N}");ke("\\R","\\mathbb{R}");ke("\\Z","\\mathbb{Z}");ke("\\alef","\\aleph");ke("\\alefsym","\\aleph");ke("\\Alpha","\\mathrm{A}");ke("\\Beta","\\mathrm{B}");ke("\\bull","\\bullet");ke("\\Chi","\\mathrm{X}");ke("\\clubs","\\clubsuit");ke("\\cnums","\\mathbb{C}");ke("\\Complex","\\mathbb{C}");ke("\\Dagger","\\ddagger");ke("\\diamonds","\\diamondsuit");ke("\\empty","\\emptyset");ke("\\Epsilon","\\mathrm{E}");ke("\\Eta","\\mathrm{H}");ke("\\exist","\\exists");ke("\\harr","\\leftrightarrow");ke("\\hArr","\\Leftrightarrow");ke("\\Harr","\\Leftrightarrow");ke("\\hearts","\\heartsuit");ke("\\image","\\Im");ke("\\infin","\\infty");ke("\\Iota","\\mathrm{I}");ke("\\isin","\\in");ke("\\Kappa","\\mathrm{K}");ke("\\larr","\\leftarrow");ke("\\lArr","\\Leftarrow");ke("\\Larr","\\Leftarrow");ke("\\lrarr","\\leftrightarrow");ke("\\lrArr","\\Leftrightarrow");ke("\\Lrarr","\\Leftrightarrow");ke("\\Mu","\\mathrm{M}");ke("\\natnums","\\mathbb{N}");ke("\\Nu","\\mathrm{N}");ke("\\Omicron","\\mathrm{O}");ke("\\plusmn","\\pm");ke("\\rarr","\\rightarrow");ke("\\rArr","\\Rightarrow");ke("\\Rarr","\\Rightarrow");ke("\\real","\\Re");ke("\\reals","\\mathbb{R}");ke("\\Reals","\\mathbb{R}");ke("\\Rho","\\mathrm{P}");ke("\\sdot","\\cdot");ke("\\sect","\\S");ke("\\spades","\\spadesuit");ke("\\sub","\\subset");ke("\\sube","\\subseteq");ke("\\supe","\\supseteq");ke("\\Tau","\\mathrm{T}");ke("\\thetasym","\\vartheta");ke("\\weierp","\\wp");ke("\\Zeta","\\mathrm{Z}");ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ke("\\bra","\\mathinner{\\langle{#1}|}");ke("\\ket","\\mathinner{|{#1}\\rangle}");ke("\\braket","\\mathinner{\\langle{#1}\\rangle}");ke("\\Bra","\\left\\langle#1\\right|");ke("\\Ket","\\left|#1\\right\\rangle");var D8e=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",a),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...s,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ke("\\bra@ket",D8e(!1));ke("\\bra@set",D8e(!0));ke("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ke("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ke("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ke("\\angln","{\\angl n}");ke("\\blue","\\textcolor{##6495ed}{#1}");ke("\\orange","\\textcolor{##ffa500}{#1}");ke("\\pink","\\textcolor{##ff00af}{#1}");ke("\\red","\\textcolor{##df0030}{#1}");ke("\\green","\\textcolor{##28ae7b}{#1}");ke("\\gray","\\textcolor{gray}{#1}");ke("\\purple","\\textcolor{##9d38bd}{#1}");ke("\\blueA","\\textcolor{##ccfaff}{#1}");ke("\\blueB","\\textcolor{##80f6ff}{#1}");ke("\\blueC","\\textcolor{##63d9ea}{#1}");ke("\\blueD","\\textcolor{##11accd}{#1}");ke("\\blueE","\\textcolor{##0c7f99}{#1}");ke("\\tealA","\\textcolor{##94fff5}{#1}");ke("\\tealB","\\textcolor{##26edd5}{#1}");ke("\\tealC","\\textcolor{##01d1c1}{#1}");ke("\\tealD","\\textcolor{##01a995}{#1}");ke("\\tealE","\\textcolor{##208170}{#1}");ke("\\greenA","\\textcolor{##b6ffb0}{#1}");ke("\\greenB","\\textcolor{##8af281}{#1}");ke("\\greenC","\\textcolor{##74cf70}{#1}");ke("\\greenD","\\textcolor{##1fab54}{#1}");ke("\\greenE","\\textcolor{##0d923f}{#1}");ke("\\goldA","\\textcolor{##ffd0a9}{#1}");ke("\\goldB","\\textcolor{##ffbb71}{#1}");ke("\\goldC","\\textcolor{##ff9c39}{#1}");ke("\\goldD","\\textcolor{##e07d10}{#1}");ke("\\goldE","\\textcolor{##a75a05}{#1}");ke("\\redA","\\textcolor{##fca9a9}{#1}");ke("\\redB","\\textcolor{##ff8482}{#1}");ke("\\redC","\\textcolor{##f9685d}{#1}");ke("\\redD","\\textcolor{##e84d39}{#1}");ke("\\redE","\\textcolor{##bc2612}{#1}");ke("\\maroonA","\\textcolor{##ffbde0}{#1}");ke("\\maroonB","\\textcolor{##ff92c6}{#1}");ke("\\maroonC","\\textcolor{##ed5fa6}{#1}");ke("\\maroonD","\\textcolor{##ca337c}{#1}");ke("\\maroonE","\\textcolor{##9e034e}{#1}");ke("\\purpleA","\\textcolor{##ddd7ff}{#1}");ke("\\purpleB","\\textcolor{##c6b9fc}{#1}");ke("\\purpleC","\\textcolor{##aa87ff}{#1}");ke("\\purpleD","\\textcolor{##7854ab}{#1}");ke("\\purpleE","\\textcolor{##543b78}{#1}");ke("\\mintA","\\textcolor{##f5f9e8}{#1}");ke("\\mintB","\\textcolor{##edf2df}{#1}");ke("\\mintC","\\textcolor{##e0e5cc}{#1}");ke("\\grayA","\\textcolor{##f6f7f7}{#1}");ke("\\grayB","\\textcolor{##f0f1f2}{#1}");ke("\\grayC","\\textcolor{##e3e5e6}{#1}");ke("\\grayD","\\textcolor{##d6d8da}{#1}");ke("\\grayE","\\textcolor{##babec2}{#1}");ke("\\grayF","\\textcolor{##888d93}{#1}");ke("\\grayG","\\textcolor{##626569}{#1}");ke("\\grayH","\\textcolor{##3b3e40}{#1}");ke("\\grayI","\\textcolor{##21242c}{#1}");ke("\\kaBlue","\\textcolor{##314453}{#1}");ke("\\kaGreen","\\textcolor{##71B307}{#1}");var O8e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let H$t=class{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new z$t(V$t,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new ede(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Cd("EOF",n.loc)),this.pushTokens(i),r.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,a=0,o=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Ut("Extra }",s)}else if(s.text==="EOF")throw new Ut("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",s);if(e&&n)if((a===0||a===1&&e[o]==="{")&&s.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(a!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Ut("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Ut("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Ut("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Ut("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Ut("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Cd(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var a=i.replace(/##/g,"");a.indexOf("#"+(s+1))!==-1;)++s;for(var o=new ede(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||Fp.hasOwnProperty(e)||Vi.math.hasOwnProperty(e)||Vi.text.hasOwnProperty(e)||O8e.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Fp.hasOwnProperty(e)&&!Fp[e].primitive}};var nde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,c8=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),IB={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},ide={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let P8e=class $8e{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new H$t(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Ut("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Cd("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if($8e.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&Fp[i.text]&&Fp[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=Vi[this.mode][r].group,l=Yu.range(e),u;if(_Pt.hasOwnProperty(o)){var h=o;u={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else u={type:o,mode:this.mode,loc:l,text:r};a=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(GAe(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:Yu.range(e),text:r};else return null;if(this.consume(),s)for(var d=0;dt.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertBlockMath:t=>({commands:e,editor:r})=>{const{latex:n,pos:i}=t;return n?e.insertContentAt(i??r.state.selection.from,{type:this.name,attrs:{latex:n}}):!1},deleteBlockMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.delete(i,i+s.nodeSize),!0)},updateBlockMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...s.attrs,latex:n??s.attrs.latex}),!0)}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",xn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:"blockMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)===null||e===void 0?void 0:e.latex)||"","$$"].join(` -`)},markdownTokenizer:{name:"blockMath",level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{const e=t.match(/^\$\$([^$]+)\$\$/);if(!e)return;const[r,n]=e;return{type:"blockMath",raw:r,latex:n.trim()}}},addInputRules(){return[new qy({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:t,range:e,match:r})=>{const[,n]=r,{tr:i}=t,s=t.doc.resolve(e.from),a=this.type.create({latex:n}),o=s.depth>0&&s.parent.isTextblock&&e.from===s.start()&&e.to===s.end()&&s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),this.type)?{from:s.before(),to:s.after()}:e;i.replaceWith(o.from,o.to,a)}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("div"),i=document.createElement("div");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),i.className="block-math-inner",n.dataset.type="block-math",n.setAttribute("data-latex",e.attrs.latex),n.appendChild(i);function s(){try{z8e.render(e.attrs.latex,i,t),n.classList.remove("block-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("block-math-error")}}const a=o=>{o.preventDefault(),o.stopPropagation();const l=r();l!=null&&this.options.onClick&&this.options.onClick(e,l)};return this.options.onClick&&n.addEventListener("click",a),s(),{dom:n,destroy(){n.removeEventListener("click",a)}}}}}),H8e=Zn.create({name:"inlineMath",group:"inline",inline:!0,atom:!0,addOptions(){return{onClick:void 0,katexOptions:void 0}},addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertInlineMath:t=>({editor:e,tr:r})=>{var n;const i=t.latex,s=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.from;return i?(r.replaceWith(s,s,this.type.create({latex:i})),!0):!1},deleteInlineMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.delete(i,i+s.nodeSize),!0)},updateInlineMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...s.attrs,latex:n}),!0)}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:"inlineMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)===null||e===void 0?void 0:e.latex)||""}$`},markdownTokenizer:{name:"inlineMath",level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{const e=t.match(/^\$([^$]+)\$(?!\$)/);if(!e)return;const[r,n]=e;return{type:"inlineMath",raw:r,latex:n.trim()}}},addInputRules(){return[new qy({find:new RegExp("(?{const n=r[2],{tr:i}=t,s=e.from,a=e.to;i.replaceWith(s,a,this.type.create({latex:n}))}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("span");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),n.dataset.type="inline-math",n.setAttribute("data-latex",e.attrs.latex);function i(){try{z8e.render(e.attrs.latex,n,t),n.classList.remove("inline-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("inline-math-error")}}const s=a=>{a.preventDefault(),a.stopPropagation();const o=r();o!=null&&this.options.onClick&&this.options.onClick(e,o)};return this.options.onClick&&n.addEventListener("click",s),i(),{dom:n,destroy(){n.removeEventListener("click",s)}}}}});Wi.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[V8e.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),H8e.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const j$t=H8e.extend({markdownTokenizer:T7e}),X$t=V8e.extend({markdownTokenizer:C7e}),sde={throwOnError:!1,strict:"warn",trust:!1},K$t=(t={})=>[X$t.configure({katexOptions:sde,onClick:t.onBlockClick}),j$t.configure({katexOptions:sde,onClick:t.onInlineClick})],Z$t=(t,e)=>{const r=new Set(e),n=[];t.doc.forEach((i,s)=>{r.has(i)&&(i.type.name==="image"||i.type.name===Jp)&&n.push({node:i,pos:s})});for(const{node:i,pos:s}of n.reverse()){const a=t.doc.resolve(s).nodeBefore,o=t.doc.resolve(s+i.nodeSize).nodeAfter,l=(a==null?void 0:a.type.name)===Jp&&!r.has(a)?a:null,u=(o==null?void 0:o.type.name)===Jp&&!r.has(o)?o:null,h=l??u;if(!h)continue;if(i.type.name==="image"){const f=t.doc.resolve(s).blockRange(t.doc.resolve(s+i.nodeSize));if(!f)continue;t.wrap(f,[{type:h.type,attrs:h.attrs}])}else l||t.setNodeMarkup(s,void 0,h.attrs);const d=l?s:s+t.doc.nodeAt(s).nodeSize;O0(t.doc,d)&&t.join(d)}return t},Q$t=(t,e)=>{const r=Math.min(e.from,t.content.size),n=Math.min(e.to,t.content.size),i=t.resolve(r);for(let a=i.depth;a>0;a-=1)if(i.node(a).type.name===Jp){const o=i.after(a);return{from:o,to:o}}const s=t.nodeAt(r);if(n>r&&((s==null?void 0:s.type.name)==="image"||(s==null?void 0:s.type.name)===Jp)){const a=r+s.nodeSize;return{from:a,to:a}}return{from:r,to:n}},J$t=(t,e,r=t.selection)=>{const{from:n,to:i}=Q$t(t.doc,r),s=t.schema.nodes.image.create(e),a=t.tr.replaceRangeWith(n,i,s);return a.doc.descendants((o,l)=>{o===s&&a.setSelection(Nr.create(a.doc,l))}),a},eBt=(t,e)=>{if(!t.isEditable||t.isDestroyed||e.length===0)return!1;const r=t.schema.nodes[Jp];if(!r)return!1;const n=new Set(e),i=[];let s=null;if(t.state.doc.forEach((l,u)=>{l.type.name==="image"&&n.has(l.attrs.src)?(s||(s={from:u,to:u,images:[]}),s.images.push(l),s.to=u+l.nodeSize):(s&&i.push(s),s=null)}),s&&i.push(s),!i.length)return!1;const a=t.state.tr,o=[];for(const l of i.reverse())if(l.images.length===1)o.push(l.images[0]);else{const u=r.create({layout:"auto"},l.images);a.replaceWith(l.from,l.to,u),o.push(u)}return Z$t(a,o),a.docChanged?(t.view.dispatch(a),!0):!1},tBt=t=>(({editor:e,node:r,getPos:n})=>{let i=r;const s=document.createElement("div");s.className="edgeever-native-image-gallery",s.dataset.edgeeverImageGallery="true";const a=document.createElement("div");a.className="edgeever-native-gallery-toolbar",a.contentEditable="false",a.setAttribute("role","toolbar");const o=document.createElement("div");o.className="edgeever-native-gallery-content";const l=y7e.map(h=>{const d=document.createElement("button");return d.type="button",d.addEventListener("pointerdown",f=>f.stopPropagation()),d.addEventListener("mousedown",f=>f.preventDefault()),d.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation();const p=n();if(!e.isEditable||typeof p!="number")return;const g=e.state.doc.nodeAt(p);(g==null?void 0:g.type.name)===Jp&&e.view.dispatch(e.state.tr.setNodeMarkup(p,void 0,{...g.attrs,layout:h}))}),a.appendChild(d),{button:d,layout:h}});s.appendChild(a),s.appendChild(o);const u=()=>{const h=t()==="en-US",d=iW(i.attrs.layout);s.dataset.imageGalleryLayout=d,s.dataset.imageCount=String(i.childCount),a.hidden=!e.isEditable,a.setAttribute("aria-label",h?"Image gallery layout":"图片画廊布局");for(const f of l)f.button.textContent=f.layout==="auto"?h?"Auto":"自动":f.layout==="1"?h?"Single":"单列":`${f.layout} ${h?"columns":"栏"}`,f.button.setAttribute("aria-pressed",String(f.layout===d))};return u(),e.on("transaction",u),e.on("update",u),{dom:s,contentDOM:o,update:h=>h.type!==i.type?!1:(i=h,u(),!0),stopEvent:h=>a.contains(h.target),ignoreMutation:h=>h.type!=="selection"&&!o.contains(h.target),destroy:()=>{e.off("transaction",u),e.off("update",u)}}}),rBt=` +?)[ \r ]*`,_W="[̀-ͯ]",Z$t=new RegExp(_W+"+$"),Q$t="("+B8e+"+)|"+(K$t+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(_W+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(_W+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+X$t)+("|"+j$t+")");let sde=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(Q$t,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Ed("EOF",new Ku(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Ut("Unexpected character: '"+e[r]+"'",new Ed(e[r],new Ku(this,r,r+1)));var i=n[6]||n[3]||(n[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 Ed(i,new Ku(this,r,this.tokenRegex.lastIndex))}},J$t=class{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ut("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}};var eBt=A8e;ke("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ke("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ke("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ke("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ke("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ke("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var ade={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};ke("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Ut("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=ade[e.text],n==null||n>=r)throw new Ut("Invalid base-"+r+" digit "+e.text);for(var i;(i=ade[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Ut("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Ut("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new Ut("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ut("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};ke("\\newcommand",t=>qQ(t,!1,!0,!1));ke("\\renewcommand",t=>qQ(t,!0,!1,!1));ke("\\providecommand",t=>qQ(t,!0,!0,!0));ke("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ke("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ke("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Gp[r],Vi.math[r],Vi.text[r]),""});ke("\\bgroup","{");ke("\\egroup","}");ke("~","\\nobreakspace");ke("\\lq","`");ke("\\rq","'");ke("\\aa","\\r a");ke("\\AA","\\r A");ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ke("ℬ","\\mathscr{B}");ke("ℰ","\\mathscr{E}");ke("ℱ","\\mathscr{F}");ke("ℋ","\\mathscr{H}");ke("ℐ","\\mathscr{I}");ke("ℒ","\\mathscr{L}");ke("ℳ","\\mathscr{M}");ke("ℛ","\\mathscr{R}");ke("ℭ","\\mathfrak{C}");ke("ℌ","\\mathfrak{H}");ke("ℨ","\\mathfrak{Z}");ke("\\Bbbk","\\Bbb{k}");ke("·","\\cdotp");ke("\\llap","\\mathllap{\\textrm{#1}}");ke("\\rlap","\\mathrlap{\\textrm{#1}}");ke("\\clap","\\mathclap{\\textrm{#1}}");ke("\\mathstrut","\\vphantom{(}");ke("\\underbar","\\underline{\\text{#1}}");ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ke("\\ne","\\neq");ke("≠","\\neq");ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ke("∉","\\notin");ke("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ke("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ke("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ke("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ke("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ke("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ke("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ke("⟂","\\perp");ke("‼","\\mathclose{!\\mkern-0.8mu!}");ke("∌","\\notni");ke("⌜","\\ulcorner");ke("⌝","\\urcorner");ke("⌞","\\llcorner");ke("⌟","\\lrcorner");ke("©","\\copyright");ke("®","\\textregistered");ke("️","\\textregistered");ke("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ke("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ke("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ke("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ke("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ke("⋮","\\vdots");ke("\\varGamma","\\mathit{\\Gamma}");ke("\\varDelta","\\mathit{\\Delta}");ke("\\varTheta","\\mathit{\\Theta}");ke("\\varLambda","\\mathit{\\Lambda}");ke("\\varXi","\\mathit{\\Xi}");ke("\\varPi","\\mathit{\\Pi}");ke("\\varSigma","\\mathit{\\Sigma}");ke("\\varUpsilon","\\mathit{\\Upsilon}");ke("\\varPhi","\\mathit{\\Phi}");ke("\\varPsi","\\mathit{\\Psi}");ke("\\varOmega","\\mathit{\\Omega}");ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ke("\\boxed","\\fbox{$\\displaystyle{#1}$}");ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ke("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ke("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var ode={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in ode?e=ode[r]:(r.slice(0,4)==="\\not"||r in Vi.math&&Pr.contains(["bin","rel"],Vi.math[r].group))&&(e="\\dotsb"),e});var UQ={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ke("\\dotso",function(t){var e=t.future().text;return e in UQ?"\\ldots\\,":"\\ldots"});ke("\\dotsc",function(t){var e=t.future().text;return e in UQ&&e!==","?"\\ldots\\,":"\\ldots"});ke("\\cdots",function(t){var e=t.future().text;return e in UQ?"\\@cdots\\,":"\\@cdots"});ke("\\dotsb","\\cdots");ke("\\dotsm","\\cdots");ke("\\dotsi","\\!\\cdots");ke("\\dotsx","\\ldots\\,");ke("\\DOTSI","\\relax");ke("\\DOTSB","\\relax");ke("\\DOTSX","\\relax");ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ke("\\,","\\tmspace+{3mu}{.1667em}");ke("\\thinspace","\\,");ke("\\>","\\mskip{4mu}");ke("\\:","\\tmspace+{4mu}{.2222em}");ke("\\medspace","\\:");ke("\\;","\\tmspace+{5mu}{.2777em}");ke("\\thickspace","\\;");ke("\\!","\\tmspace-{3mu}{.1667em}");ke("\\negthinspace","\\!");ke("\\negmedspace","\\tmspace-{4mu}{.2222em}");ke("\\negthickspace","\\tmspace-{5mu}{.277em}");ke("\\enspace","\\kern.5em ");ke("\\enskip","\\hskip.5em\\relax");ke("\\quad","\\hskip1em\\relax");ke("\\qquad","\\hskip2em\\relax");ke("\\tag","\\@ifstar\\tag@literal\\tag@paren");ke("\\tag@paren","\\tag@literal{({#1})}");ke("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Ut("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ke("\\newline","\\\\\\relax");ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var F8e=Xt(gd["Main-Regular"][84][1]-.7*gd["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+F8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+F8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ke("\\hspace","\\@ifstar\\@hspacer\\@hspace");ke("\\@hspace","\\hskip #1\\relax");ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ke("\\ordinarycolon",":");ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ke("∷","\\dblcolon");ke("∹","\\eqcolon");ke("≔","\\coloneqq");ke("≕","\\eqqcolon");ke("⩴","\\Coloneqq");ke("\\ratio","\\vcentcolon");ke("\\coloncolon","\\dblcolon");ke("\\colonequals","\\coloneqq");ke("\\coloncolonequals","\\Coloneqq");ke("\\equalscolon","\\eqqcolon");ke("\\equalscoloncolon","\\Eqqcolon");ke("\\colonminus","\\coloneq");ke("\\coloncolonminus","\\Coloneq");ke("\\minuscolon","\\eqcolon");ke("\\minuscoloncolon","\\Eqcolon");ke("\\coloncolonapprox","\\Colonapprox");ke("\\coloncolonsim","\\Colonsim");ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ke("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ke("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ke("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ke("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ke("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ke("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ke("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ke("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ke("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ke("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ke("\\imath","\\html@mathml{\\@imath}{ı}");ke("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ke("⟦","\\llbracket");ke("⟧","\\rrbracket");ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ke("⦃","\\lBrace");ke("⦄","\\rBrace");ke("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ke("⦵","\\minuso");ke("\\darr","\\downarrow");ke("\\dArr","\\Downarrow");ke("\\Darr","\\Downarrow");ke("\\lang","\\langle");ke("\\rang","\\rangle");ke("\\uarr","\\uparrow");ke("\\uArr","\\Uparrow");ke("\\Uarr","\\Uparrow");ke("\\N","\\mathbb{N}");ke("\\R","\\mathbb{R}");ke("\\Z","\\mathbb{Z}");ke("\\alef","\\aleph");ke("\\alefsym","\\aleph");ke("\\Alpha","\\mathrm{A}");ke("\\Beta","\\mathrm{B}");ke("\\bull","\\bullet");ke("\\Chi","\\mathrm{X}");ke("\\clubs","\\clubsuit");ke("\\cnums","\\mathbb{C}");ke("\\Complex","\\mathbb{C}");ke("\\Dagger","\\ddagger");ke("\\diamonds","\\diamondsuit");ke("\\empty","\\emptyset");ke("\\Epsilon","\\mathrm{E}");ke("\\Eta","\\mathrm{H}");ke("\\exist","\\exists");ke("\\harr","\\leftrightarrow");ke("\\hArr","\\Leftrightarrow");ke("\\Harr","\\Leftrightarrow");ke("\\hearts","\\heartsuit");ke("\\image","\\Im");ke("\\infin","\\infty");ke("\\Iota","\\mathrm{I}");ke("\\isin","\\in");ke("\\Kappa","\\mathrm{K}");ke("\\larr","\\leftarrow");ke("\\lArr","\\Leftarrow");ke("\\Larr","\\Leftarrow");ke("\\lrarr","\\leftrightarrow");ke("\\lrArr","\\Leftrightarrow");ke("\\Lrarr","\\Leftrightarrow");ke("\\Mu","\\mathrm{M}");ke("\\natnums","\\mathbb{N}");ke("\\Nu","\\mathrm{N}");ke("\\Omicron","\\mathrm{O}");ke("\\plusmn","\\pm");ke("\\rarr","\\rightarrow");ke("\\rArr","\\Rightarrow");ke("\\Rarr","\\Rightarrow");ke("\\real","\\Re");ke("\\reals","\\mathbb{R}");ke("\\Reals","\\mathbb{R}");ke("\\Rho","\\mathrm{P}");ke("\\sdot","\\cdot");ke("\\sect","\\S");ke("\\spades","\\spadesuit");ke("\\sub","\\subset");ke("\\sube","\\subseteq");ke("\\supe","\\supseteq");ke("\\Tau","\\mathrm{T}");ke("\\thetasym","\\vartheta");ke("\\weierp","\\wp");ke("\\Zeta","\\mathrm{Z}");ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ke("\\bra","\\mathinner{\\langle{#1}|}");ke("\\ket","\\mathinner{|{#1}\\rangle}");ke("\\braket","\\mathinner{\\langle{#1}\\rangle}");ke("\\Bra","\\left\\langle#1\\right|");ke("\\Ket","\\left|#1\\right\\rangle");var z8e=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",a),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...s,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ke("\\bra@ket",z8e(!1));ke("\\bra@set",z8e(!0));ke("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ke("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ke("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ke("\\angln","{\\angl n}");ke("\\blue","\\textcolor{##6495ed}{#1}");ke("\\orange","\\textcolor{##ffa500}{#1}");ke("\\pink","\\textcolor{##ff00af}{#1}");ke("\\red","\\textcolor{##df0030}{#1}");ke("\\green","\\textcolor{##28ae7b}{#1}");ke("\\gray","\\textcolor{gray}{#1}");ke("\\purple","\\textcolor{##9d38bd}{#1}");ke("\\blueA","\\textcolor{##ccfaff}{#1}");ke("\\blueB","\\textcolor{##80f6ff}{#1}");ke("\\blueC","\\textcolor{##63d9ea}{#1}");ke("\\blueD","\\textcolor{##11accd}{#1}");ke("\\blueE","\\textcolor{##0c7f99}{#1}");ke("\\tealA","\\textcolor{##94fff5}{#1}");ke("\\tealB","\\textcolor{##26edd5}{#1}");ke("\\tealC","\\textcolor{##01d1c1}{#1}");ke("\\tealD","\\textcolor{##01a995}{#1}");ke("\\tealE","\\textcolor{##208170}{#1}");ke("\\greenA","\\textcolor{##b6ffb0}{#1}");ke("\\greenB","\\textcolor{##8af281}{#1}");ke("\\greenC","\\textcolor{##74cf70}{#1}");ke("\\greenD","\\textcolor{##1fab54}{#1}");ke("\\greenE","\\textcolor{##0d923f}{#1}");ke("\\goldA","\\textcolor{##ffd0a9}{#1}");ke("\\goldB","\\textcolor{##ffbb71}{#1}");ke("\\goldC","\\textcolor{##ff9c39}{#1}");ke("\\goldD","\\textcolor{##e07d10}{#1}");ke("\\goldE","\\textcolor{##a75a05}{#1}");ke("\\redA","\\textcolor{##fca9a9}{#1}");ke("\\redB","\\textcolor{##ff8482}{#1}");ke("\\redC","\\textcolor{##f9685d}{#1}");ke("\\redD","\\textcolor{##e84d39}{#1}");ke("\\redE","\\textcolor{##bc2612}{#1}");ke("\\maroonA","\\textcolor{##ffbde0}{#1}");ke("\\maroonB","\\textcolor{##ff92c6}{#1}");ke("\\maroonC","\\textcolor{##ed5fa6}{#1}");ke("\\maroonD","\\textcolor{##ca337c}{#1}");ke("\\maroonE","\\textcolor{##9e034e}{#1}");ke("\\purpleA","\\textcolor{##ddd7ff}{#1}");ke("\\purpleB","\\textcolor{##c6b9fc}{#1}");ke("\\purpleC","\\textcolor{##aa87ff}{#1}");ke("\\purpleD","\\textcolor{##7854ab}{#1}");ke("\\purpleE","\\textcolor{##543b78}{#1}");ke("\\mintA","\\textcolor{##f5f9e8}{#1}");ke("\\mintB","\\textcolor{##edf2df}{#1}");ke("\\mintC","\\textcolor{##e0e5cc}{#1}");ke("\\grayA","\\textcolor{##f6f7f7}{#1}");ke("\\grayB","\\textcolor{##f0f1f2}{#1}");ke("\\grayC","\\textcolor{##e3e5e6}{#1}");ke("\\grayD","\\textcolor{##d6d8da}{#1}");ke("\\grayE","\\textcolor{##babec2}{#1}");ke("\\grayF","\\textcolor{##888d93}{#1}");ke("\\grayG","\\textcolor{##626569}{#1}");ke("\\grayH","\\textcolor{##3b3e40}{#1}");ke("\\grayI","\\textcolor{##21242c}{#1}");ke("\\kaBlue","\\textcolor{##314453}{#1}");ke("\\kaGreen","\\textcolor{##71B307}{#1}");var V8e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let tBt=class{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new J$t(eBt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new sde(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Ed("EOF",n.loc)),this.pushTokens(i),r.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,a=0,o=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Ut("Extra }",s)}else if(s.text==="EOF")throw new Ut("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",s);if(e&&n)if((a===0||a===1&&e[o]==="{")&&s.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(a!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Ut("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Ut("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Ut("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Ut("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Ut("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ed(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var a=i.replace(/##/g,"");a.indexOf("#"+(s+1))!==-1;)++s;for(var o=new sde(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||Gp.hasOwnProperty(e)||Vi.math.hasOwnProperty(e)||Vi.text.hasOwnProperty(e)||V8e.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Gp.hasOwnProperty(e)&&!Gp[e].primitive}};var lde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,d8=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),OB={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},cde={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let H8e=class G8e{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new tBt(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Ut("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Ed("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(G8e.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&Gp[i.text]&&Gp[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=Vi[this.mode][r].group,l=Ku.range(e),u;if(GPt.hasOwnProperty(o)){var h=o;u={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else u={type:o,mode:this.mode,loc:l,text:r};a=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(XAe(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:Ku.range(e),text:r};else return null;if(this.consume(),s)for(var d=0;dt.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertBlockMath:t=>({commands:e,editor:r})=>{const{latex:n,pos:i}=t;return n?e.insertContentAt(i??r.state.selection.from,{type:this.name,attrs:{latex:n}}):!1},deleteBlockMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.delete(i,i+s.nodeSize),!0)},updateBlockMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...s.attrs,latex:n??s.attrs.latex}),!0)}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",xn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:"blockMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)===null||e===void 0?void 0:e.latex)||"","$$"].join(` +`)},markdownTokenizer:{name:"blockMath",level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{const e=t.match(/^\$\$([^$]+)\$\$/);if(!e)return;const[r,n]=e;return{type:"blockMath",raw:r,latex:n.trim()}}},addInputRules(){return[new Yy({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:t,range:e,match:r})=>{const[,n]=r,{tr:i}=t,s=t.doc.resolve(e.from),a=this.type.create({latex:n}),o=s.depth>0&&s.parent.isTextblock&&e.from===s.start()&&e.to===s.end()&&s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),this.type)?{from:s.before(),to:s.after()}:e;i.replaceWith(o.from,o.to,a)}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("div"),i=document.createElement("div");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),i.className="block-math-inner",n.dataset.type="block-math",n.setAttribute("data-latex",e.attrs.latex),n.appendChild(i);function s(){try{U8e.render(e.attrs.latex,i,t),n.classList.remove("block-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("block-math-error")}}const a=o=>{o.preventDefault(),o.stopPropagation();const l=r();l!=null&&this.options.onClick&&this.options.onClick(e,l)};return this.options.onClick&&n.addEventListener("click",a),s(),{dom:n,destroy(){n.removeEventListener("click",a)}}}}}),j8e=Zn.create({name:"inlineMath",group:"inline",inline:!0,atom:!0,addOptions(){return{onClick:void 0,katexOptions:void 0}},addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertInlineMath:t=>({editor:e,tr:r})=>{var n;const i=t.latex,s=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.from;return i?(r.replaceWith(s,s,this.type.create({latex:i})),!0):!1},deleteInlineMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.delete(i,i+s.nodeSize),!0)},updateInlineMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...s.attrs,latex:n}),!0)}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",xn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:"inlineMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)===null||e===void 0?void 0:e.latex)||""}$`},markdownTokenizer:{name:"inlineMath",level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{const e=t.match(/^\$([^$]+)\$(?!\$)/);if(!e)return;const[r,n]=e;return{type:"inlineMath",raw:r,latex:n.trim()}}},addInputRules(){return[new Yy({find:new RegExp("(?{const n=r[2],{tr:i}=t,s=e.from,a=e.to;i.replaceWith(s,a,this.type.create({latex:n}))}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("span");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),n.dataset.type="inline-math",n.setAttribute("data-latex",e.attrs.latex);function i(){try{U8e.render(e.attrs.latex,n,t),n.classList.remove("inline-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("inline-math-error")}}const s=a=>{a.preventDefault(),a.stopPropagation();const o=r();o!=null&&this.options.onClick&&this.options.onClick(e,o)};return this.options.onClick&&n.addEventListener("click",s),i(),{dom:n,destroy(){n.removeEventListener("click",s)}}}}});Wi.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[Y8e.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),j8e.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const oBt=j8e.extend({markdownTokenizer:M7e}),lBt=Y8e.extend({markdownTokenizer:R7e}),ude={throwOnError:!1,strict:"warn",trust:!1},cBt=(t={})=>[lBt.configure({katexOptions:ude,onClick:t.onBlockClick}),oBt.configure({katexOptions:ude,onClick:t.onInlineClick})],hde=t=>(t==null?void 0:t.type.name)==="image"&&!dRt(t.attrs.src),f8=(t,e)=>!!t&&t.type.name===y0&&!e.has(t),uBt=(t,e)=>{let r=null;return t.doc.forEach((n,i)=>{n===e&&(r={node:n,pos:i})}),r},hBt=(t,e,r)=>{let n=e,i=e+r.nodeSize;for(;hde(t.doc.resolve(n).nodeBefore);)n-=t.doc.resolve(n).nodeBefore.nodeSize;for(;hde(t.doc.resolve(i).nodeAfter);)i+=t.doc.resolve(i).nodeAfter.nodeSize;return{start:n,end:i}},PB=(t,e,r,n,i)=>{const s=t.doc.resolve(e).blockRange(t.doc.resolve(r));return s?(t.wrap(s,[{type:n,attrs:i}]),!0):!1},dBt=(t,e)=>{const r=new Set(e),n=[];t.doc.forEach(i=>{r.has(i)&&(i.type.name==="image"||i.type.name===y0)&&n.push(i)});for(const i of n.reverse()){const s=uBt(t,i);s&&fBt(t,s.node,s.pos,r)}return t},fBt=(t,e,r,n)=>{const i=t.doc.type.schema.nodes[y0];if(!i)return;const{start:s,end:a}=hBt(t,r,e),o=f8(t.doc.resolve(s).nodeBefore,n)?t.doc.resolve(s).nodeBefore:null,l=o?null:f8(t.doc.resolve(a).nodeAfter,n)?t.doc.resolve(a).nodeAfter:null,u=o??l;if(!(sr+e.nodeSize)&&!u)return;if(e.type.name==="image"){const y=(u==null?void 0:u.attrs)??{layout:"auto"};if(!PB(t,s,a,(u==null?void 0:u.type)??i,y))return;if(o)nc(t.doc,s)&&t.join(s);else if(l){const v=t.doc.nodeAt(s),x=v?s+v.nodeSize:null;x!==null&&nc(t.doc,x)&&t.join(x)}return}const d=(u==null?void 0:u.attrs)??e.attrs;let f=r;if(a>r+e.nodeSize){const y=r+e.nodeSize;PB(t,y,a,i,d)&&nc(t.doc,y)&&t.join(y)}if(s{const r=Math.min(e.from,t.content.size),n=Math.min(e.to,t.content.size),i=t.resolve(r);for(let a=i.depth;a>0;a-=1)if(i.node(a).type.name===y0){const o=i.after(a);return{from:o,to:o}}const s=t.nodeAt(r);if(n>r&&((s==null?void 0:s.type.name)==="image"||(s==null?void 0:s.type.name)===y0)){const a=r+s.nodeSize;return{from:a,to:a}}return{from:r,to:n}},gBt=(t,e,r=t.selection)=>{const{from:n,to:i}=pBt(t.doc,r),s=t.schema.nodes.image.create(e),a=t.tr.replaceRangeWith(n,i,s);return a.doc.descendants((o,l)=>{o===s&&a.setSelection(Nr.create(a.doc,l))}),a},mBt=(t,e)=>{if(!t.isEditable||t.isDestroyed||e.length===0)return!1;const r=t.schema.nodes[y0];if(!r)return!1;const n=new Set(e),i=[];let s=null;if(t.state.doc.forEach((l,u)=>{l.type.name==="image"&&n.has(l.attrs.src)?(s||(s={from:u,to:u,images:[]}),s.images.push(l),s.to=u+l.nodeSize):(s&&i.push(s),s=null)}),s&&i.push(s),!i.length)return!1;const a=t.state.tr,o=[];for(const l of i.reverse())if(l.images.length===1)o.push(l.images[0]);else{const u=r.create({layout:"auto"},l.images);a.replaceWith(l.from,l.to,u),o.push(u)}return dBt(a,o),a.docChanged?(t.view.dispatch(a),!0):!1},yBt=t=>(({editor:e,node:r,getPos:n})=>{let i=r;const s=document.createElement("div");s.className="edgeever-native-image-gallery",s.dataset.edgeeverImageGallery="true";const a=document.createElement("div");a.className="edgeever-native-gallery-toolbar",a.contentEditable="false",a.setAttribute("role","toolbar");const o=document.createElement("div");o.className="edgeever-native-gallery-content";const l=C7e.map(h=>{const d=document.createElement("button");return d.type="button",d.addEventListener("pointerdown",f=>f.stopPropagation()),d.addEventListener("mousedown",f=>f.preventDefault()),d.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation();const p=n();if(!e.isEditable||typeof p!="number")return;const g=e.state.doc.nodeAt(p);(g==null?void 0:g.type.name)===y0&&e.view.dispatch(e.state.tr.setNodeMarkup(p,void 0,{...g.attrs,layout:h}))}),a.appendChild(d),{button:d,layout:h}});s.appendChild(a),s.appendChild(o);const u=()=>{const h=t()==="en-US",d=lW(i.attrs.layout);s.dataset.imageGalleryLayout=d,s.dataset.imageCount=String(i.childCount),a.hidden=!e.isEditable,a.setAttribute("aria-label",h?"Image gallery layout":"图片画廊布局");for(const f of l)f.button.textContent=f.layout==="auto"?h?"Auto":"自动":f.layout==="1"?h?"Single":"单列":`${f.layout} ${h?"columns":"栏"}`,f.button.setAttribute("aria-pressed",String(f.layout===d))};return u(),e.on("transaction",u),e.on("update",u),{dom:s,contentDOM:o,update:h=>h.type!==i.type?!1:(i=h,u(),!0),stopEvent:h=>a.contains(h.target),ignoreMutation:h=>h.type!=="selection"&&!o.contains(h.target),destroy:()=>{e.off("transaction",u),e.off("update",u)}}}),vBt=` [data-edgeever-image-gallery].edgeever-native-image-gallery { display: block; } .edgeever-native-gallery-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; line-height: 1.2; } .edgeever-native-gallery-toolbar[hidden] { display: none; } @@ -2542,12 +2549,12 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, .edgeever-native-gallery-content > * { width: 100% !important; min-width: 0; height: 100%; margin: 0 !important; overflow: hidden; border-radius: 10px; background: transparent; } .edgeever-native-gallery-content > img, .edgeever-native-gallery-content > * > img { width: 100% !important; height: 100%; min-height: 112px; max-height: 220px; object-fit: cover; } .edgeever-native-gallery-content .edgeever-image-size-controls { display: none !important; } -`,nBt=t=>v7e.extend({addNodeView(){return tBt(t)}}),G8e=document.createElement("style");G8e.textContent=rBt;document.head.append(G8e);const W8e=document.createElement("style");W8e.textContent=XMt;document.head.append(W8e);dt.registerConnector($Ae,ROt,!0);function ey(t){try{const n=new URL(t,"http://edgeever.local").pathname.match(/^\/api\/v1\/resources\/([^/]+)(?:\/blob)?\/?$/);if(n!=null&&n[1])return decodeURIComponent(n[1])}catch{}const e=t.match(/\/api\/v1\/resources\/([^/?#]+)/);return e!=null&&e[1]&&e[1]!=="blob"?decodeURIComponent(e[1]):null}function qQ(t,e){return/\/blob(?:$|[?#])/.test(t)||t.includes(`/resources/${e}/blob`)?t:t.startsWith("/api/v1/resources/")||t.includes("/api/v1/resources/")?`/api/v1/resources/${encodeURIComponent(e)}/blob`:t}function UQ(t,e){const r=ey(t);return r?JSON.stringify({kind:"image",href:qQ(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function iBt(t,e){const r=ey(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:qQ(t,r),filename:n,resourceId:r})}const ade="edgeever-attachment-kind-";function sBt(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function q8e(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(ade)&&e.classList.remove(n)});const r=sBt(e.textContent||"");e.classList.add("edgeever-attachment-link",`${ade}${J1(null,r)}`)})}const aBt=performance.now(),ode=256*1024;let ta="viewer",aL="zh-CN",AW="开始输入…",tk=!1;const oL=new Map;let oBt=0;function qa(t){var e,r,n;try{(n=(r=(e=window.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.edgeever)==null||n.postMessage(t)}catch{}}async function lBt(t){return new Uint8Array(await t.arrayBuffer())}function cBt(t){let e="";for(let r=0;r{const r=`r${++oBt}`;oL.set(r,e),qa({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{oL.delete(r)&&e(null)},3e4)})}async function uBt(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(U8e(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await Y8e(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function hBt(t,e){const r=Array.from(t.querySelectorAll("pre code.language-mermaid, pre code[class*='mermaid']")),n=Array.from(t.querySelectorAll("pre")).filter(a=>{const o=a.textContent||"";return a.querySelector("code")&&/^(graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|flowchart)/m.test(o.trim())}),i=new Set([...r.map(a=>a.parentElement).filter(Boolean),...n]);$ce.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default"});let s=0;for(const a of i){const o=(a.textContent||"").trim();if(o)try{const l=`mmd-${Date.now()}-${s++}`,{svg:u}=await $ce.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,a.replaceWith(h)}catch{}}}let rk=null,HM=null,cL=null,nk=null,ik=null,sk=null;function YQ(){var t;HM!==null&&cancelAnimationFrame(HM),HM=null,rk==null||rk.dispose(),rk=null,ik==null||ik.disconnect(),ik=null,nk==null||nk.dispose(),nk=null,sk==null||sk.remove(),sk=null,(t=Fo.querySelector(".ProseMirror"))==null||t.removeAttribute("hidden")}function dBt(t,e,r){YQ();const n=t.querySelector(".ProseMirror");if(!n)return!1;const i=LOt(e,r),s=document.createElement("div");s.className="edgeever-x6-diagram",s.setAttribute("role","img"),s.setAttribute("aria-label",e.kind==="mind-map"?"思维导图":e.kind==="architecture"?"架构图":"流程图"),n.hidden=!0,t.append(s);const a=s.parentElement,o=()=>{if(!a)return Math.max(1,s.clientWidth);const f=getComputedStyle(a),p=getComputedStyle(s),g=Number.parseFloat(f.paddingLeft||"0")+Number.parseFloat(f.paddingRight||"0"),m=Number.parseFloat(p.marginLeft||"0")+Number.parseFloat(p.marginRight||"0");return Math.max(1,a.clientWidth-g-m)},l=new dt({container:s,width:o(),height:Math.max(1,s.clientHeight),background:{color:i.canvas},grid:!1,interacting:!1,panning:{enabled:!0},mousewheel:{enabled:!0,minScale:.1,maxScale:2.5}});l.addNodes(i.nodes),l.addEdges(i.edges);const u=YOt(l,s,{...e,nodes:e.nodes.map((f,p)=>({...f,width:i.nodes[p].width,height:i.nodes[p].height}))});rk=u;const h=()=>u.resize(o(),Math.max(1,s.clientHeight));HM=requestAnimationFrame(h);const d=new ResizeObserver(h);return d.observe(a??s),nk=l,ik=d,sk=s,!0}const fBt=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function lp(t){if(t==null||t==="")return null;const e=typeof t=="number"?t:Number.parseFloat(String(t).replace("%",""));return Number.isFinite(e)?Math.min(100,Math.max(10,Math.round(e))):null}function j8e(t){return Math.min(100,Math.max(10,Math.round(t)))}function u8(t,e){const r=e==null?null:j8e(e);if(r==null){t.style.removeProperty("width"),t.style.removeProperty("max-width"),t.style.removeProperty("--ee-image-width"),delete t.dataset.width,t.classList.remove("has-width");return}const n=`${r}%`;t.dataset.width=String(r),t.classList.add("has-width"),t.style.setProperty("--ee-image-width",n),t.style.setProperty("width",n),t.style.setProperty("max-width",n),t.style.setProperty("margin-left","auto"),t.style.setProperty("margin-right","auto"),t.style.setProperty("box-sizing","border-box"),t.style.setProperty("display","block")}function lde(t,e){let r=0;const n=s=>{s.preventDefault(),s.stopPropagation(),typeof s.stopImmediatePropagation=="function"&&s.stopImmediatePropagation()},i=s=>{n(s);const a=Date.now();a-r<350||(r=a,e())};t.addEventListener("pointerdown",n),t.addEventListener("mousedown",n),t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("pointerup",i),t.addEventListener("click",i)}function pBt(){return Iwe.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>lp(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=lp(e.width);return r?{"data-width":String(r),style:`width: ${r}%`}:{}}}}},addNodeView(){return({editor:t,getPos:e,node:r})=>{let n=r;const i=document.createElement("figure");i.className="edgeever-image-node is-loading",i.contentEditable="false",i.setAttribute("role","img");const s=document.createElement("div");s.className="edgeever-image-loading";const a=document.createElement("span");a.className="edgeever-image-upload-spinner",s.append(a);const o=document.createElement("img");o.draggable=!1,o.hidden=!0;const l=document.createElement("button");l.type="button",l.className="edgeever-image-actions",l.contentEditable="false",l.hidden=!0,l.setAttribute("aria-label","图片操作"),l.textContent="⋯";const u=document.createElement("div");u.className="edgeever-image-size-controls",u.contentEditable="false",u.hidden=!0,u.setAttribute("role","group"),u.setAttribute("aria-label","图片宽度");const h=E=>{const A=e();if(typeof A!="number")return;const R=t.state.doc.nodeAt(A);if(!R||R.type.name!=="image")return;const _=j8e(E);let P=t.state.tr.setNodeMarkup(A,void 0,{...R.attrs,width:_});try{P=P.setSelection(Nr.create(P.doc,A))}catch{}t.view.dispatch(P),u8(i,_),f(_)},d=[];for(const E of fBt){const A=document.createElement("button");A.type="button",A.className="edgeever-image-size-button",A.textContent=E.label,A.setAttribute("aria-label",E.label),A.setAttribute("aria-pressed","false"),lde(A,()=>h(E.width)),d.push({button:A,width:E.width}),u.append(A)}const f=E=>{for(const A of d){const R=E!=null&&A.width===E;A.button.classList.toggle("is-active",R),A.button.setAttribute("aria-pressed",String(R))}},p=E=>{if(i.classList.toggle("is-loading",E==="loading"),i.classList.toggle("is-failed",E==="failed"),s.hidden=E==="ready",o.hidden=E!=="ready",l.hidden=E!=="ready",E==="failed"){s.replaceChildren();const A=document.createElement("span");A.className="edgeever-image-loading-label",A.textContent="图片加载失败",s.append(A),s.hidden=!1}else E==="loading"&&s.replaceChildren(a)},g=E=>{const A=String(E.src??"");return lL(A)||ey(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=UQ(E,String(n.attrs.alt??"image"));if(A){qa({type:"resourcePress",targetJson:A});return}qa({type:"log",message:`image actions: no resource id for href=${E.slice(0,120)}`})},y=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs)||o.getAttribute("src")||"";E&&qa({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};lde(l,m);let v=0;const x=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const A=Date.now();if(A-v<350)return;if(v=A,E.stopPropagation(),ta==="viewer"||!t.isEditable){E.preventDefault(),y();return}E.preventDefault();const R=e();typeof R=="number"&&t.chain().setNodeSelection(R).run()};o.addEventListener("pointerdown",E=>E.stopPropagation()),o.addEventListener("click",x),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&x(E)}),i.append(s,o,l,u);let b=0,T="",C=!1;const S=E=>{const A=String(E.alt??"");o.alt=A;const R=lp(E.width);u8(i,R),f(R);const _=String(E.src??""),P=ey(_);P&&(i.dataset.resourceHref=qQ(_,P),o.dataset.originalSrc=i.dataset.resourceHref)},k=E=>{b+=1;const A=b,R=String(E.src??"");T=R,S(E),p("loading"),u.hidden=!0;const _=P=>{A===b&&(o.onload=()=>{A===b&&(p("ready"),o.style.cursor=ta==="viewer"||!t.isEditable?"zoom-in":"pointer",C&&t.isEditable&&ta==="editor"&&(u.hidden=!1))},o.onerror=()=>{A===b&&p("failed")},o.src=P)};if(!R){p("failed");return}if(R.startsWith("data:")||R.startsWith("edgeever-res:")||R.startsWith("blob:")){_(R);return}if(U8e(R)){Y8e(R).then(P=>{A===b&&(P?_(P):p("failed"))});return}_(R)};return k(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const A=String(E.attrs.src??"");return S(E.attrs),A!==T?k(E.attrs):(f(lp(E.attrs.width)),u8(i,lp(E.attrs.width))),!0},selectNode:()=>{var A,R;C=!0,i.classList.add("is-selected");const E=lp((R=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:R.width)??lp(i.dataset.width)??lp(n.attrs.width);u8(i,E),t.isEditable&&ta==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{C=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function gBt(t){return[...x7e({mathematics:K$t(),starterKit:{codeBlock:!1,link:!1},image:pBt(),gallery:nBt(()=>aL),pdf:!1,file:!1,pluginEmbed:!1,table:{table:{resizable:!1}},markdown:!0}),MNt,rgt.configure({languageClassPrefix:"language-"}),...CRt(),Jpt.configure({placeholder:t})]}const Fo=document.getElementById("editor"),GM=document.getElementById("toolbar"),kr=new fpt({element:Fo,extensions:gBt("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{uL(),requestAnimationFrame(()=>q8e(Fo)),!(tk||ta!=="editor")&&Zh(t)},onSelectionUpdate:()=>uL(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},transformPastedHTML(t){return jMt(t)},handleClick(t,e,r){return cde(r,"click")},handleDOMEvents:{contextmenu(t,e){return cde(e,"contextmenu")}}}});Fo.addEventListener("dblclick",t=>{if(ta!=="viewer")return;const e=t.target;!e||e.closest("a, button, img, input, textarea, select, .edgeever-image-node")||(t.preventDefault(),t.stopPropagation(),qa({type:"doubleTap"}))});function cde(t,e){const r=t.target;if(!r)return!1;if(r.closest(".edgeever-image-size-controls")||r.closest(".edgeever-image-actions")||r.closest(".edgeever-image-size-button"))return!0;const n=r.closest("a");if(n instanceof HTMLAnchorElement){const s=n.getAttribute("href")||"";if(lL(s)||ey(s)){const a=iBt(s,n.textContent||"");if(a)return t.preventDefault(),t.stopPropagation(),qa({type:"resourcePress",targetJson:a}),!0}}const i=r.closest("img");if(i instanceof HTMLImageElement){if(i.closest("figure.edgeever-image-node")&&e==="click")return!1;const s=i.dataset.originalSrc||i.getAttribute("src")||"",a=i.dataset.originalSrc||(lL(s)||ey(s)?s:"");if(!a&&!ey(s))return ta==="viewer"&&e==="click"&&s?(t.preventDefault(),qa({type:"imagePreview",source:s,alt:i.getAttribute("alt")||""}),!0):!1;const o=a||s,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=UQ(o,l);if(u)return t.preventDefault(),t.stopPropagation(),qa({type:"resourcePress",targetJson:u}),!0}if(ta==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),qa({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Fo.addEventListener("touchstart",n=>{var s;const i=(s=n.target)==null?void 0:s.closest("img");i instanceof HTMLImageElement&&(e=i,t=setTimeout(()=>{if(!e)return;const a=e.dataset.originalSrc||e.getAttribute("src")||"",o=UQ(a,e.getAttribute("alt")||"image");o&&qa({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Fo.addEventListener("touchend",r,{passive:!0}),Fo.addEventListener("touchmove",r,{passive:!0}),Fo.addEventListener("touchcancel",r,{passive:!0})})();const jQ="edgeever-dollar",XQ=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",jQ)}:t:Array.isArray(e.content)?{...e,content:e.content.map(XQ)}:t},X8e=t=>RRt(aQ(t.getJSON()));let uC=null;const mBt=(t,e,r)=>{var s;const n=(s=t.storage.markdown)==null?void 0:s.manager,i=t.state.doc.slice(e,r).content.toJSON();return n!=null&&n.serialize?n.serialize(XQ({type:"doc",content:i})).replaceAll(jQ,"\\$"):t.state.doc.textBetween(e,r,` +`,bBt=t=>k7e.extend({addNodeView(){return yBt(t)}}),X8e=document.createElement("style");X8e.textContent=vBt;document.head.append(X8e);FMt();const K8e=document.createElement("style");K8e.textContent=iRt;document.head.append(K8e);dt.registerConnector(GAe,HOt,!0);function ry(t){try{const n=new URL(t,"http://edgeever.local").pathname.match(/^\/api\/v1\/resources\/([^/]+)(?:\/blob)?\/?$/);if(n!=null&&n[1])return decodeURIComponent(n[1])}catch{}const e=t.match(/\/api\/v1\/resources\/([^/?#]+)/);return e!=null&&e[1]&&e[1]!=="blob"?decodeURIComponent(e[1]):null}function XQ(t,e){return/\/blob(?:$|[?#])/.test(t)||t.includes(`/resources/${e}/blob`)?t:t.startsWith("/api/v1/resources/")||t.includes("/api/v1/resources/")?`/api/v1/resources/${encodeURIComponent(e)}/blob`:t}function KQ(t,e){const r=ry(t);return r?JSON.stringify({kind:"image",href:XQ(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function xBt(t,e){const r=ry(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:XQ(t,r),filename:n,resourceId:r})}const dde="edgeever-attachment-kind-";function wBt(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function Z8e(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(dde)&&e.classList.remove(n)});const r=wBt(e.textContent||"");e.classList.add("edgeever-attachment-link",`${dde}${ty(null,r)}`)})}const TBt=performance.now(),fde=256*1024;let ta="viewer",uL="zh-CN",LW="开始输入…",ik=!1;const hL=new Map;let CBt=0;function qa(t){var e,r,n;try{(n=(r=(e=window.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.edgeever)==null||n.postMessage(t)}catch{}}async function kBt(t){return new Uint8Array(await t.arrayBuffer())}function SBt(t){let e="";for(let r=0;r{const r=`r${++CBt}`;hL.set(r,e),qa({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{hL.delete(r)&&e(null)},3e4)})}async function EBt(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(Q8e(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await J8e(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function ABt(t,e){const r=Array.from(t.querySelectorAll("pre code.language-mermaid, pre code[class*='mermaid']")),n=Array.from(t.querySelectorAll("pre")).filter(a=>{const o=a.textContent||"";return a.querySelector("code")&&/^(graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|flowchart)/m.test(o.trim())}),i=new Set([...r.map(a=>a.parentElement).filter(Boolean),...n]);Vce.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default"});let s=0;for(const a of i){const o=(a.textContent||"").trim();if(o)try{const l=`mmd-${Date.now()}-${s++}`,{svg:u}=await Vce.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,a.replaceWith(h)}catch{}}}let sk=null,UM=null,fL=null,ak=null,ok=null,lk=null;function ZQ(){var t;UM!==null&&cancelAnimationFrame(UM),UM=null,sk==null||sk.dispose(),sk=null,ok==null||ok.disconnect(),ok=null,ak==null||ak.dispose(),ak=null,lk==null||lk.remove(),lk=null,(t=Fo.querySelector(".ProseMirror"))==null||t.removeAttribute("hidden")}function MBt(t,e,r){ZQ();const n=t.querySelector(".ProseMirror");if(!n)return!1;const i=WOt(e,r),s=document.createElement("div");s.className="edgeever-x6-diagram",s.setAttribute("role","img"),s.setAttribute("aria-label",e.kind==="mind-map"?"思维导图":e.kind==="architecture"?"架构图":"流程图"),n.hidden=!0,t.append(s);const a=s.parentElement,o=()=>{if(!a)return Math.max(1,s.clientWidth);const f=getComputedStyle(a),p=getComputedStyle(s),g=Number.parseFloat(f.paddingLeft||"0")+Number.parseFloat(f.paddingRight||"0"),m=Number.parseFloat(p.marginLeft||"0")+Number.parseFloat(p.marginRight||"0");return Math.max(1,a.clientWidth-g-m)},l=new dt({container:s,width:o(),height:Math.max(1,s.clientHeight),background:{color:i.canvas},grid:!1,interacting:!1,panning:{enabled:!0},mousewheel:{enabled:!0,minScale:.1,maxScale:2.5}});l.addNodes(i.nodes),l.addEdges(i.edges);const u=aPt(l,s,{...e,nodes:e.nodes.map((f,p)=>({...f,width:i.nodes[p].width,height:i.nodes[p].height}))});sk=u;const h=()=>u.resize(o(),Math.max(1,s.clientHeight));UM=requestAnimationFrame(h);const d=new ResizeObserver(h);return d.observe(a??s),ak=l,ok=d,lk=s,!0}const RBt=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function dp(t){if(t==null||t==="")return null;const e=typeof t=="number"?t:Number.parseFloat(String(t).replace("%",""));return Number.isFinite(e)?Math.min(100,Math.max(10,Math.round(e))):null}function eMe(t){return Math.min(100,Math.max(10,Math.round(t)))}function p8(t,e){const r=e==null?null:eMe(e);if(r==null){t.style.removeProperty("width"),t.style.removeProperty("max-width"),t.style.removeProperty("--ee-image-width"),delete t.dataset.width,t.classList.remove("has-width");return}const n=`${r}%`;t.dataset.width=String(r),t.classList.add("has-width"),t.style.setProperty("--ee-image-width",n),t.style.setProperty("width",n),t.style.setProperty("max-width",n),t.style.setProperty("margin-left","auto"),t.style.setProperty("margin-right","auto"),t.style.setProperty("box-sizing","border-box"),t.style.setProperty("display","block")}function pde(t,e){let r=0;const n=s=>{s.preventDefault(),s.stopPropagation(),typeof s.stopImmediatePropagation=="function"&&s.stopImmediatePropagation()},i=s=>{n(s);const a=Date.now();a-r<350||(r=a,e())};t.addEventListener("pointerdown",n),t.addEventListener("mousedown",n),t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("pointerup",i),t.addEventListener("click",i)}function _Bt(){return Bwe.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>dp(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=dp(e.width);return r?{"data-width":String(r),style:`width: ${r}%`}:{}}}}},addNodeView(){return({editor:t,getPos:e,node:r})=>{let n=r;const i=document.createElement("figure");i.className="edgeever-image-node is-loading",i.contentEditable="false",i.setAttribute("role","img");const s=document.createElement("div");s.className="edgeever-image-loading";const a=document.createElement("span");a.className="edgeever-image-upload-spinner",s.append(a);const o=document.createElement("img");o.draggable=!1,o.hidden=!0;const l=document.createElement("button");l.type="button",l.className="edgeever-image-actions",l.contentEditable="false",l.hidden=!0,l.setAttribute("aria-label","图片操作"),l.textContent="⋯";const u=document.createElement("div");u.className="edgeever-image-size-controls",u.contentEditable="false",u.hidden=!0,u.setAttribute("role","group"),u.setAttribute("aria-label","图片宽度");const h=E=>{const A=e();if(typeof A!="number")return;const R=t.state.doc.nodeAt(A);if(!R||R.type.name!=="image")return;const _=eMe(E);let P=t.state.tr.setNodeMarkup(A,void 0,{...R.attrs,width:_});try{P=P.setSelection(Nr.create(P.doc,A))}catch{}t.view.dispatch(P),p8(i,_),f(_)},d=[];for(const E of RBt){const A=document.createElement("button");A.type="button",A.className="edgeever-image-size-button",A.textContent=E.label,A.setAttribute("aria-label",E.label),A.setAttribute("aria-pressed","false"),pde(A,()=>h(E.width)),d.push({button:A,width:E.width}),u.append(A)}const f=E=>{for(const A of d){const R=E!=null&&A.width===E;A.button.classList.toggle("is-active",R),A.button.setAttribute("aria-pressed",String(R))}},p=E=>{if(i.classList.toggle("is-loading",E==="loading"),i.classList.toggle("is-failed",E==="failed"),s.hidden=E==="ready",o.hidden=E!=="ready",l.hidden=E!=="ready",E==="failed"){s.replaceChildren();const A=document.createElement("span");A.className="edgeever-image-loading-label",A.textContent="图片加载失败",s.append(A),s.hidden=!1}else E==="loading"&&s.replaceChildren(a)},g=E=>{const A=String(E.src??"");return dL(A)||ry(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=KQ(E,String(n.attrs.alt??"image"));if(A){qa({type:"resourcePress",targetJson:A});return}qa({type:"log",message:`image actions: no resource id for href=${E.slice(0,120)}`})},y=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs)||o.getAttribute("src")||"";E&&qa({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};pde(l,m);let v=0;const x=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const A=Date.now();if(A-v<350)return;if(v=A,E.stopPropagation(),ta==="viewer"||!t.isEditable){E.preventDefault(),y();return}E.preventDefault();const R=e();typeof R=="number"&&t.chain().setNodeSelection(R).run()};o.addEventListener("pointerdown",E=>E.stopPropagation()),o.addEventListener("click",x),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&x(E)}),i.append(s,o,l,u);let b=0,T="",C=!1;const S=E=>{const A=String(E.alt??"");o.alt=A;const R=dp(E.width);p8(i,R),f(R);const _=String(E.src??""),P=ry(_);P&&(i.dataset.resourceHref=XQ(_,P),o.dataset.originalSrc=i.dataset.resourceHref)},k=E=>{b+=1;const A=b,R=String(E.src??"");T=R,S(E),p("loading"),u.hidden=!0;const _=P=>{A===b&&(o.onload=()=>{A===b&&(p("ready"),o.style.cursor=ta==="viewer"||!t.isEditable?"zoom-in":"pointer",C&&t.isEditable&&ta==="editor"&&(u.hidden=!1))},o.onerror=()=>{A===b&&p("failed")},o.src=P)};if(!R){p("failed");return}if(R.startsWith("data:")||R.startsWith("edgeever-res:")||R.startsWith("blob:")){_(R);return}if(Q8e(R)){J8e(R).then(P=>{A===b&&(P?_(P):p("failed"))});return}_(R)};return k(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const A=String(E.attrs.src??"");return S(E.attrs),A!==T?k(E.attrs):(f(dp(E.attrs.width)),p8(i,dp(E.attrs.width))),!0},selectNode:()=>{var A,R;C=!0,i.classList.add("is-selected");const E=dp((R=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:R.width)??dp(i.dataset.width)??dp(n.attrs.width);p8(i,E),t.isEditable&&ta==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{C=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function LBt(t){return[...E7e({mathematics:cBt(),starterKit:{codeBlock:!1,link:!1},image:_Bt(),gallery:bBt(()=>uL),pdf:!1,file:!1,pluginEmbed:!1,table:{table:{resizable:!1}},markdown:!0}),FNt,lgt.configure({languageClassPrefix:"language-"}),...DRt(),sgt.configure({placeholder:t})]}const Fo=document.getElementById("editor"),YM=document.getElementById("toolbar"),mr=new bpt({element:Fo,extensions:LBt("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{v5(),requestAnimationFrame(()=>Z8e(Fo)),!(ik||ta!=="editor")&&ed(t)},onSelectionUpdate:()=>v5(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},transformPastedHTML(t){return nRt(t)},handleClick(t,e,r){return gde(r,"click")},handleDOMEvents:{contextmenu(t,e){return gde(e,"contextmenu")}}}});Fo.addEventListener("dblclick",t=>{if(ta!=="viewer")return;const e=t.target;!e||e.closest("a, button, img, input, textarea, select, .edgeever-image-node")||(t.preventDefault(),t.stopPropagation(),qa({type:"doubleTap"}))});function gde(t,e){const r=t.target;if(!r)return!1;if(r.closest(".edgeever-image-size-controls")||r.closest(".edgeever-image-actions")||r.closest(".edgeever-image-size-button"))return!0;const n=r.closest("a");if(n instanceof HTMLAnchorElement){const s=n.getAttribute("href")||"";if(dL(s)||ry(s)){const a=xBt(s,n.textContent||"");if(a)return t.preventDefault(),t.stopPropagation(),qa({type:"resourcePress",targetJson:a}),!0}}const i=r.closest("img");if(i instanceof HTMLImageElement){if(i.closest("figure.edgeever-image-node")&&e==="click")return!1;const s=i.dataset.originalSrc||i.getAttribute("src")||"",a=i.dataset.originalSrc||(dL(s)||ry(s)?s:"");if(!a&&!ry(s))return ta==="viewer"&&e==="click"&&s?(t.preventDefault(),qa({type:"imagePreview",source:s,alt:i.getAttribute("alt")||""}),!0):!1;const o=a||s,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=KQ(o,l);if(u)return t.preventDefault(),t.stopPropagation(),qa({type:"resourcePress",targetJson:u}),!0}if(ta==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),qa({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Fo.addEventListener("touchstart",n=>{var s;const i=(s=n.target)==null?void 0:s.closest("img");i instanceof HTMLImageElement&&(e=i,t=setTimeout(()=>{if(!e)return;const a=e.dataset.originalSrc||e.getAttribute("src")||"",o=KQ(a,e.getAttribute("alt")||"image");o&&qa({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Fo.addEventListener("touchend",r,{passive:!0}),Fo.addEventListener("touchmove",r,{passive:!0}),Fo.addEventListener("touchcancel",r,{passive:!0})})();const QQ="edgeever-dollar",JQ=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",QQ)}:t:Array.isArray(e.content)?{...e,content:e.content.map(JQ)}:t},tMe=t=>zRt(uQ(t.getJSON()));let fC=null;const IBt=(t,e,r)=>{var s;const n=(s=t.storage.markdown)==null?void 0:s.manager,i=t.state.doc.slice(e,r).content.toJSON();return n!=null&&n.serialize?n.serialize(JQ({type:"doc",content:i})).replaceAll(QQ,"\\$"):t.state.doc.textBetween(e,r,` -`)},NB="edgeever-inline-sentinel",yBt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(XQ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(jQ,"\\$"):r},vBt=t=>{const e=t.state.selection;if(e.empty||e.from>=e.to)return null;const r=[];if(t.state.doc.nodesBetween(e.from,e.to,(i,s)=>{if(!i.isTextblock)return!0;const a=s+1,o=a+i.content.size,l=Math.max(e.from,a),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:a,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],s=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),a=t.state.doc.textBetween(i.from,i.to,` -`),o=yBt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=mBt(t,e.from,e.to).trim();return n?{from:e.from,to:e.to,isInline:!1,markdown:n,text:t.state.doc.textBetween(e.from,e.to,` +`)},$B="edgeever-inline-sentinel",NBt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(JQ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(QQ,"\\$"):r},DBt=t=>{const e=t.state.selection;if(e.empty||e.from>=e.to)return null;const r=[];if(t.state.doc.nodesBetween(e.from,e.to,(i,s)=>{if(!i.isTextblock)return!0;const a=s+1,o=a+i.content.size,l=Math.max(e.from,a),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:a,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],s=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),a=t.state.doc.textBetween(i.from,i.to,` +`),o=NBt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=IBt(t,e.from,e.to).trim();return n?{from:e.from,to:e.to,isInline:!1,markdown:n,text:t.state.doc.textBetween(e.from,e.to,` -`)}:null},bBt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${NB}${a}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(NB))return[{type:"text",text:a}];const d=h.text.slice(NB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function Zh(t){try{const e=JSON.stringify(aQ(t.getJSON())),r=X8e(t);qa({type:"change",contentMarkdown:r,contentJson:e})}catch(e){qa({type:"error",message:e instanceof Error?e.message:String(e)})}}function xBt(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;hl.char).join("").toLocaleLowerCase(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const ude=()=>kr.isActive("taskItem")?"taskItem":"listItem";function K8e(t){var r;if(GM.classList.toggle("editor-mode",t),GM.innerHTML="",!t)return;const e=[{id:"image",label:"▧+",run:()=>qa({type:"pickImage"})},{id:"bold",label:"B",run:()=>kr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>kr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>kr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>kr.chain().focus().sinkListItem(ude()).run()},{id:"outdent",label:"⇤",run:()=>kr.chain().focus().liftListItem(ude()).run()},{id:"quote",label:"❝",run:()=>kr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>kr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const s={image:["插入图片","Insert image"],bold:["粗体","Bold"],bullet:["项目符号列表","Bullet list"],task:["任务清单","Task list"],indent:["增加列表缩进","Increase list indent"],outdent:["减少列表缩进","Decrease list indent"],quote:["引用","Block quote"],hr:["分隔线","Horizontal rule"]};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[aL==="en-US"?1:0])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&Zh(kr),uL()}),GM.appendChild(i)}uL()}function uL(){const t={bold:kr.isActive("bold"),bullet:kr.isActive("bulletList"),task:kr.isActive("taskList"),quote:kr.isActive("blockquote")};GM.querySelectorAll("button[data-action]").forEach(e=>{e.classList.toggle("is-active",t[e.dataset.action??""]??!1)})}async function DB(t="light"){Fo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=AW}),q8e(Fo),await uBt(Fo),ta==="viewer"&&(!cL||!dBt(Fo,cL,t))&&(YQ(),await hBt(Fo,t))}async function wBt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=DOt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=BAe[i]||680,a=p5[e]||p5.slate,o=kr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=$Ot({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=POt({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async R=>{if(!R.complete)try{await R.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(R=>!R.complete||R.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=NOt[e]||a.canvasBg,x=await dEt(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:s}),b=await new Promise((R,_)=>{x.toBlob(P=>P?R(P):_(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",C=OOt(t.title,t.fallbackTitle),S=await lBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=cBt(S);for(let R=0;RsetTimeout(_,0));qa({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){qa({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const TBt={exportImage(t){wBt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,aL=t.locale==="en-US"?"en-US":"zh-CN",kr.setEditable(ta==="editor"),K8e(ta==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",ta==="viewer"),document.body.classList.toggle("editor-mode",ta==="editor"),t.placeholder&&(AW=t.placeholder,Fo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=AW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{kr.commands.focus("end")}catch{}}),DB(t.theme||"light")},setMarkdown(t){var n;tk=!0;const e=ta==="viewer"?VDt(t):null;cL=e;const r=ta==="viewer"?e?"":HDt(t):t;try{kr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=kr.storage.markdown)==null?void 0:n.manager;if(i)kr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{kr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}kr.setEditable(ta==="editor"),tk=!1,DB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){tk=!0,cL=null,YQ();try{const e=JSON.parse(t);kr.commands.setContent(SRt(LNt(e),aL))}catch{kr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}kr.setEditable(ta==="editor"),tk=!1,DB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=oL.get(t);r&&(oL.delete(t),r(e))},getMarkdown(){return X8e(kr)},getDocument(){return JSON.stringify(aQ(kr.getJSON()))},captureSelection(){const t=vBt(kr);return t?(uC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(kr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(uC=null,null)},applySelectionDraft(t,e){var a,o;const r=uC;if(!r||!t.trim())return!1;if(JSON.stringify(kr.getJSON())!==r.documentFingerprint)return uC=null,!1;const n=kr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=kr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?bBt(kr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return kr.chain().focus().insertContentAt(d,h).run(),uC=null,Zh(kr),!0}catch{return!1}},undo(){if(!kr.can().undo())return!1;const t=kr.commands.undo();return t&&Zh(kr),t},focusEnd(){var t;try{kr.commands.focus("end")}catch{}try{const e=(t=kr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){Zh(kr)},exec(t){var r;const e={bold:()=>kr.chain().focus().toggleBold().run(),bulletList:()=>kr.chain().focus().toggleBulletList().run(),taskList:()=>kr.chain().focus().toggleTaskList().run(),blockquote:()=>kr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>kr.chain().focus().setHorizontalRule().run(),heading2:()=>kr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>kr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),Zh(kr)},beginImageUpload(t,e){kr.chain().focus().setImage({src:e,alt:t,width:Rue}).run();const r=Fo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),Zh(kr)},completeImageUpload(t,e,r){kr.isEditable&&(kr.view.dispatch(J$t(kr.state,{src:e,alt:r||t||"",width:Rue})),Zh(kr))},groupImages(t){const e=eBt(kr,t);return e&&Zh(kr),e},cancelImageUpload(t){const e=Fo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),Zh(kr)},search(t,e){const r=xBt(kr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){kr.commands.setTextSelection({from:i.from,to:i.to});try{const s=kr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}qa({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=TBt;K8e(!1);qa({type:"ready",startupMs:Math.round(performance.now()-aBt)});class Gt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15t.replace(CBt,"-$1").toLowerCase(),SBt={"&":"&",">":">","<":"<",'"':""","'":"'"},EBt=/[&><"']/g,Ho=t=>String(t).replace(EBt,e=>SBt[e]),WM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?WM(t.body[0]):t:t.type==="font"?WM(t.body):t,ABt=new Set(["mathord","textord","atom"]),V0=t=>ABt.has(WM(t).type),MBt=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},hL={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 "},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 ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function RBt(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function _Bt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return RBt(e)}function LBt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:_Bt(n)}class KQ{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(hL)){var n=hL[r];n&&LBt(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Gt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=MBt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class cp{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return od[IBt[this.id]]}sub(){return od[NBt[this.id]]}fracNum(){return od[DBt[this.id]]}fracDen(){return od[OBt[this.id]]}cramp(){return od[PBt[this.id]]}text(){return od[$Bt[this.id]]}isTight(){return this.size>=2}}var ZQ=0,dL=1,Nb=2,r0=3,O6=4,yu=5,m5=6,xl=7,od=[new cp(ZQ,0,!1),new cp(dL,0,!0),new cp(Nb,1,!1),new cp(r0,1,!0),new cp(O6,2,!1),new cp(yu,2,!0),new cp(m5,3,!1),new cp(xl,3,!0)],IBt=[O6,yu,O6,yu,m5,xl,m5,xl],NBt=[yu,yu,yu,yu,xl,xl,xl,xl],DBt=[Nb,r0,O6,yu,m5,xl,m5,xl],OBt=[r0,r0,yu,yu,xl,xl,xl,xl],PBt=[dL,dL,r0,r0,yu,yu,xl,xl],$Bt=[ZQ,dL,Nb,r0,Nb,r0,Nb,r0],dn={DISPLAY:od[ZQ],TEXT:od[Nb],SCRIPT:od[O6],SCRIPTSCRIPT:od[m5]},MW=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function BBt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var qM=[];MW.forEach(t=>t.blocks.forEach(e=>qM.push(...e)));function Z8e(t){for(var e=0;e=qM[e]&&t<=qM[e+1])return!0;return!1}var va=t=>t+" "+t,qv=80,FBt=function(e,r){return"M95,"+(622+e+r)+` +`)}:null},OBt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${$B}${a}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith($B))return[{type:"text",text:a}];const d=h.text.slice($B.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(uQ(t.getJSON())),r=tMe(t);qa({type:"change",contentMarkdown:r,contentJson:e})}catch(e){qa({type:"error",message:e instanceof Error?e.message:String(e)})}}function PBt(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;hl.char).join("").toLocaleLowerCase(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const mde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function rMe(t){var r;if(YM.classList.toggle("editor-mode",t),YM.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>mr.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>mr.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>qa({type:"pickImage"})},{id:"bold",label:"B",run:()=>mr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>mr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>mr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>mr.chain().focus().sinkListItem(mde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(mde()).run()},{id:"quote",label:"❝",run:()=>mr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>mr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const s={undo:["撤销","Undo"],redo:["重做","Redo"],image:["插入图片","Insert image"],bold:["粗体","Bold"],bullet:["项目符号列表","Bullet list"],task:["任务清单","Task list"],indent:["增加列表缩进","Increase list indent"],outdent:["减少列表缩进","Decrease list indent"],quote:["引用","Block quote"],hr:["分隔线","Horizontal rule"]};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[uL==="en-US"?1:0])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),v5()}),YM.appendChild(i)}v5()}function v5(){const t={bold:mr.isActive("bold"),bullet:mr.isActive("bulletList"),task:mr.isActive("taskList"),quote:mr.isActive("blockquote")},e=n=>{try{return mr.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};YM.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function BB(t="light"){Fo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=LW}),Z8e(Fo),await EBt(Fo),ta==="viewer"&&(!fL||!MBt(Fo,fL,t))&&(ZQ(),await ABt(Fo,t))}async function $Bt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=YOt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=WAe[i]||680,a=m5[e]||m5.slate,o=mr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=KOt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=XOt({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async R=>{if(!R.complete)try{await R.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(R=>!R.complete||R.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=UOt[e]||a.canvasBg,x=await vEt(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:s}),b=await new Promise((R,_)=>{x.toBlob(P=>P?R(P):_(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",C=jOt(t.title,t.fallbackTitle),S=await kBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=SBt(S);for(let R=0;RsetTimeout(_,0));qa({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){qa({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const BBt={exportImage(t){$Bt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,uL=t.locale==="en-US"?"en-US":"zh-CN",mr.setEditable(ta==="editor"),rMe(ta==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",ta==="viewer"),document.body.classList.toggle("editor-mode",ta==="editor"),t.placeholder&&(LW=t.placeholder,Fo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=LW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),BB(t.theme||"light")},setMarkdown(t){var n;ik=!0;const e=ta==="viewer"?JDt(t):null;fL=e;const r=ta==="viewer"?e?"":eOt(t):t;try{mr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=mr.storage.markdown)==null?void 0:n.manager;if(i)mr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}mr.setEditable(ta==="editor"),Rhe(mr),v5(),ik=!1,BB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){ik=!0,fL=null,ZQ();try{const e=JSON.parse(t);mr.commands.setContent(PRt(HNt(e),uL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),Rhe(mr),v5(),ik=!1,BB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=hL.get(t);r&&(hL.delete(t),r(e))},getMarkdown(){return tMe(mr)},getDocument(){return JSON.stringify(uQ(mr.getJSON()))},captureSelection(){const t=DBt(mr);return t?(fC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(mr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(fC=null,null)},applySelectionDraft(t,e){var a,o;const r=fC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return fC=null,!1;const n=mr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=mr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?OBt(mr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return mr.chain().focus().insertContentAt(d,h).run(),fC=null,ed(mr),!0}catch{return!1}},undo(){if(!mr.can().undo())return!1;const t=mr.commands.undo();return t&&ed(mr),t},focusEnd(){var t;try{mr.commands.focus("end")}catch{}try{const e=(t=mr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){ed(mr)},exec(t){var r;const e={bold:()=>mr.chain().focus().toggleBold().run(),bulletList:()=>mr.chain().focus().toggleBulletList().run(),taskList:()=>mr.chain().focus().toggleTaskList().run(),blockquote:()=>mr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>mr.chain().focus().setHorizontalRule().run(),heading2:()=>mr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>mr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),ed(mr)},beginImageUpload(t,e){mr.chain().focus().setImage({src:e,alt:t,width:Nue}).run();const r=Fo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(gBt(mr.state,{src:e,alt:r||t||"",width:Nue})),ed(mr))},groupImages(t){const e=mBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=Fo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=PBt(mr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){mr.commands.setTextSelection({from:i.from,to:i.to});try{const s=mr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}qa({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=BBt;rMe(!1);qa({type:"ready",startupMs:Math.round(performance.now()-TBt)});class Gt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15t.replace(FBt,"-$1").toLowerCase(),VBt={"&":"&",">":">","<":"<",'"':""","'":"'"},HBt=/[&><"']/g,Ho=t=>String(t).replace(HBt,e=>VBt[e]),jM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?jM(t.body[0]):t:t.type==="font"?jM(t.body):t,GBt=new Set(["mathord","textord","atom"]),q0=t=>GBt.has(jM(t).type),WBt=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},pL={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 "},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 ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function qBt(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function UBt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return qBt(e)}function YBt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:UBt(n)}class eJ{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(pL)){var n=pL[r];n&&YBt(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Gt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=WBt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class fp{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return ud[jBt[this.id]]}sub(){return ud[XBt[this.id]]}fracNum(){return ud[KBt[this.id]]}fracDen(){return ud[ZBt[this.id]]}cramp(){return ud[QBt[this.id]]}text(){return ud[JBt[this.id]]}isTight(){return this.size>=2}}var tJ=0,gL=1,Ob=2,a0=3,B6=4,xu=5,b5=6,Tl=7,ud=[new fp(tJ,0,!1),new fp(gL,0,!0),new fp(Ob,1,!1),new fp(a0,1,!0),new fp(B6,2,!1),new fp(xu,2,!0),new fp(b5,3,!1),new fp(Tl,3,!0)],jBt=[B6,xu,B6,xu,b5,Tl,b5,Tl],XBt=[xu,xu,xu,xu,Tl,Tl,Tl,Tl],KBt=[Ob,a0,B6,xu,b5,Tl,b5,Tl],ZBt=[a0,a0,xu,xu,Tl,Tl,Tl,Tl],QBt=[gL,gL,a0,a0,xu,xu,Tl,Tl],JBt=[tJ,gL,Ob,a0,Ob,a0,Ob,a0],dn={DISPLAY:ud[tJ],TEXT:ud[Ob],SCRIPT:ud[B6],SCRIPTSCRIPT:ud[b5]},IW=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function eFt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var XM=[];IW.forEach(t=>t.blocks.forEach(e=>XM.push(...e)));function nMe(t){for(var e=0;e=XM[e]&&t<=XM[e+1])return!0;return!1}var va=t=>t+" "+t,Yv=80,tFt=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -2558,7 +2565,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},zBt=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},rFt=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -2568,7 +2575,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},VBt=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},nFt=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -2577,7 +2584,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},HBt=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},iFt=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -2587,18 +2594,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},GBt=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},sFt=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},WBt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},qBt=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},aFt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},oFt=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},UBt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=FBt(r,qv);break;case"sqrtSize1":i=zBt(r,qv);break;case"sqrtSize2":i=VBt(r,qv);break;case"sqrtSize3":i=HBt(r,qv);break;case"sqrtSize4":i=GBt(r,qv);break;case"sqrtTall":i=qBt(r,qv,n)}return i},YBt=function(e,r){switch(e){case"⎜":return va("M291 0 H417 V"+r+" H291z");case"∣":return va("M145 0 H188 V"+r+" H145z");case"∥":return va("M145 0 H188 V"+r+" H145z")+va("M367 0 H410 V"+r+" H367z");case"⎟":return va("M457 0 H583 V"+r+" H457z");case"⎢":return va("M319 0 H403 V"+r+" H319z");case"⎥":return va("M263 0 H347 V"+r+" H263z");case"⎪":return va("M384 0 H504 V"+r+" H384z");case"⏐":return va("M312 0 H355 V"+r+" H312z");case"‖":return va("M257 0 H300 V"+r+" H257z")+va("M478 0 H521 V"+r+" H478z");default:return""}},hde={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},lFt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=tFt(r,Yv);break;case"sqrtSize1":i=rFt(r,Yv);break;case"sqrtSize2":i=nFt(r,Yv);break;case"sqrtSize3":i=iFt(r,Yv);break;case"sqrtSize4":i=sFt(r,Yv);break;case"sqrtTall":i=oFt(r,Yv,n)}return i},cFt=function(e,r){switch(e){case"⎜":return va("M291 0 H417 V"+r+" H291z");case"∣":return va("M145 0 H188 V"+r+" H145z");case"∥":return va("M145 0 H188 V"+r+" H145z")+va("M367 0 H410 V"+r+" H367z");case"⎟":return va("M457 0 H583 V"+r+" H457z");case"⎢":return va("M319 0 H403 V"+r+" H319z");case"⎥":return va("M263 0 H347 V"+r+" H263z");case"⎪":return va("M384 0 H504 V"+r+" H384z");case"⏐":return va("M312 0 H355 V"+r+" H312z");case"‖":return va("M257 0 H300 V"+r+" H257z")+va("M478 0 H521 V"+r+" H478z");default:return""}},yde={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 @@ -2769,7 +2776,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` 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`},jBt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},uFt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -2797,48 +2804,48 @@ 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 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function XBt(t){return"toText"in t}let p3=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(XBt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var RW={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},KBt={ex:!0,em:!0,mu:!0},Q8e=function(e){return typeof e!="string"&&(e=e.unit),e in RW||e in KBt||e==="ex"},xs=function(e,r){var n;if(e.unit in RW)n=RW[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Gt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Yt=function(e){return+e.toFixed(4)+"em"},wg=function(e){return e.filter(r=>r).join(" ")},QQ=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=kBt(n)+":"+i+";")}return r},J8e=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},eMe=function(e){var r=document.createElement(e);r.className=wg(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,tMe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Ho(wg(this.classes))+'"');var n=QQ(this.style);n&&(r+=' style="'+Ho(n)+'"');for(var i of Object.keys(this.attributes)){if(ZBt.test(i))throw new Gt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Ho(this.attributes[i])+'"'}r+=">";for(var s=0;s",r};class g3{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,J8e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return eMe.call(this,"span")}toMarkup(){return tMe.call(this,"span")}}let RD=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,J8e.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return eMe.call(this,"a")}toMarkup(){return tMe.call(this,"a")}};class QBt{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+Ho(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Yt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=wg(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+Yt(this.italic)+";"),n+=QQ(this.style),n&&(e=!0,r+=' style="'+Ho(n)+'"');var i=Ho(this.text);return e?(r+=">",r+=i,r+="",r):i}}class v0{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class _W{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var rFt=t=>t instanceof g3||t instanceof RD||t instanceof p3,pd={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},h8={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},dde={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function rMe(t,e){pd[t]=e}function JQ(t,e,r){if(!pd[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=pd[e][n];if(!i&&t[0]in dde&&(n=dde[t[0]].charCodeAt(0),i=pd[e][n]),!i&&r==="text"&&Z8e(n)&&(i=pd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var OB={};function nFt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!OB[e]){var r=OB[e]={cssEmPerMu:h8.quad[e]/18};for(var n in h8)h8.hasOwnProperty(n)&&(r[n]=h8[n][e])}return OB[e]}var ls={math:{},text:{}};function U(t,e,r,n,i,s){ls[t][i]={font:e,group:r,replace:n},s&&n&&(ls[t][n]=ls[t][i])}var se="math",Dt="text",ve="main",We="ams",fs="accent-token",hr="bin",$l="close",m3="inner",Vr="mathord",pa="op-token",Uc="open",u7="punct",Ye="rel",H0="spacing",Je="textord";U(se,ve,Ye,"≡","\\equiv",!0);U(se,ve,Ye,"≺","\\prec",!0);U(se,ve,Ye,"≻","\\succ",!0);U(se,ve,Ye,"∼","\\sim",!0);U(se,ve,Ye,"⊥","\\perp");U(se,ve,Ye,"⪯","\\preceq",!0);U(se,ve,Ye,"⪰","\\succeq",!0);U(se,ve,Ye,"≃","\\simeq",!0);U(se,ve,Ye,"∣","\\mid",!0);U(se,ve,Ye,"≪","\\ll",!0);U(se,ve,Ye,"≫","\\gg",!0);U(se,ve,Ye,"≍","\\asymp",!0);U(se,ve,Ye,"∥","\\parallel");U(se,ve,Ye,"⋈","\\bowtie",!0);U(se,ve,Ye,"⌣","\\smile",!0);U(se,ve,Ye,"⊑","\\sqsubseteq",!0);U(se,ve,Ye,"⊒","\\sqsupseteq",!0);U(se,ve,Ye,"≐","\\doteq",!0);U(se,ve,Ye,"⌢","\\frown",!0);U(se,ve,Ye,"∋","\\ni",!0);U(se,ve,Ye,"∝","\\propto",!0);U(se,ve,Ye,"⊢","\\vdash",!0);U(se,ve,Ye,"⊣","\\dashv",!0);U(se,ve,Ye,"∋","\\owns");U(se,ve,u7,".","\\ldotp");U(se,ve,u7,"⋅","\\cdotp");U(se,ve,u7,"⋅","·");U(Dt,ve,Je,"⋅","·");U(se,ve,Je,"#","\\#");U(Dt,ve,Je,"#","\\#");U(se,ve,Je,"&","\\&");U(Dt,ve,Je,"&","\\&");U(se,ve,Je,"ℵ","\\aleph",!0);U(se,ve,Je,"∀","\\forall",!0);U(se,ve,Je,"ℏ","\\hbar",!0);U(se,ve,Je,"∃","\\exists",!0);U(se,ve,Je,"∇","\\nabla",!0);U(se,ve,Je,"♭","\\flat",!0);U(se,ve,Je,"ℓ","\\ell",!0);U(se,ve,Je,"♮","\\natural",!0);U(se,ve,Je,"♣","\\clubsuit",!0);U(se,ve,Je,"℘","\\wp",!0);U(se,ve,Je,"♯","\\sharp",!0);U(se,ve,Je,"♢","\\diamondsuit",!0);U(se,ve,Je,"ℜ","\\Re",!0);U(se,ve,Je,"♡","\\heartsuit",!0);U(se,ve,Je,"ℑ","\\Im",!0);U(se,ve,Je,"♠","\\spadesuit",!0);U(se,ve,Je,"§","\\S",!0);U(Dt,ve,Je,"§","\\S");U(se,ve,Je,"¶","\\P",!0);U(Dt,ve,Je,"¶","\\P");U(se,ve,Je,"†","\\dag");U(Dt,ve,Je,"†","\\dag");U(Dt,ve,Je,"†","\\textdagger");U(se,ve,Je,"‡","\\ddag");U(Dt,ve,Je,"‡","\\ddag");U(Dt,ve,Je,"‡","\\textdaggerdbl");U(se,ve,$l,"⎱","\\rmoustache",!0);U(se,ve,Uc,"⎰","\\lmoustache",!0);U(se,ve,$l,"⟯","\\rgroup",!0);U(se,ve,Uc,"⟮","\\lgroup",!0);U(se,ve,hr,"∓","\\mp",!0);U(se,ve,hr,"⊖","\\ominus",!0);U(se,ve,hr,"⊎","\\uplus",!0);U(se,ve,hr,"⊓","\\sqcap",!0);U(se,ve,hr,"∗","\\ast");U(se,ve,hr,"⊔","\\sqcup",!0);U(se,ve,hr,"◯","\\bigcirc",!0);U(se,ve,hr,"∙","\\bullet",!0);U(se,ve,hr,"‡","\\ddagger");U(se,ve,hr,"≀","\\wr",!0);U(se,ve,hr,"⨿","\\amalg");U(se,ve,hr,"&","\\And");U(se,ve,Ye,"⟵","\\longleftarrow",!0);U(se,ve,Ye,"⇐","\\Leftarrow",!0);U(se,ve,Ye,"⟸","\\Longleftarrow",!0);U(se,ve,Ye,"⟶","\\longrightarrow",!0);U(se,ve,Ye,"⇒","\\Rightarrow",!0);U(se,ve,Ye,"⟹","\\Longrightarrow",!0);U(se,ve,Ye,"↔","\\leftrightarrow",!0);U(se,ve,Ye,"⟷","\\longleftrightarrow",!0);U(se,ve,Ye,"⇔","\\Leftrightarrow",!0);U(se,ve,Ye,"⟺","\\Longleftrightarrow",!0);U(se,ve,Ye,"↦","\\mapsto",!0);U(se,ve,Ye,"⟼","\\longmapsto",!0);U(se,ve,Ye,"↗","\\nearrow",!0);U(se,ve,Ye,"↩","\\hookleftarrow",!0);U(se,ve,Ye,"↪","\\hookrightarrow",!0);U(se,ve,Ye,"↘","\\searrow",!0);U(se,ve,Ye,"↼","\\leftharpoonup",!0);U(se,ve,Ye,"⇀","\\rightharpoonup",!0);U(se,ve,Ye,"↙","\\swarrow",!0);U(se,ve,Ye,"↽","\\leftharpoondown",!0);U(se,ve,Ye,"⇁","\\rightharpoondown",!0);U(se,ve,Ye,"↖","\\nwarrow",!0);U(se,ve,Ye,"⇌","\\rightleftharpoons",!0);U(se,We,Ye,"≮","\\nless",!0);U(se,We,Ye,"","\\@nleqslant");U(se,We,Ye,"","\\@nleqq");U(se,We,Ye,"⪇","\\lneq",!0);U(se,We,Ye,"≨","\\lneqq",!0);U(se,We,Ye,"","\\@lvertneqq");U(se,We,Ye,"⋦","\\lnsim",!0);U(se,We,Ye,"⪉","\\lnapprox",!0);U(se,We,Ye,"⊀","\\nprec",!0);U(se,We,Ye,"⋠","\\npreceq",!0);U(se,We,Ye,"⋨","\\precnsim",!0);U(se,We,Ye,"⪹","\\precnapprox",!0);U(se,We,Ye,"≁","\\nsim",!0);U(se,We,Ye,"","\\@nshortmid");U(se,We,Ye,"∤","\\nmid",!0);U(se,We,Ye,"⊬","\\nvdash",!0);U(se,We,Ye,"⊭","\\nvDash",!0);U(se,We,Ye,"⋪","\\ntriangleleft");U(se,We,Ye,"⋬","\\ntrianglelefteq",!0);U(se,We,Ye,"⊊","\\subsetneq",!0);U(se,We,Ye,"","\\@varsubsetneq");U(se,We,Ye,"⫋","\\subsetneqq",!0);U(se,We,Ye,"","\\@varsubsetneqq");U(se,We,Ye,"≯","\\ngtr",!0);U(se,We,Ye,"","\\@ngeqslant");U(se,We,Ye,"","\\@ngeqq");U(se,We,Ye,"⪈","\\gneq",!0);U(se,We,Ye,"≩","\\gneqq",!0);U(se,We,Ye,"","\\@gvertneqq");U(se,We,Ye,"⋧","\\gnsim",!0);U(se,We,Ye,"⪊","\\gnapprox",!0);U(se,We,Ye,"⊁","\\nsucc",!0);U(se,We,Ye,"⋡","\\nsucceq",!0);U(se,We,Ye,"⋩","\\succnsim",!0);U(se,We,Ye,"⪺","\\succnapprox",!0);U(se,We,Ye,"≆","\\ncong",!0);U(se,We,Ye,"","\\@nshortparallel");U(se,We,Ye,"∦","\\nparallel",!0);U(se,We,Ye,"⊯","\\nVDash",!0);U(se,We,Ye,"⋫","\\ntriangleright");U(se,We,Ye,"⋭","\\ntrianglerighteq",!0);U(se,We,Ye,"","\\@nsupseteqq");U(se,We,Ye,"⊋","\\supsetneq",!0);U(se,We,Ye,"","\\@varsupsetneq");U(se,We,Ye,"⫌","\\supsetneqq",!0);U(se,We,Ye,"","\\@varsupsetneqq");U(se,We,Ye,"⊮","\\nVdash",!0);U(se,We,Ye,"⪵","\\precneqq",!0);U(se,We,Ye,"⪶","\\succneqq",!0);U(se,We,Ye,"","\\@nsubseteqq");U(se,We,hr,"⊴","\\unlhd");U(se,We,hr,"⊵","\\unrhd");U(se,We,Ye,"↚","\\nleftarrow",!0);U(se,We,Ye,"↛","\\nrightarrow",!0);U(se,We,Ye,"⇍","\\nLeftarrow",!0);U(se,We,Ye,"⇏","\\nRightarrow",!0);U(se,We,Ye,"↮","\\nleftrightarrow",!0);U(se,We,Ye,"⇎","\\nLeftrightarrow",!0);U(se,We,Ye,"△","\\vartriangle");U(se,We,Je,"ℏ","\\hslash");U(se,We,Je,"▽","\\triangledown");U(se,We,Je,"◊","\\lozenge");U(se,We,Je,"Ⓢ","\\circledS");U(se,We,Je,"®","\\circledR");U(Dt,We,Je,"®","\\circledR");U(se,We,Je,"∡","\\measuredangle",!0);U(se,We,Je,"∄","\\nexists");U(se,We,Je,"℧","\\mho");U(se,We,Je,"Ⅎ","\\Finv",!0);U(se,We,Je,"⅁","\\Game",!0);U(se,We,Je,"‵","\\backprime");U(se,We,Je,"▲","\\blacktriangle");U(se,We,Je,"▼","\\blacktriangledown");U(se,We,Je,"■","\\blacksquare");U(se,We,Je,"⧫","\\blacklozenge");U(se,We,Je,"★","\\bigstar");U(se,We,Je,"∢","\\sphericalangle",!0);U(se,We,Je,"∁","\\complement",!0);U(se,We,Je,"ð","\\eth",!0);U(Dt,ve,Je,"ð","ð");U(se,We,Je,"╱","\\diagup");U(se,We,Je,"╲","\\diagdown");U(se,We,Je,"□","\\square");U(se,We,Je,"□","\\Box");U(se,We,Je,"◊","\\Diamond");U(se,We,Je,"¥","\\yen",!0);U(Dt,We,Je,"¥","\\yen",!0);U(se,We,Je,"✓","\\checkmark",!0);U(Dt,We,Je,"✓","\\checkmark");U(se,We,Je,"ℶ","\\beth",!0);U(se,We,Je,"ℸ","\\daleth",!0);U(se,We,Je,"ℷ","\\gimel",!0);U(se,We,Je,"ϝ","\\digamma",!0);U(se,We,Je,"ϰ","\\varkappa");U(se,We,Uc,"┌","\\@ulcorner",!0);U(se,We,$l,"┐","\\@urcorner",!0);U(se,We,Uc,"└","\\@llcorner",!0);U(se,We,$l,"┘","\\@lrcorner",!0);U(se,We,Ye,"≦","\\leqq",!0);U(se,We,Ye,"⩽","\\leqslant",!0);U(se,We,Ye,"⪕","\\eqslantless",!0);U(se,We,Ye,"≲","\\lesssim",!0);U(se,We,Ye,"⪅","\\lessapprox",!0);U(se,We,Ye,"≊","\\approxeq",!0);U(se,We,hr,"⋖","\\lessdot");U(se,We,Ye,"⋘","\\lll",!0);U(se,We,Ye,"≶","\\lessgtr",!0);U(se,We,Ye,"⋚","\\lesseqgtr",!0);U(se,We,Ye,"⪋","\\lesseqqgtr",!0);U(se,We,Ye,"≑","\\doteqdot");U(se,We,Ye,"≓","\\risingdotseq",!0);U(se,We,Ye,"≒","\\fallingdotseq",!0);U(se,We,Ye,"∽","\\backsim",!0);U(se,We,Ye,"⋍","\\backsimeq",!0);U(se,We,Ye,"⫅","\\subseteqq",!0);U(se,We,Ye,"⋐","\\Subset",!0);U(se,We,Ye,"⊏","\\sqsubset",!0);U(se,We,Ye,"≼","\\preccurlyeq",!0);U(se,We,Ye,"⋞","\\curlyeqprec",!0);U(se,We,Ye,"≾","\\precsim",!0);U(se,We,Ye,"⪷","\\precapprox",!0);U(se,We,Ye,"⊲","\\vartriangleleft");U(se,We,Ye,"⊴","\\trianglelefteq");U(se,We,Ye,"⊨","\\vDash",!0);U(se,We,Ye,"⊪","\\Vvdash",!0);U(se,We,Ye,"⌣","\\smallsmile");U(se,We,Ye,"⌢","\\smallfrown");U(se,We,Ye,"≏","\\bumpeq",!0);U(se,We,Ye,"≎","\\Bumpeq",!0);U(se,We,Ye,"≧","\\geqq",!0);U(se,We,Ye,"⩾","\\geqslant",!0);U(se,We,Ye,"⪖","\\eqslantgtr",!0);U(se,We,Ye,"≳","\\gtrsim",!0);U(se,We,Ye,"⪆","\\gtrapprox",!0);U(se,We,hr,"⋗","\\gtrdot");U(se,We,Ye,"⋙","\\ggg",!0);U(se,We,Ye,"≷","\\gtrless",!0);U(se,We,Ye,"⋛","\\gtreqless",!0);U(se,We,Ye,"⪌","\\gtreqqless",!0);U(se,We,Ye,"≖","\\eqcirc",!0);U(se,We,Ye,"≗","\\circeq",!0);U(se,We,Ye,"≜","\\triangleq",!0);U(se,We,Ye,"∼","\\thicksim");U(se,We,Ye,"≈","\\thickapprox");U(se,We,Ye,"⫆","\\supseteqq",!0);U(se,We,Ye,"⋑","\\Supset",!0);U(se,We,Ye,"⊐","\\sqsupset",!0);U(se,We,Ye,"≽","\\succcurlyeq",!0);U(se,We,Ye,"⋟","\\curlyeqsucc",!0);U(se,We,Ye,"≿","\\succsim",!0);U(se,We,Ye,"⪸","\\succapprox",!0);U(se,We,Ye,"⊳","\\vartriangleright");U(se,We,Ye,"⊵","\\trianglerighteq");U(se,We,Ye,"⊩","\\Vdash",!0);U(se,We,Ye,"∣","\\shortmid");U(se,We,Ye,"∥","\\shortparallel");U(se,We,Ye,"≬","\\between",!0);U(se,We,Ye,"⋔","\\pitchfork",!0);U(se,We,Ye,"∝","\\varpropto");U(se,We,Ye,"◀","\\blacktriangleleft");U(se,We,Ye,"∴","\\therefore",!0);U(se,We,Ye,"∍","\\backepsilon");U(se,We,Ye,"▶","\\blacktriangleright");U(se,We,Ye,"∵","\\because",!0);U(se,We,Ye,"⋘","\\llless");U(se,We,Ye,"⋙","\\gggtr");U(se,We,hr,"⊲","\\lhd");U(se,We,hr,"⊳","\\rhd");U(se,We,Ye,"≂","\\eqsim",!0);U(se,ve,Ye,"⋈","\\Join");U(se,We,Ye,"≑","\\Doteq",!0);U(se,We,hr,"∔","\\dotplus",!0);U(se,We,hr,"∖","\\smallsetminus");U(se,We,hr,"⋒","\\Cap",!0);U(se,We,hr,"⋓","\\Cup",!0);U(se,We,hr,"⩞","\\doublebarwedge",!0);U(se,We,hr,"⊟","\\boxminus",!0);U(se,We,hr,"⊞","\\boxplus",!0);U(se,We,hr,"⋇","\\divideontimes",!0);U(se,We,hr,"⋉","\\ltimes",!0);U(se,We,hr,"⋊","\\rtimes",!0);U(se,We,hr,"⋋","\\leftthreetimes",!0);U(se,We,hr,"⋌","\\rightthreetimes",!0);U(se,We,hr,"⋏","\\curlywedge",!0);U(se,We,hr,"⋎","\\curlyvee",!0);U(se,We,hr,"⊝","\\circleddash",!0);U(se,We,hr,"⊛","\\circledast",!0);U(se,We,hr,"⋅","\\centerdot");U(se,We,hr,"⊺","\\intercal",!0);U(se,We,hr,"⋒","\\doublecap");U(se,We,hr,"⋓","\\doublecup");U(se,We,hr,"⊠","\\boxtimes",!0);U(se,We,Ye,"⇢","\\dashrightarrow",!0);U(se,We,Ye,"⇠","\\dashleftarrow",!0);U(se,We,Ye,"⇇","\\leftleftarrows",!0);U(se,We,Ye,"⇆","\\leftrightarrows",!0);U(se,We,Ye,"⇚","\\Lleftarrow",!0);U(se,We,Ye,"↞","\\twoheadleftarrow",!0);U(se,We,Ye,"↢","\\leftarrowtail",!0);U(se,We,Ye,"↫","\\looparrowleft",!0);U(se,We,Ye,"⇋","\\leftrightharpoons",!0);U(se,We,Ye,"↶","\\curvearrowleft",!0);U(se,We,Ye,"↺","\\circlearrowleft",!0);U(se,We,Ye,"↰","\\Lsh",!0);U(se,We,Ye,"⇈","\\upuparrows",!0);U(se,We,Ye,"↿","\\upharpoonleft",!0);U(se,We,Ye,"⇃","\\downharpoonleft",!0);U(se,ve,Ye,"⊶","\\origof",!0);U(se,ve,Ye,"⊷","\\imageof",!0);U(se,We,Ye,"⊸","\\multimap",!0);U(se,We,Ye,"↭","\\leftrightsquigarrow",!0);U(se,We,Ye,"⇉","\\rightrightarrows",!0);U(se,We,Ye,"⇄","\\rightleftarrows",!0);U(se,We,Ye,"↠","\\twoheadrightarrow",!0);U(se,We,Ye,"↣","\\rightarrowtail",!0);U(se,We,Ye,"↬","\\looparrowright",!0);U(se,We,Ye,"↷","\\curvearrowright",!0);U(se,We,Ye,"↻","\\circlearrowright",!0);U(se,We,Ye,"↱","\\Rsh",!0);U(se,We,Ye,"⇊","\\downdownarrows",!0);U(se,We,Ye,"↾","\\upharpoonright",!0);U(se,We,Ye,"⇂","\\downharpoonright",!0);U(se,We,Ye,"⇝","\\rightsquigarrow",!0);U(se,We,Ye,"⇝","\\leadsto");U(se,We,Ye,"⇛","\\Rrightarrow",!0);U(se,We,Ye,"↾","\\restriction");U(se,ve,Je,"‘","`");U(se,ve,Je,"$","\\$");U(Dt,ve,Je,"$","\\$");U(Dt,ve,Je,"$","\\textdollar");U(se,ve,Je,"%","\\%");U(Dt,ve,Je,"%","\\%");U(se,ve,Je,"_","\\_");U(Dt,ve,Je,"_","\\_");U(Dt,ve,Je,"_","\\textunderscore");U(se,ve,Je,"∠","\\angle",!0);U(se,ve,Je,"∞","\\infty",!0);U(se,ve,Je,"′","\\prime");U(se,ve,Je,"△","\\triangle");U(se,ve,Je,"Γ","\\Gamma",!0);U(se,ve,Je,"Δ","\\Delta",!0);U(se,ve,Je,"Θ","\\Theta",!0);U(se,ve,Je,"Λ","\\Lambda",!0);U(se,ve,Je,"Ξ","\\Xi",!0);U(se,ve,Je,"Π","\\Pi",!0);U(se,ve,Je,"Σ","\\Sigma",!0);U(se,ve,Je,"Υ","\\Upsilon",!0);U(se,ve,Je,"Φ","\\Phi",!0);U(se,ve,Je,"Ψ","\\Psi",!0);U(se,ve,Je,"Ω","\\Omega",!0);U(se,ve,Je,"A","Α");U(se,ve,Je,"B","Β");U(se,ve,Je,"E","Ε");U(se,ve,Je,"Z","Ζ");U(se,ve,Je,"H","Η");U(se,ve,Je,"I","Ι");U(se,ve,Je,"K","Κ");U(se,ve,Je,"M","Μ");U(se,ve,Je,"N","Ν");U(se,ve,Je,"O","Ο");U(se,ve,Je,"P","Ρ");U(se,ve,Je,"T","Τ");U(se,ve,Je,"X","Χ");U(se,ve,Je,"¬","\\neg",!0);U(se,ve,Je,"¬","\\lnot");U(se,ve,Je,"⊤","\\top");U(se,ve,Je,"⊥","\\bot");U(se,ve,Je,"∅","\\emptyset");U(se,We,Je,"∅","\\varnothing");U(se,ve,Vr,"α","\\alpha",!0);U(se,ve,Vr,"β","\\beta",!0);U(se,ve,Vr,"γ","\\gamma",!0);U(se,ve,Vr,"δ","\\delta",!0);U(se,ve,Vr,"ϵ","\\epsilon",!0);U(se,ve,Vr,"ζ","\\zeta",!0);U(se,ve,Vr,"η","\\eta",!0);U(se,ve,Vr,"θ","\\theta",!0);U(se,ve,Vr,"ι","\\iota",!0);U(se,ve,Vr,"κ","\\kappa",!0);U(se,ve,Vr,"λ","\\lambda",!0);U(se,ve,Vr,"μ","\\mu",!0);U(se,ve,Vr,"ν","\\nu",!0);U(se,ve,Vr,"ξ","\\xi",!0);U(se,ve,Vr,"ο","\\omicron",!0);U(se,ve,Vr,"π","\\pi",!0);U(se,ve,Vr,"ρ","\\rho",!0);U(se,ve,Vr,"σ","\\sigma",!0);U(se,ve,Vr,"τ","\\tau",!0);U(se,ve,Vr,"υ","\\upsilon",!0);U(se,ve,Vr,"ϕ","\\phi",!0);U(se,ve,Vr,"χ","\\chi",!0);U(se,ve,Vr,"ψ","\\psi",!0);U(se,ve,Vr,"ω","\\omega",!0);U(se,ve,Vr,"ε","\\varepsilon",!0);U(se,ve,Vr,"ϑ","\\vartheta",!0);U(se,ve,Vr,"ϖ","\\varpi",!0);U(se,ve,Vr,"ϱ","\\varrho",!0);U(se,ve,Vr,"ς","\\varsigma",!0);U(se,ve,Vr,"φ","\\varphi",!0);U(se,ve,hr,"∗","*",!0);U(se,ve,hr,"+","+");U(se,ve,hr,"−","-",!0);U(se,ve,hr,"⋅","\\cdot",!0);U(se,ve,hr,"∘","\\circ",!0);U(se,ve,hr,"÷","\\div",!0);U(se,ve,hr,"±","\\pm",!0);U(se,ve,hr,"×","\\times",!0);U(se,ve,hr,"∩","\\cap",!0);U(se,ve,hr,"∪","\\cup",!0);U(se,ve,hr,"∖","\\setminus",!0);U(se,ve,hr,"∧","\\land");U(se,ve,hr,"∨","\\lor");U(se,ve,hr,"∧","\\wedge",!0);U(se,ve,hr,"∨","\\vee",!0);U(se,ve,Je,"√","\\surd");U(se,ve,Uc,"⟨","\\langle",!0);U(se,ve,Uc,"∣","\\lvert");U(se,ve,Uc,"∥","\\lVert");U(se,ve,$l,"?","?");U(se,ve,$l,"!","!");U(se,ve,$l,"⟩","\\rangle",!0);U(se,ve,$l,"∣","\\rvert");U(se,ve,$l,"∥","\\rVert");U(se,ve,Ye,"=","=");U(se,ve,Ye,":",":");U(se,ve,Ye,"≈","\\approx",!0);U(se,ve,Ye,"≅","\\cong",!0);U(se,ve,Ye,"≥","\\ge");U(se,ve,Ye,"≥","\\geq",!0);U(se,ve,Ye,"←","\\gets");U(se,ve,Ye,">","\\gt",!0);U(se,ve,Ye,"∈","\\in",!0);U(se,ve,Ye,"","\\@not");U(se,ve,Ye,"⊂","\\subset",!0);U(se,ve,Ye,"⊃","\\supset",!0);U(se,ve,Ye,"⊆","\\subseteq",!0);U(se,ve,Ye,"⊇","\\supseteq",!0);U(se,We,Ye,"⊈","\\nsubseteq",!0);U(se,We,Ye,"⊉","\\nsupseteq",!0);U(se,ve,Ye,"⊨","\\models");U(se,ve,Ye,"←","\\leftarrow",!0);U(se,ve,Ye,"≤","\\le");U(se,ve,Ye,"≤","\\leq",!0);U(se,ve,Ye,"<","\\lt",!0);U(se,ve,Ye,"→","\\rightarrow",!0);U(se,ve,Ye,"→","\\to");U(se,We,Ye,"≱","\\ngeq",!0);U(se,We,Ye,"≰","\\nleq",!0);U(se,ve,H0," ","\\ ");U(se,ve,H0," ","\\space");U(se,ve,H0," ","\\nobreakspace");U(Dt,ve,H0," ","\\ ");U(Dt,ve,H0," "," ");U(Dt,ve,H0," ","\\space");U(Dt,ve,H0," ","\\nobreakspace");U(se,ve,H0,"","\\nobreak");U(se,ve,H0,"","\\allowbreak");U(se,ve,u7,",",",");U(se,ve,u7,";",";");U(se,We,hr,"⊼","\\barwedge",!0);U(se,We,hr,"⊻","\\veebar",!0);U(se,ve,hr,"⊙","\\odot",!0);U(se,ve,hr,"⊕","\\oplus",!0);U(se,ve,hr,"⊗","\\otimes",!0);U(se,ve,Je,"∂","\\partial",!0);U(se,ve,hr,"⊘","\\oslash",!0);U(se,We,hr,"⊚","\\circledcirc",!0);U(se,We,hr,"⊡","\\boxdot",!0);U(se,ve,hr,"△","\\bigtriangleup");U(se,ve,hr,"▽","\\bigtriangledown");U(se,ve,hr,"†","\\dagger");U(se,ve,hr,"⋄","\\diamond");U(se,ve,hr,"⋆","\\star");U(se,ve,hr,"◃","\\triangleleft");U(se,ve,hr,"▹","\\triangleright");U(se,ve,Uc,"{","\\{");U(Dt,ve,Je,"{","\\{");U(Dt,ve,Je,"{","\\textbraceleft");U(se,ve,$l,"}","\\}");U(Dt,ve,Je,"}","\\}");U(Dt,ve,Je,"}","\\textbraceright");U(se,ve,Uc,"{","\\lbrace");U(se,ve,$l,"}","\\rbrace");U(se,ve,Uc,"[","\\lbrack",!0);U(Dt,ve,Je,"[","\\lbrack",!0);U(se,ve,$l,"]","\\rbrack",!0);U(Dt,ve,Je,"]","\\rbrack",!0);U(se,ve,Uc,"(","\\lparen",!0);U(se,ve,$l,")","\\rparen",!0);U(Dt,ve,Je,"<","\\textless",!0);U(Dt,ve,Je,">","\\textgreater",!0);U(se,ve,Uc,"⌊","\\lfloor",!0);U(se,ve,$l,"⌋","\\rfloor",!0);U(se,ve,Uc,"⌈","\\lceil",!0);U(se,ve,$l,"⌉","\\rceil",!0);U(se,ve,Je,"\\","\\backslash");U(se,ve,Je,"∣","|");U(se,ve,Je,"∣","\\vert");U(Dt,ve,Je,"|","\\textbar",!0);U(se,ve,Je,"∥","\\|");U(se,ve,Je,"∥","\\Vert");U(Dt,ve,Je,"∥","\\textbardbl");U(Dt,ve,Je,"~","\\textasciitilde");U(Dt,ve,Je,"\\","\\textbackslash");U(Dt,ve,Je,"^","\\textasciicircum");U(se,ve,Ye,"↑","\\uparrow",!0);U(se,ve,Ye,"⇑","\\Uparrow",!0);U(se,ve,Ye,"↓","\\downarrow",!0);U(se,ve,Ye,"⇓","\\Downarrow",!0);U(se,ve,Ye,"↕","\\updownarrow",!0);U(se,ve,Ye,"⇕","\\Updownarrow",!0);U(se,ve,pa,"∐","\\coprod");U(se,ve,pa,"⋁","\\bigvee");U(se,ve,pa,"⋀","\\bigwedge");U(se,ve,pa,"⨄","\\biguplus");U(se,ve,pa,"⋂","\\bigcap");U(se,ve,pa,"⋃","\\bigcup");U(se,ve,pa,"∫","\\int");U(se,ve,pa,"∫","\\intop");U(se,ve,pa,"∬","\\iint");U(se,ve,pa,"∭","\\iiint");U(se,ve,pa,"∏","\\prod");U(se,ve,pa,"∑","\\sum");U(se,ve,pa,"⨂","\\bigotimes");U(se,ve,pa,"⨁","\\bigoplus");U(se,ve,pa,"⨀","\\bigodot");U(se,ve,pa,"∮","\\oint");U(se,ve,pa,"∯","\\oiint");U(se,ve,pa,"∰","\\oiiint");U(se,ve,pa,"⨆","\\bigsqcup");U(se,ve,pa,"∫","\\smallint");U(Dt,ve,m3,"…","\\textellipsis");U(se,ve,m3,"…","\\mathellipsis");U(Dt,ve,m3,"…","\\ldots",!0);U(se,ve,m3,"…","\\ldots",!0);U(se,ve,m3,"⋯","\\@cdots",!0);U(se,ve,m3,"⋱","\\ddots",!0);U(se,ve,Je,"⋮","\\varvdots");U(Dt,ve,Je,"⋮","\\varvdots");U(se,ve,fs,"ˊ","\\acute");U(se,ve,fs,"ˋ","\\grave");U(se,ve,fs,"¨","\\ddot");U(se,ve,fs,"~","\\tilde");U(se,ve,fs,"ˉ","\\bar");U(se,ve,fs,"˘","\\breve");U(se,ve,fs,"ˇ","\\check");U(se,ve,fs,"^","\\hat");U(se,ve,fs,"⃗","\\vec");U(se,ve,fs,"˙","\\dot");U(se,ve,fs,"˚","\\mathring");U(se,ve,Vr,"","\\@imath");U(se,ve,Vr,"","\\@jmath");U(se,ve,Je,"ı","ı");U(se,ve,Je,"ȷ","ȷ");U(Dt,ve,Je,"ı","\\i",!0);U(Dt,ve,Je,"ȷ","\\j",!0);U(Dt,ve,Je,"ß","\\ss",!0);U(Dt,ve,Je,"æ","\\ae",!0);U(Dt,ve,Je,"œ","\\oe",!0);U(Dt,ve,Je,"ø","\\o",!0);U(Dt,ve,Je,"Æ","\\AE",!0);U(Dt,ve,Je,"Œ","\\OE",!0);U(Dt,ve,Je,"Ø","\\O",!0);U(Dt,ve,fs,"ˊ","\\'");U(Dt,ve,fs,"ˋ","\\`");U(Dt,ve,fs,"ˆ","\\^");U(Dt,ve,fs,"˜","\\~");U(Dt,ve,fs,"ˉ","\\=");U(Dt,ve,fs,"˘","\\u");U(Dt,ve,fs,"˙","\\.");U(Dt,ve,fs,"¸","\\c");U(Dt,ve,fs,"˚","\\r");U(Dt,ve,fs,"ˇ","\\v");U(Dt,ve,fs,"¨",'\\"');U(Dt,ve,fs,"˝","\\H");U(Dt,ve,fs,"◯","\\textcircled");var nMe={"--":!0,"---":!0,"``":!0,"''":!0};U(Dt,ve,Je,"–","--",!0);U(Dt,ve,Je,"–","\\textendash");U(Dt,ve,Je,"—","---",!0);U(Dt,ve,Je,"—","\\textemdash");U(Dt,ve,Je,"‘","`",!0);U(Dt,ve,Je,"‘","\\textquoteleft");U(Dt,ve,Je,"’","'",!0);U(Dt,ve,Je,"’","\\textquoteright");U(Dt,ve,Je,"“","``",!0);U(Dt,ve,Je,"“","\\textquotedblleft");U(Dt,ve,Je,"”","''",!0);U(Dt,ve,Je,"”","\\textquotedblright");U(se,ve,Je,"°","\\degree",!0);U(Dt,ve,Je,"°","\\degree");U(Dt,ve,Je,"°","\\textdegree",!0);U(se,ve,Je,"£","\\pounds");U(se,ve,Je,"£","\\mathsterling",!0);U(Dt,ve,Je,"£","\\pounds");U(Dt,ve,Je,"£","\\textsterling",!0);U(se,We,Je,"✠","\\maltese");U(Dt,We,Je,"✠","\\maltese");var fde='0123456789/@."';for(var PB=0;PB{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return Cde[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return sFt[s]}else{if(n===120485||n===120486)return Cde[0];if(120486{if(wg(t.classes)!==wg(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},iMe=t=>{for(var e=0;er&&(r=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Ft=function(e,r,n,i){var s=new g3(e,r,n,i);return tJ(s),s},Cg=(t,e,r,n)=>new g3(t,e,r,n),y5=function(e,r,n){var i=Ft([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Yt(i.height),i.maxFontSize=1,i},cFt=function(e,r,n,i){var s=new RD(e,r,n,i);return tJ(s),s},G0=function(e){var r=new p3(e);return tJ(r),r},v5=function(e,r){return e instanceof p3?Ft([],[e],r):e},uFt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,a=1;a{var r=Ft(["mspace"],[],e),n=xs(t,e);return r.style.marginRight=Yt(n),r},p8=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},PW={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},aMe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},oMe=function(e,r){var[n,i,s]=aMe[e],a=new Tg(n),o=new v0([a],{width:Yt(i),height:Yt(s),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Cg(["overlay"],[o],r);return l.height=s,l.style.height=Yt(s),l.style.width=Yt(i),l},vs={number:3,unit:"mu"},Rm={number:4,unit:"mu"},hf={number:5,unit:"mu"},hFt={mord:{mop:vs,mbin:Rm,mrel:hf,minner:vs},mop:{mord:vs,mop:vs,mrel:hf,minner:vs},mbin:{mord:Rm,mop:Rm,mopen:Rm,minner:Rm},mrel:{mord:hf,mop:hf,mopen:hf,minner:hf},mopen:{},mclose:{mop:vs,mbin:Rm,mrel:hf,minner:vs},mpunct:{mord:vs,mop:vs,mrel:hf,mopen:vs,mclose:vs,mpunct:vs,minner:vs},minner:{mord:vs,mop:vs,mbin:Rm,mrel:hf,mopen:vs,mpunct:vs,minner:vs}},dFt={mord:{mop:vs},mop:{mord:vs,mop:vs},mbin:{},mrel:{},mopen:{},mclose:{mop:vs},mpunct:{},minner:{mop:vs}},lMe={},pL={},gL={};function sr(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&pFt.has(v)?m.classes[0]="mord":v==="mbin"&&fFt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),$W(s,(g,m)=>{var y,v,x=FW(m),b=FW(g),T=x&&b?g.hasClass("mtight")?(y=dFt[x])==null?void 0:y[b]:(v=hFt[x])==null?void 0:v[b]:null;if(T)return sMe(T,u)},{node:d},f,p),s},$W=function(e,r,n,i,s){i&&e.push(i);for(var a=0;af=>{e.splice(d+1,0,f),a++})(a)}i&&e.pop()},cMe=function(e){return e instanceof p3||e instanceof RD||e instanceof g3&&e.hasClass("enclosing")?e:null},BW=function(e,r){var n=cMe(e);if(n){var i=n.children;if(i.length){if(r==="right")return BW(i[i.length-1],"right");if(r==="left")return BW(i[0],"left")}}return e},FW=function(e,r){if(!e)return null;r&&(e=BW(e,r));var n=e.classes[0];return mFt[n]||null},P6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ft(r.concat(n))},ci=function(e,r,n){if(!e)return Ft();if(pL[e.type]){var i=pL[e.type](e,r);if(n&&r.size!==n.size){i=Ft(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Gt("Got group of unknown type: '"+e.type+"'")};function g8(t,e){var r=Ft(["base"],t,e),n=Ft(["strut"]);return n.style.height=Yt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Yt(-r.depth)),r.children.unshift(n),r}function zW(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=_a(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(g8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(g8(a,e));var u;r?(u=g8(_a(r,e,!0),e),u.classes=["tag"],s.push(u)):i&&s.push(i);var h=Ft(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Yt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Yt(-h.depth))}return h}function uMe(t){return new p3(t)}class qt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=wg(this.classes));for(var n=0;n0&&(e+=' class ="'+Ho(wg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ua{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ho(this.toText())}toText(){return this.text}}class hMe{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Yt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var yFt=new Set(["\\imath","\\jmath"]),vFt=new Set(["mrow","mtable"]),Ru=function(e,r,n){return ls[r][e]&&ls[r][e].replace&&e.charCodeAt(0)!==55349&&!(nMe.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ls[r][e].replace),new ua(e)},rJ=function(e){return e.length===1?e[0]:new qt("mrow",e)},bFt={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},nJ=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=bFt[r];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(yFt.has(s))return null;if(ls[n][s]){var a=ls[n][s].replace;a&&(s=a)}var o=PW[r].fontName;return JQ(s,o,n)?PW[r].variant:null};function zB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ua&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof ua&&r.text===","}else return!1}var Yc=function(e,r,n){if(e.length===1){var i=Mi(e[0],r);return n&&i instanceof qt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||zB(a))){var u=l.children[0];u instanceof qt&&u.type==="mn"&&(u.children=[...a.children,...u.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof ua&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ua&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},kg=function(e,r,n){return rJ(Yc(e,r,n))},Mi=function(e,r){if(!e)return new qt("mrow");if(gL[e.type])return gL[e.type](e,r);throw new Gt("Got group of unknown type: '"+e.type+"'")};function kde(t,e,r,n,i){var s=Yc(t,r),a;s.length===1&&s[0]instanceof qt&&vFt.has(s[0].type)?a=s[0]:a=new qt("mrow",s);var o=new qt("annotation",[new ua(e)]);o.setAttribute("encoding","application/x-tex");var l=new qt("semantics",[a,o]),u=new qt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Ft([h],[u])}var xFt=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Sde=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ede=function(e,r){return r.size<2?e:xFt[e-1][r.size-1]};class Af{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Af.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Sde[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Af(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Ede(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Sde[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Ede(Af.BASESIZE,e);return this.size===r&&this.textSize===Af.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Af.BASESIZE?["sizing","reset-size"+this.size,"size"+Af.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=nFt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Af.BASESIZE=6;var dMe=function(e){return new Af({style:e.displayMode?dn.DISPLAY:dn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},fMe=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Ft(n,[e])}return e},wFt=function(e,r,n){var i=dMe(n),s;if(n.output==="mathml")return kde(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=zW(e,i);s=Ft(["katex"],[a])}else{var o=kde(e,r,i,n.displayMode,!1),l=zW(e,i);s=Ft(["katex"],[o,l])}return fMe(s,n)},TFt=function(e,r,n){var i=dMe(n),s=zW(e,i),a=Ft(["katex"],[s]);return fMe(a,n)},CFt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},ID=function(e){var r=new qt("mo",[new ua(CFt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},kFt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},SFt=new Set(["widehat","widecheck","widetilde","utilde"]),ND=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(SFt.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new Tg(d),m=new v0([g],{width:"100%",height:Yt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Cg([],[m],r),minWidth:0,height:f}}else{var y=[],v=kFt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,T]=v,C=T/1e3,S=x.length,k,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],E=[v[3]]}else if(S===2)k=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)k=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+S+" children.");for(var A=0;A0&&(i.style.minWidth=Yt(s)),i},EFt=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=Ft(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new _W({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new _W({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new v0(u,{width:"100%",height:Yt(o)});a=Cg([],[h],s)}return a.height=o,a.style.height=Yt(o),a},AFt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},MFt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function RFt(t){return t in AFt}function bn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function DD(t){var e=OD(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function OD(t){return t&&(t.type==="atom"||MFt.hasOwnProperty(t.type))?t:null}var pMe=t=>{if(t instanceof Vc)return t;if(rFt(t)&&t.children.length===1)return pMe(t.children[0])},iJ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=bn(t.base,"accent"),r=n.base,t.base=r,i=tFt(ci(t,e)),t.base=n):(n=bn(t,"accent"),r=n.base);var s=ci(r,e.havingCrampedStyle()),a=n.isShifty&&V0(r),o=0;if(a){var l,u;o=(l=(u=pMe(s))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=ND(n,e),f=li({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Yt(2*o)+")",marginLeft:Yt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=oMe("vec",e),g=aMe.vec[1]):(p=LD({mode:n.mode,text:n.label},e,"textord"),p=eFt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Ft(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var y=o;m||(y-=g/2),f.style.left=Yt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=li({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Ft(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},gMe=(t,e)=>{var r=t.isStretchy?ID(t.label):new qt("mo",[Ru(t.label,t.mode)]),n=new qt("mover",[Mi(t.base,e),r]);return n.setAttribute("accent","true"),n},_Ft=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));sr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=mL(e[0]),n=!_Ft.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:iJ,mathmlBuilder:gMe});sr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:iJ,mathmlBuilder:gMe});sr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=ci(t.base,e),n=ND(t,e),i=t.label==="\\utilde"?.12:0,s=li({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Ft(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=ID(t.label),n=new qt("munder",[Mi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var m8=t=>{var e=new qt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};sr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=v5(ci(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(n=e.havingStyle(r.sub()),a=v5(ci(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=ND(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(a){var d=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=li({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else h=li({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ft(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=ID(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=m8(Mi(t.body,e));if(t.below){var s=m8(Mi(t.below,e));n=new qt("munderover",[r,s,i])}else n=new qt("mover",[r,i])}else if(t.below){var a=m8(Mi(t.below,e));n=new qt("munder",[r,a])}else n=m8(),n=new qt("mover",[r,n]);return n}});function mMe(t,e){var r=_a(t.body,e,!0);return Ft([t.mclass],r,e)}function yMe(t,e){var r,n=Yc(t.body,e);return t.mclass==="minner"?r=new qt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new qt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new qt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}sr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ca(i),isCharacterBox:V0(i)}},htmlBuilder:mMe,mathmlBuilder:yMe});var PD=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};sr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:PD(e[0]),body:ca(e[1]),isCharacterBox:V0(e[1])}}});sr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],s=e[0],a;n!=="\\stackrel"?a=PD(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ca(i)},l={type:"supsub",mode:s.mode,base:o,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:r.mode,mclass:a,body:[l],isCharacterBox:V0(l)}},htmlBuilder:mMe,mathmlBuilder:yMe});sr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:PD(e[0]),body:ca(e[0])}},htmlBuilder(t,e){var r=_a(t.body,e,!0),n=Ft([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=Yc(t.body,e),n=new qt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var LFt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ade=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Mde=t=>t.type==="textord"&&t.text==="@",IFt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function NFt(t,e,r){var n=LFt[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},a=r.callFunction("\\Big",[s],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function DFt(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Gt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;sAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',a[l]);var g=NFt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=Ade()}s%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}sr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=v5(ci(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Yt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new qt("mrow",[Mi(t.label,e)]);return r=new qt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new qt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});sr({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=v5(ci(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new qt("mrow",[Mi(t.fragment,e)])}});sr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=bn(e[0],"ordgroup"),i=n.body,s="",a=0;a=1114111)throw new Gt("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var vMe=(t,e)=>{var r=_a(t.body,e.withColor(t.color),!1);return G0(r)},bMe=(t,e)=>{var r=Yc(t.body,e.withColor(t.color)),n=new qt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};sr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=bn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:ca(i)}},htmlBuilder:vMe,mathmlBuilder:bMe});sr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=bn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}},htmlBuilder:vMe,mathmlBuilder:bMe});sr({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&bn(i,"size").value}},htmlBuilder(t,e){var r=Ft(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Yt(xs(t.size,e)))),r},mathmlBuilder(t,e){var r=new qt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Yt(xs(t.size,e)))),r}});var VW={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},xMe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},OFt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},wMe=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};sr({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(VW[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=VW[n.text]),bn(e.parseFunction(),"internal");throw new Gt("Invalid token after macro prefix",n)}});sr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Gt("Expected a control sequence",n);for(var s=0,a,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Gt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Gt('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if(n.text==="EOF")throw new Gt("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===VW[r]),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=xMe(e.gullet.popToken());e.gullet.consumeSpaces();var i=OFt(e);return wMe(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=xMe(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return wMe(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ak=function(e,r,n){var i=ls.math[e]&&ls.math[e].replace,s=JQ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},sJ=function(e,r,n,i){var s=n.havingBaseStyle(r),a=Ft(i.concat(s.sizingClasses(n)),[e],n),o=s.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},TMe=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Yt(s),e.height-=s,e.depth+=s},PFt=function(e,r,n,i,s,a){var o=cl(e,"Main-Regular",s,i),l=sJ(o,r,i,a);return TMe(l,i,r),l},$Ft=function(e,r,n,i){return cl(e,"Size"+r+"-Regular",n,i)},CMe=function(e,r,n,i,s,a){var o=$Ft(e,r,s,i),l=sJ(Ft(["delimsizing","size"+r],[o],i),dn.TEXT,i,a);return n&&TMe(l,i,dn.TEXT),l},VB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=Ft(["delimsizinginner",i],[Ft([],[cl(e,r,n)])]);return{type:"elem",elem:s}},HB=function(e,r,n){var i=pd["Size4-Regular"][e.charCodeAt(0)]?pd["Size4-Regular"][e.charCodeAt(0)][4]:pd["Size1-Regular"][e.charCodeAt(0)][4],s=new Tg("inner",YBt(e,Math.round(1e3*r))),a=new v0([s],{width:Yt(i),height:Yt(r),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Cg([],[a],n);return o.height=r,o.style.height=Yt(r),o.style.width=Yt(i),{type:"elem",elem:o}},HW=.008,y8={type:"kern",size:-1*HW},BFt=new Set(["|","\\lvert","\\rvert","\\vert"]),FFt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),kMe=function(e,r,n,i,s,a){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):BFt.has(e)?(u="∣",d="vert",f=333):FFt.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=ak(o,p,s),m=g.height+g.depth,y=ak(u,p,s),v=y.height+y.depth,x=ak(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=ak(l,p,s);T=S.height+S.depth,C=2}var k=m+b+T,E=Math.max(0,Math.ceil((r-k)/(C*v))),A=k+E*C*v,R=i.fontMetrics().axisHeight;n&&(R*=i.sizeMultiplier);var _=A/2-R,P=[];if(d.length>0){var N=A-m-b,L=Math.round(A*1e3),I=jBt(d,Math.round(N*1e3)),$=new Tg(d,I),O=Yt(f/1e3),D=Yt(L/1e3),F=new v0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=Cg([],[F],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(VB(h,p,s)),P.push(y8),l===null){var V=A-m-b+2*HW;P.push(HB(u,V,i))}else{var B=(A-m-b-T)/2+2*HW;P.push(HB(u,B,i)),P.push(y8),P.push(VB(l,p,s)),P.push(y8),P.push(HB(u,B,i))}P.push(y8),P.push(VB(o,p,s))}var H=i.havingBaseStyle(dn.TEXT),G=li({positionType:"bottom",positionData:_,children:P});return sJ(Ft(["delimsizing","mult"],[G],H),dn.TEXT,i,a)},GB=80,WB=.08,qB=function(e,r,n,i,s){var a=UBt(e,i,n),o=new Tg(e,a),l=new v0([o],{width:"400em",height:Yt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Cg(["hide-tail"],[l],s)},zFt=function(e,r){var n=r.havingBaseSizing(),i=RMe("\\surd",e*n.sizeMultiplier,MMe,n),s=n.sizeMultiplier,a=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*a+GB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+WB)/s,u=(1+a)/s,o=qB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+GB)*sS[i.size],u=(sS[i.size]+a)/s,l=(sS[i.size]+a+WB)/s,o=qB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+WB,u=e+a,h=Math.floor(1e3*e+a)+GB,o=qB("sqrtTall",l,h,a,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Yt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+a)*s}},SMe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),VFt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),EMe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),sS=[0,1.2,1.8,2.4,3],AMe=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),SMe.has(e)||EMe.has(e))return CMe(e,r,!1,n,i,s);if(VFt.has(e))return kMe(e,sS[r],!1,n,i,s);throw new Gt("Illegal delimiter: '"+e+"'")},HFt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],GFt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"stack"}],MMe=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],WFt=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},RMe=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),a=s;ar)return o}return n[n.length-1]},GW=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;EMe.has(e)?o=HFt:SMe.has(e)?o=MMe:o=GFt;var l=RMe(e,r,o,i);return l.type==="small"?PFt(e,l.style,n,i,s,a):l.type==="large"?CMe(e,l.size,n,i,s,a):kMe(e,r,n,i,s,a)},UB=function(e,r,n,i,s,a){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return GW(e,d,!0,i,s,a)},Rde={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},qFt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function _de(t){return"isMiddle"in t}function $D(t,e){var r=OD(t);if(r&&qFt.has(r.text))return r;throw r?new Gt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Gt("Invalid delimiter type '"+t.type+"'",t)}sr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=$D(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Rde[t.funcName].size,mclass:Rde[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ft([t.mclass]):AMe(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ru(t.delim,t.mode));var r=new qt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Yt(sS[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function Lde(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}sr({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Gt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:$D(e[0],t).text,color:r}}});sr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=$D(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=bn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{Lde(t);for(var r=_a(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{Lde(t);var r=Yc(t.body,e);if(t.left!=="."){var n=new qt("mo",[Ru(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new qt("mo",[Ru(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return rJ(r)}});sr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=$D(e[0],t);if(!t.parser.leftrightDepth)throw new Gt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=P6(e,[]):(r=AMe(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Ru("|","text"):Ru(t.delim,t.mode),n=new qt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var BD=(t,e)=>{var r=v5(ci(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,a,o=V0(t.body);if(n==="sout")s=Ft(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=xs({number:.6,unit:"pt"},e),u=xs({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Yt(d/2+l);var f=Math.floor(1e3*d*i),p=WBt(f),g=new v0([new Tg("phase",p)],{width:"400em",height:Yt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Cg(["hide-tail"],[g],e),s.style.height=Yt(d),a=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),s=EFt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Yt(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Yt(v),s.style.borderRightWidth=Yt(v)),a=r.depth+y,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=li({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=li({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?Ft(["mord","cancel-lap"],[x],e):Ft(["mord"],[x],e)},FD=(t,e)=>{var r,n=new qt(t.label.includes("colorbox")?"mpadded":"menclose",[Mi(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Yt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};sr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=bn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:BD,mathmlBuilder:FD});sr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=bn(e[0],"color-token").color,a=bn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,borderColor:s,body:o}},htmlBuilder:BD,mathmlBuilder:FD});sr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});sr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:BD,mathmlBuilder:FD});sr({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:BD,mathmlBuilder:FD});sr({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var _Me={};function Ud(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Gt("{"+t.envName+"} can be used only in display mode.")},UFt=new Set(["gather","gather*"]);function aJ(t){if(!t.includes("ed"))return!t.includes("*")}function Qg(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)a=1;else if(a=parseFloat(p),!a||a<0)throw new Gt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new $c("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(Ide(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new Gt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){T(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:Ce[ne]})}for(T(a[0]),n=0;n0&&(_+=x,k<_&&(k=_),_=0)),e.addJot&&nCe))for(n=0;n=o)){var Q=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,re;Q=(Z=(re=H)==null?void 0:re.pregap)!=null?Z:f,Q!==0&&(I=Ft(["arraycolsep"],[]),I.style.width=Yt(Q),L.push(I))}var ie=[];for(n=0;n0){for(var ge=y5("hline",r,h),He=y5("hdashline",r,h),we=[{type:"elem",elem:Te,shift:0}];u.length>0;){var Me=u.pop(),je=Me.pos-P;Me.isDashed?we.push({type:"elem",elem:He,shift:je}):we.push({type:"elem",elem:ge,shift:je})}Te=li({positionType:"individualShift",children:we})}if(O.length===0)return Ft(["mord"],[Te],r);var le=li({positionType:"individualShift",children:O}),pe=Ft(["tag"],[le],r);return G0([Te,pe])},YFt={c:"center ",l:"left ",r:"right "},jd=function(e,r){for(var n=[],i=new qt("mtd",[],["mtr-glue"]),s=new qt("mtd",[],["mml-eqn-num"]),a=0;a0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=A[A.length-1].length>0?"right ":"";for(var R=1;R0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return a.colSeparationType=p?"align":"alignat",a};Ud({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=OD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(a){var o=DD(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Gt("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Qg(t.parser,s,oJ(t.envName))},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Gt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=Qg(t.parser,n,oJ(t.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Qg(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=OD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(o){var l=DD(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Gt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Gt("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},a=Qg(t.parser,s,"script");if(a.body.length>0&&a.body[0].length>1)throw new Gt("{subarray} can contain only one column");return a},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Qg(t.parser,e,oJ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:IMe,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){UFt.has(t.envName)&&zD(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:aJ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Qg(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:IMe,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){zD(t);var e={autoTag:aJ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Qg(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["CD"],props:{numArgs:0},handler(t){return zD(t),DFt(t.parser)},htmlBuilder:Yd,mathmlBuilder:jd});Se("\\nonumber","\\gdef\\@eqnsw{0}");Se("\\notag","\\nonumber");sr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Gt(t.funcName+" valid only within array environment")}});var Nde=_Me;sr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Gt("Invalid environment name",i);for(var s="",a=0;a{var r=t.font,n=e.withFont(r);return ci(t.body,n)},DMe=(t,e)=>{var r=t.font,n=e.withFont(r);return Mi(t.body,n)},Dde={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};sr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=mL(e[0]),s=n;return s in Dde&&(s=Dde[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:NMe,mathmlBuilder:DMe});sr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:PD(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:V0(n)}}});sr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:s}=r,a=r.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:a}}},htmlBuilder:NMe,mathmlBuilder:DMe});var jFt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=ci(t.numer,s,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-a.depth-(x+.5*d){var r=new qt("mfrac",[Mi(t.numer,e),Mi(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=xs(t.barSize,e);r.setAttribute("linethickness",Yt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var s=new qt("mo",[new ua(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(r),t.rightDelim!=null){var a=new qt("mo",[new ua(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return rJ(i)}return r},OMe=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};sr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1],a,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),OMe({type:"genfrac",mode:r.mode,numer:i,denom:s,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:jFt,mathmlBuilder:XFt});sr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Ode=["display","text","script","scriptscript"],Pde=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};sr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],s=mL(e[0]),a=s.type==="atom"&&s.family==="open"?Pde(s.text):null,o=mL(e[1]),l=o.type==="atom"&&o.family==="close"?Pde(o.text):null,u=bn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=bn(p.body[0],"textord");f=Ode[Number(g.text)]}}else p=bn(p,"textord"),f=Ode[Number(p.text)];return OMe({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:a,rightDelim:l},f)}});sr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:bn(e[0],"size").value,token:i}}});sr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=bn(e[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var a=e[2],o=s.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:o,barSize:s,leftDelim:null,rightDelim:null}}});var PMe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?ci(t.sup,e.havingStyle(r.sup()),e):ci(t.sub,e.havingStyle(r.sub()),e),i=bn(t.base,"horizBrace")):i=bn(t,"horizBrace");var s=ci(i.base,e.havingBaseStyle(dn.DISPLAY)),a=ND(i,e),o;if(i.isOver?o=li({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=li({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),n){var l=Ft(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=li({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=li({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ft(["minner",i.isOver?"mover":"munder"],[o],e)},KFt=(t,e)=>{var r=ID(t.label);return new qt(t.isOver?"mover":"munder",[Mi(t.base,e),r])};sr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:PMe,mathmlBuilder:KFt});sr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=bn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:ca(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=_a(t.body,e,!1);return cFt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=kg(t.body,e);return r instanceof qt||(r=new qt("mrow",[r])),r.setAttribute("href",t.href),r}});sr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=bn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:r,funcName:n,token:i}=t,s=bn(e[0],"raw").string,a=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=s,o={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,o={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,o={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),h=0;h{var r=_a(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Ft(n,r,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>kg(t.body,e)});sr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:ca(e[0]),mathml:ca(e[1])}},htmlBuilder:(t,e)=>{var r=_a(t.html,e,!1);return G0(r)},mathmlBuilder:(t,e)=>kg(t.mathml,e)});var YB=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Gt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!Q8e(n))throw new Gt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};sr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(r[0])for(var l=bn(r[0],"raw").string,u=l.split(","),h=0;h{var r=xs(t.height,e),n=0;t.totalheight.number>0&&(n=xs(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=xs(t.width,e));var s={height:Yt(r+n)};i>0&&(s.width=Yt(i)),n>0&&(s.verticalAlign=Yt(-n));var a=new QBt(t.src,t.alt,s);return a.height=r,a.depth=n,a},mathmlBuilder:(t,e)=>{var r=new qt("mglyph",[]);r.setAttribute("alt",t.alt);var n=xs(t.height,e),i=0;if(t.totalheight.number>0&&(i=xs(t.totalheight,e)-n,r.setAttribute("valign",Yt(-i))),r.setAttribute("height",Yt(n+i)),t.width.number>0){var s=xs(t.width,e);r.setAttribute("width",Yt(s))}return r.setAttribute("src",t.src),r}});sr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=bn(e[0],"size");if(r.settings.strict){var s=n[1]==="m",a=i.value.unit==="mu";s?(a||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):a&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return sMe(t.dimension,e)},mathmlBuilder(t,e){var r=xs(t.dimension,e);return new hMe(r)}});sr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Ft([],[ci(t.body,e)]),r=Ft(["inner"],[r],e)):r=Ft(["inner"],[ci(t.body,e)]);var n=Ft(["fix"],[]),i=Ft([t.alignment],[r,n],e),s=Ft(["strut"]);return s.style.height=Yt(i.height+i.depth),i.depth&&(s.style.verticalAlign=Yt(-i.depth)),i.children.unshift(s),i=Ft(["thinbox"],[i],e),Ft(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new qt("mpadded",[Mi(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});sr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var s=r==="\\("?"\\)":"$",a=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:a}}});sr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Gt("Mismatched "+t.funcName)}});var $de=(t,e)=>{switch(e.style.size){case dn.DISPLAY.size:return t.display;case dn.TEXT.size:return t.text;case dn.SCRIPT.size:return t.script;case dn.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};sr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:ca(e[0]),text:ca(e[1]),script:ca(e[2]),scriptscript:ca(e[3])}},htmlBuilder:(t,e)=>{var r=$de(t,e),n=_a(r,e,!1);return G0(n)},mathmlBuilder:(t,e)=>{var r=$de(t,e);return kg(r,e)}});var $Me=(t,e,r,n,i,s,a)=>{t=Ft([],[t]);var o=r&&V0(r),l,u;if(e){var h=ci(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=ci(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+a;f=li({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-a;f=li({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+a;f=li({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&s!==0&&!o){var v=Ft(["mspace"],[],n);v.style.marginRight=Yt(s),y.unshift(v)}return Ft(["mop","op-limits"],y,n)},BMe=new Set(["\\smallint"]),y3=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=bn(t.base,"op"),i=!0):s=bn(t,"op");var a=e.style,o=!1;a.size===dn.DISPLAY.size&&s.symbol&&!BMe.has(s.name)&&(o=!0);var l,u;if(s.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=cl(s.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=oMe(d+"Size"+(o?"2":"1"),e);l=li({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(s.body){var p=_a(s.body,e,!0);p.length===1&&p[0]instanceof Vc?(l=p[0],l.classes[0]="mop"):l=Ft(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new qt("mo",[Ru(t.name,t.mode)]),BMe.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new qt("mo",Yc(t.body,e));else{r=new qt("mi",[new ua(t.name.slice(1))]);var n=new qt("mo",[Ru("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=uMe([r,n])}return r},ZFt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};sr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=ZFt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:y3,mathmlBuilder:h7});sr({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ca(n)}},htmlBuilder:y3,mathmlBuilder:h7});var QFt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};sr({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:y3,mathmlBuilder:h7});sr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:y3,mathmlBuilder:h7});sr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=QFt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:y3,mathmlBuilder:h7});var FMe=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=bn(t.base,"operatorname"),i=!0):s=bn(t,"operatorname");var a;if(s.body.length>0){for(var o=s.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=_a(o,e.withFont("mathrm"),!0),u=0;u{for(var r=Yc(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new ua(o)]}var l=new qt("mi",r);l.setAttribute("mathvariant","normal");var u=new qt("mo",[Ru("⁡","text")]);return t.parentIsSupSub?new qt("mrow",[l,u]):uMe([l,u])};sr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:ca(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:FMe,mathmlBuilder:JFt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");tv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?G0(_a(t.body,e,!1)):Ft(["mord"],_a(t.body,e,!0),e)},mathmlBuilder(t,e){return kg(t.body,e,!0)}});sr({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=ci(t.body,e.havingCrampedStyle()),n=y5("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=li({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Ft(["mord","overline"],[s],e)},mathmlBuilder(t,e){var r=new qt("mo",[new ua("‾")]);r.setAttribute("stretchy","true");var n=new qt("mover",[Mi(t.body,e),r]);return n.setAttribute("accent","true"),n}});sr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:ca(n)}},htmlBuilder:(t,e)=>{var r=_a(t.body,e.withPhantom(),!1);return G0(r)},mathmlBuilder:(t,e)=>{var r=Yc(t.body,e);return new qt("mphantom",r)}});Se("\\hphantom","\\smash{\\phantom{#1}}");sr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Ft(["inner"],[ci(t.body,e.withPhantom())]),n=Ft(["fix"],[]);return Ft(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Yc(ca(t.body),e),n=new qt("mphantom",r),i=new qt("mpadded",[n]);return i.setAttribute("width","0px"),i}});sr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=bn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=ci(t.body,e),n=xs(t.dy,e);return li({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[Mi(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});sr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});sr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],s=bn(e[0],"size"),a=bn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&bn(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var r=Ft(["mord","rule"],[],e),n=xs(t.width,e),i=xs(t.height,e),s=t.shift?xs(t.shift,e):0;return r.style.borderRightWidth=Yt(n),r.style.borderTopWidth=Yt(i),r.style.bottom=Yt(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=xs(t.width,e),n=xs(t.height,e),i=t.shift?xs(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new qt("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Yt(r)),a.setAttribute("height",Yt(n));var o=new qt("mpadded",[a]);return i>=0?o.setAttribute("height",Yt(i)):(o.setAttribute("height",Yt(i)),o.setAttribute("depth",Yt(-i))),o.setAttribute("voffset",Yt(i)),o}});function zMe(t,e,r){for(var n=_a(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return zMe(t.body,r,e)};sr({type:"sizing",names:Bde,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:Bde.indexOf(n)+1,body:s}},htmlBuilder:ezt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=Yc(t.body,r),i=new qt("mstyle",n);return i.setAttribute("mathsize",Yt(r.sizeMultiplier)),i}});sr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,s=!1,a=r[0]&&bn(r[0],"ordgroup");if(a)for(var o,l=0;l{var r=Ft([],[ci(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Ft(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new qt("mpadded",[Mi(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});sr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=ci(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=v5(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idr.height+r.depth+a&&(a=(a+d-r.height-r.depth)/2);var f=l.height-r.height-a-u;r.style.paddingLeft=Yt(h);var p=li({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(dn.SCRIPTSCRIPT),m=ci(t.index,g,e),y=.6*(p.height-p.depth),v=li({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=Ft(["root"],[v]);return Ft(["mord","sqrt"],[x,p],e)}else return Ft(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new qt("mroot",[Mi(r,e),Mi(n,e)]):new qt("msqrt",[Mi(r,e)])}});var WW={display:dn.DISPLAY,text:dn.TEXT,script:dn.SCRIPT,scriptscript:dn.SCRIPTSCRIPT};function tzt(t){return t in WW}sr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!0,r),a=n.slice(1,n.length-5);if(!tzt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=WW[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),zMe(t.body,n,e)},mathmlBuilder(t,e){var r=WW[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=Yc(t.body,n),s=new qt("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var rzt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===dn.DISPLAY.size||n.alwaysHandleSupSub);return i?y3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===dn.DISPLAY.size||n.limits);return s?FMe:null}else{if(n.type==="accent")return V0(n.base)?iJ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?PMe:null}else return null}else return null};tv({type:"supsub",htmlBuilder(t,e){var r=rzt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=ci(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&V0(n);if(i){var p=e.havingStyle(e.style.sup());o=ci(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=ci(s,g,e),f||(d=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===dn.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Yt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(a instanceof Vc||b){var T;x=Yt(-((T=a.italic)!=null?T:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var A=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];C=li({positionType:"individualShift",children:A})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var R=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];C=li({positionType:"shift",positionData:d,children:R})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=li({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var _=FW(a,"right")||"mord";return Ft([_],[a,Ft(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Mi(t.base,e)];t.sub&&s.push(Mi(t.sub,e)),t.sup&&s.push(Mi(t.sup,e));var a;if(r)a=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===dn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===dn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===dn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===dn.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===dn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===dn.DISPLAY)?a="mover":a="msup"}return new qt(a,s)}});tv({type:"atom",htmlBuilder(t,e){return eJ(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new qt("mo",[Ru(t.text,t.mode)]);if(t.family==="bin"){var n=nJ(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var VMe={mi:"italic",mn:"normal",mtext:"normal"};tv({type:"mathord",htmlBuilder(t,e){return LD(t,e,"mathord")},mathmlBuilder(t,e){var r=new qt("mi",[Ru(t.text,t.mode,e)]),n=nJ(t,e)||"italic";return n!==VMe[r.type]&&r.setAttribute("mathvariant",n),r}});tv({type:"textord",htmlBuilder(t,e){return LD(t,e,"textord")},mathmlBuilder(t,e){var r=Ru(t.text,t.mode,e),n=nJ(t,e)||"normal",i;return t.mode==="text"?i=new qt("mtext",[r]):/[0-9]/.test(t.text)?i=new qt("mn",[r]):t.text==="\\prime"?i=new qt("mo",[r]):i=new qt("mi",[r]),n!==VMe[i.type]&&i.setAttribute("mathvariant",n),i}});var jB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},XB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};tv({type:"spacing",htmlBuilder(t,e){if(XB.hasOwnProperty(t.text)){var r=XB[t.text].className||"";if(t.mode==="text"){var n=LD(t,e,"textord");return n.classes.push(r),n}else return Ft(["mspace",r],[eJ(t.text,t.mode,e)],e)}else{if(jB.hasOwnProperty(t.text))return Ft(["mspace",jB[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(XB.hasOwnProperty(t.text))r=new qt("mtext",[new ua(" ")]);else{if(jB.hasOwnProperty(t.text))return new qt("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var Fde=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};tv({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[Fde(),new qt("mtd",[kg(t.body,e)]),Fde(),new qt("mtd",[kg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var zde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Vde={"\\textbf":"textbf","\\textmd":"textmd"},nzt={"\\textit":"textit","\\textup":"textup"},Hde=(t,e)=>{var r=t.font;if(r){if(zde[r])return e.withTextFontFamily(zde[r]);if(Vde[r])return e.withTextFontWeight(Vde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(nzt[r])};sr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:ca(i),font:n}},htmlBuilder(t,e){var r=Hde(t,e),n=_a(t.body,r,!0);return Ft(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Hde(t,e);return kg(t.body,r)}});sr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=ci(t.body,e),n=y5("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=li({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Ft(["mord","underline"],[s],e)},mathmlBuilder(t,e){var r=new qt("mo",[new ua("‾")]);r.setAttribute("stretchy","true");var n=new qt("munder",[Mi(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});sr({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=ci(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return li({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[Mi(t.body,e)],["vcenter"]);return new qt("mrow",[r])}});sr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Gt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Gde(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),zp=lMe,HMe=`[ \r - ]`,izt="\\\\[a-zA-Z@]+",szt="\\\\[^\uD800-\uDFFF]",azt="("+izt+")"+HMe+"*",ozt=`\\\\( +-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 hFt(t){return"toText"in t}let y3=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(hFt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var NW={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},dFt={ex:!0,em:!0,mu:!0},iMe=function(e){return typeof e!="string"&&(e=e.unit),e in NW||e in dFt||e==="ex"},xs=function(e,r){var n;if(e.unit in NW)n=NW[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Gt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Yt=function(e){return+e.toFixed(4)+"em"},kg=function(e){return e.filter(r=>r).join(" ")},rJ=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=zBt(n)+":"+i+";")}return r},sMe=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},aMe=function(e){var r=document.createElement(e);r.className=kg(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,oMe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Ho(kg(this.classes))+'"');var n=rJ(this.style);n&&(r+=' style="'+Ho(n)+'"');for(var i of Object.keys(this.attributes)){if(fFt.test(i))throw new Gt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Ho(this.attributes[i])+'"'}r+=">";for(var s=0;s",r};class v3{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,sMe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return aMe.call(this,"span")}toMarkup(){return oMe.call(this,"span")}}let ID=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,sMe.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return aMe.call(this,"a")}toMarkup(){return oMe.call(this,"a")}};class pFt{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+Ho(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Yt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=kg(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+Yt(this.italic)+";"),n+=rJ(this.style),n&&(e=!0,r+=' style="'+Ho(n)+'"');var i=Ho(this.text);return e?(r+=">",r+=i,r+="",r):i}}class C0{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class DW{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var vFt=t=>t instanceof v3||t instanceof ID||t instanceof y3,yd={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},g8={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},vde={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function lMe(t,e){yd[t]=e}function nJ(t,e,r){if(!yd[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=yd[e][n];if(!i&&t[0]in vde&&(n=vde[t[0]].charCodeAt(0),i=yd[e][n]),!i&&r==="text"&&nMe(n)&&(i=yd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var FB={};function bFt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!FB[e]){var r=FB[e]={cssEmPerMu:g8.quad[e]/18};for(var n in g8)g8.hasOwnProperty(n)&&(r[n]=g8[n][e])}return FB[e]}var ls={math:{},text:{}};function U(t,e,r,n,i,s){ls[t][i]={font:e,group:r,replace:n},s&&n&&(ls[t][n]=ls[t][i])}var se="math",Dt="text",ve="main",We="ams",fs="accent-token",hr="bin",Fl="close",b3="inner",Vr="mathord",pa="op-token",Xc="open",f7="punct",Ye="rel",U0="spacing",Je="textord";U(se,ve,Ye,"≡","\\equiv",!0);U(se,ve,Ye,"≺","\\prec",!0);U(se,ve,Ye,"≻","\\succ",!0);U(se,ve,Ye,"∼","\\sim",!0);U(se,ve,Ye,"⊥","\\perp");U(se,ve,Ye,"⪯","\\preceq",!0);U(se,ve,Ye,"⪰","\\succeq",!0);U(se,ve,Ye,"≃","\\simeq",!0);U(se,ve,Ye,"∣","\\mid",!0);U(se,ve,Ye,"≪","\\ll",!0);U(se,ve,Ye,"≫","\\gg",!0);U(se,ve,Ye,"≍","\\asymp",!0);U(se,ve,Ye,"∥","\\parallel");U(se,ve,Ye,"⋈","\\bowtie",!0);U(se,ve,Ye,"⌣","\\smile",!0);U(se,ve,Ye,"⊑","\\sqsubseteq",!0);U(se,ve,Ye,"⊒","\\sqsupseteq",!0);U(se,ve,Ye,"≐","\\doteq",!0);U(se,ve,Ye,"⌢","\\frown",!0);U(se,ve,Ye,"∋","\\ni",!0);U(se,ve,Ye,"∝","\\propto",!0);U(se,ve,Ye,"⊢","\\vdash",!0);U(se,ve,Ye,"⊣","\\dashv",!0);U(se,ve,Ye,"∋","\\owns");U(se,ve,f7,".","\\ldotp");U(se,ve,f7,"⋅","\\cdotp");U(se,ve,f7,"⋅","·");U(Dt,ve,Je,"⋅","·");U(se,ve,Je,"#","\\#");U(Dt,ve,Je,"#","\\#");U(se,ve,Je,"&","\\&");U(Dt,ve,Je,"&","\\&");U(se,ve,Je,"ℵ","\\aleph",!0);U(se,ve,Je,"∀","\\forall",!0);U(se,ve,Je,"ℏ","\\hbar",!0);U(se,ve,Je,"∃","\\exists",!0);U(se,ve,Je,"∇","\\nabla",!0);U(se,ve,Je,"♭","\\flat",!0);U(se,ve,Je,"ℓ","\\ell",!0);U(se,ve,Je,"♮","\\natural",!0);U(se,ve,Je,"♣","\\clubsuit",!0);U(se,ve,Je,"℘","\\wp",!0);U(se,ve,Je,"♯","\\sharp",!0);U(se,ve,Je,"♢","\\diamondsuit",!0);U(se,ve,Je,"ℜ","\\Re",!0);U(se,ve,Je,"♡","\\heartsuit",!0);U(se,ve,Je,"ℑ","\\Im",!0);U(se,ve,Je,"♠","\\spadesuit",!0);U(se,ve,Je,"§","\\S",!0);U(Dt,ve,Je,"§","\\S");U(se,ve,Je,"¶","\\P",!0);U(Dt,ve,Je,"¶","\\P");U(se,ve,Je,"†","\\dag");U(Dt,ve,Je,"†","\\dag");U(Dt,ve,Je,"†","\\textdagger");U(se,ve,Je,"‡","\\ddag");U(Dt,ve,Je,"‡","\\ddag");U(Dt,ve,Je,"‡","\\textdaggerdbl");U(se,ve,Fl,"⎱","\\rmoustache",!0);U(se,ve,Xc,"⎰","\\lmoustache",!0);U(se,ve,Fl,"⟯","\\rgroup",!0);U(se,ve,Xc,"⟮","\\lgroup",!0);U(se,ve,hr,"∓","\\mp",!0);U(se,ve,hr,"⊖","\\ominus",!0);U(se,ve,hr,"⊎","\\uplus",!0);U(se,ve,hr,"⊓","\\sqcap",!0);U(se,ve,hr,"∗","\\ast");U(se,ve,hr,"⊔","\\sqcup",!0);U(se,ve,hr,"◯","\\bigcirc",!0);U(se,ve,hr,"∙","\\bullet",!0);U(se,ve,hr,"‡","\\ddagger");U(se,ve,hr,"≀","\\wr",!0);U(se,ve,hr,"⨿","\\amalg");U(se,ve,hr,"&","\\And");U(se,ve,Ye,"⟵","\\longleftarrow",!0);U(se,ve,Ye,"⇐","\\Leftarrow",!0);U(se,ve,Ye,"⟸","\\Longleftarrow",!0);U(se,ve,Ye,"⟶","\\longrightarrow",!0);U(se,ve,Ye,"⇒","\\Rightarrow",!0);U(se,ve,Ye,"⟹","\\Longrightarrow",!0);U(se,ve,Ye,"↔","\\leftrightarrow",!0);U(se,ve,Ye,"⟷","\\longleftrightarrow",!0);U(se,ve,Ye,"⇔","\\Leftrightarrow",!0);U(se,ve,Ye,"⟺","\\Longleftrightarrow",!0);U(se,ve,Ye,"↦","\\mapsto",!0);U(se,ve,Ye,"⟼","\\longmapsto",!0);U(se,ve,Ye,"↗","\\nearrow",!0);U(se,ve,Ye,"↩","\\hookleftarrow",!0);U(se,ve,Ye,"↪","\\hookrightarrow",!0);U(se,ve,Ye,"↘","\\searrow",!0);U(se,ve,Ye,"↼","\\leftharpoonup",!0);U(se,ve,Ye,"⇀","\\rightharpoonup",!0);U(se,ve,Ye,"↙","\\swarrow",!0);U(se,ve,Ye,"↽","\\leftharpoondown",!0);U(se,ve,Ye,"⇁","\\rightharpoondown",!0);U(se,ve,Ye,"↖","\\nwarrow",!0);U(se,ve,Ye,"⇌","\\rightleftharpoons",!0);U(se,We,Ye,"≮","\\nless",!0);U(se,We,Ye,"","\\@nleqslant");U(se,We,Ye,"","\\@nleqq");U(se,We,Ye,"⪇","\\lneq",!0);U(se,We,Ye,"≨","\\lneqq",!0);U(se,We,Ye,"","\\@lvertneqq");U(se,We,Ye,"⋦","\\lnsim",!0);U(se,We,Ye,"⪉","\\lnapprox",!0);U(se,We,Ye,"⊀","\\nprec",!0);U(se,We,Ye,"⋠","\\npreceq",!0);U(se,We,Ye,"⋨","\\precnsim",!0);U(se,We,Ye,"⪹","\\precnapprox",!0);U(se,We,Ye,"≁","\\nsim",!0);U(se,We,Ye,"","\\@nshortmid");U(se,We,Ye,"∤","\\nmid",!0);U(se,We,Ye,"⊬","\\nvdash",!0);U(se,We,Ye,"⊭","\\nvDash",!0);U(se,We,Ye,"⋪","\\ntriangleleft");U(se,We,Ye,"⋬","\\ntrianglelefteq",!0);U(se,We,Ye,"⊊","\\subsetneq",!0);U(se,We,Ye,"","\\@varsubsetneq");U(se,We,Ye,"⫋","\\subsetneqq",!0);U(se,We,Ye,"","\\@varsubsetneqq");U(se,We,Ye,"≯","\\ngtr",!0);U(se,We,Ye,"","\\@ngeqslant");U(se,We,Ye,"","\\@ngeqq");U(se,We,Ye,"⪈","\\gneq",!0);U(se,We,Ye,"≩","\\gneqq",!0);U(se,We,Ye,"","\\@gvertneqq");U(se,We,Ye,"⋧","\\gnsim",!0);U(se,We,Ye,"⪊","\\gnapprox",!0);U(se,We,Ye,"⊁","\\nsucc",!0);U(se,We,Ye,"⋡","\\nsucceq",!0);U(se,We,Ye,"⋩","\\succnsim",!0);U(se,We,Ye,"⪺","\\succnapprox",!0);U(se,We,Ye,"≆","\\ncong",!0);U(se,We,Ye,"","\\@nshortparallel");U(se,We,Ye,"∦","\\nparallel",!0);U(se,We,Ye,"⊯","\\nVDash",!0);U(se,We,Ye,"⋫","\\ntriangleright");U(se,We,Ye,"⋭","\\ntrianglerighteq",!0);U(se,We,Ye,"","\\@nsupseteqq");U(se,We,Ye,"⊋","\\supsetneq",!0);U(se,We,Ye,"","\\@varsupsetneq");U(se,We,Ye,"⫌","\\supsetneqq",!0);U(se,We,Ye,"","\\@varsupsetneqq");U(se,We,Ye,"⊮","\\nVdash",!0);U(se,We,Ye,"⪵","\\precneqq",!0);U(se,We,Ye,"⪶","\\succneqq",!0);U(se,We,Ye,"","\\@nsubseteqq");U(se,We,hr,"⊴","\\unlhd");U(se,We,hr,"⊵","\\unrhd");U(se,We,Ye,"↚","\\nleftarrow",!0);U(se,We,Ye,"↛","\\nrightarrow",!0);U(se,We,Ye,"⇍","\\nLeftarrow",!0);U(se,We,Ye,"⇏","\\nRightarrow",!0);U(se,We,Ye,"↮","\\nleftrightarrow",!0);U(se,We,Ye,"⇎","\\nLeftrightarrow",!0);U(se,We,Ye,"△","\\vartriangle");U(se,We,Je,"ℏ","\\hslash");U(se,We,Je,"▽","\\triangledown");U(se,We,Je,"◊","\\lozenge");U(se,We,Je,"Ⓢ","\\circledS");U(se,We,Je,"®","\\circledR");U(Dt,We,Je,"®","\\circledR");U(se,We,Je,"∡","\\measuredangle",!0);U(se,We,Je,"∄","\\nexists");U(se,We,Je,"℧","\\mho");U(se,We,Je,"Ⅎ","\\Finv",!0);U(se,We,Je,"⅁","\\Game",!0);U(se,We,Je,"‵","\\backprime");U(se,We,Je,"▲","\\blacktriangle");U(se,We,Je,"▼","\\blacktriangledown");U(se,We,Je,"■","\\blacksquare");U(se,We,Je,"⧫","\\blacklozenge");U(se,We,Je,"★","\\bigstar");U(se,We,Je,"∢","\\sphericalangle",!0);U(se,We,Je,"∁","\\complement",!0);U(se,We,Je,"ð","\\eth",!0);U(Dt,ve,Je,"ð","ð");U(se,We,Je,"╱","\\diagup");U(se,We,Je,"╲","\\diagdown");U(se,We,Je,"□","\\square");U(se,We,Je,"□","\\Box");U(se,We,Je,"◊","\\Diamond");U(se,We,Je,"¥","\\yen",!0);U(Dt,We,Je,"¥","\\yen",!0);U(se,We,Je,"✓","\\checkmark",!0);U(Dt,We,Je,"✓","\\checkmark");U(se,We,Je,"ℶ","\\beth",!0);U(se,We,Je,"ℸ","\\daleth",!0);U(se,We,Je,"ℷ","\\gimel",!0);U(se,We,Je,"ϝ","\\digamma",!0);U(se,We,Je,"ϰ","\\varkappa");U(se,We,Xc,"┌","\\@ulcorner",!0);U(se,We,Fl,"┐","\\@urcorner",!0);U(se,We,Xc,"└","\\@llcorner",!0);U(se,We,Fl,"┘","\\@lrcorner",!0);U(se,We,Ye,"≦","\\leqq",!0);U(se,We,Ye,"⩽","\\leqslant",!0);U(se,We,Ye,"⪕","\\eqslantless",!0);U(se,We,Ye,"≲","\\lesssim",!0);U(se,We,Ye,"⪅","\\lessapprox",!0);U(se,We,Ye,"≊","\\approxeq",!0);U(se,We,hr,"⋖","\\lessdot");U(se,We,Ye,"⋘","\\lll",!0);U(se,We,Ye,"≶","\\lessgtr",!0);U(se,We,Ye,"⋚","\\lesseqgtr",!0);U(se,We,Ye,"⪋","\\lesseqqgtr",!0);U(se,We,Ye,"≑","\\doteqdot");U(se,We,Ye,"≓","\\risingdotseq",!0);U(se,We,Ye,"≒","\\fallingdotseq",!0);U(se,We,Ye,"∽","\\backsim",!0);U(se,We,Ye,"⋍","\\backsimeq",!0);U(se,We,Ye,"⫅","\\subseteqq",!0);U(se,We,Ye,"⋐","\\Subset",!0);U(se,We,Ye,"⊏","\\sqsubset",!0);U(se,We,Ye,"≼","\\preccurlyeq",!0);U(se,We,Ye,"⋞","\\curlyeqprec",!0);U(se,We,Ye,"≾","\\precsim",!0);U(se,We,Ye,"⪷","\\precapprox",!0);U(se,We,Ye,"⊲","\\vartriangleleft");U(se,We,Ye,"⊴","\\trianglelefteq");U(se,We,Ye,"⊨","\\vDash",!0);U(se,We,Ye,"⊪","\\Vvdash",!0);U(se,We,Ye,"⌣","\\smallsmile");U(se,We,Ye,"⌢","\\smallfrown");U(se,We,Ye,"≏","\\bumpeq",!0);U(se,We,Ye,"≎","\\Bumpeq",!0);U(se,We,Ye,"≧","\\geqq",!0);U(se,We,Ye,"⩾","\\geqslant",!0);U(se,We,Ye,"⪖","\\eqslantgtr",!0);U(se,We,Ye,"≳","\\gtrsim",!0);U(se,We,Ye,"⪆","\\gtrapprox",!0);U(se,We,hr,"⋗","\\gtrdot");U(se,We,Ye,"⋙","\\ggg",!0);U(se,We,Ye,"≷","\\gtrless",!0);U(se,We,Ye,"⋛","\\gtreqless",!0);U(se,We,Ye,"⪌","\\gtreqqless",!0);U(se,We,Ye,"≖","\\eqcirc",!0);U(se,We,Ye,"≗","\\circeq",!0);U(se,We,Ye,"≜","\\triangleq",!0);U(se,We,Ye,"∼","\\thicksim");U(se,We,Ye,"≈","\\thickapprox");U(se,We,Ye,"⫆","\\supseteqq",!0);U(se,We,Ye,"⋑","\\Supset",!0);U(se,We,Ye,"⊐","\\sqsupset",!0);U(se,We,Ye,"≽","\\succcurlyeq",!0);U(se,We,Ye,"⋟","\\curlyeqsucc",!0);U(se,We,Ye,"≿","\\succsim",!0);U(se,We,Ye,"⪸","\\succapprox",!0);U(se,We,Ye,"⊳","\\vartriangleright");U(se,We,Ye,"⊵","\\trianglerighteq");U(se,We,Ye,"⊩","\\Vdash",!0);U(se,We,Ye,"∣","\\shortmid");U(se,We,Ye,"∥","\\shortparallel");U(se,We,Ye,"≬","\\between",!0);U(se,We,Ye,"⋔","\\pitchfork",!0);U(se,We,Ye,"∝","\\varpropto");U(se,We,Ye,"◀","\\blacktriangleleft");U(se,We,Ye,"∴","\\therefore",!0);U(se,We,Ye,"∍","\\backepsilon");U(se,We,Ye,"▶","\\blacktriangleright");U(se,We,Ye,"∵","\\because",!0);U(se,We,Ye,"⋘","\\llless");U(se,We,Ye,"⋙","\\gggtr");U(se,We,hr,"⊲","\\lhd");U(se,We,hr,"⊳","\\rhd");U(se,We,Ye,"≂","\\eqsim",!0);U(se,ve,Ye,"⋈","\\Join");U(se,We,Ye,"≑","\\Doteq",!0);U(se,We,hr,"∔","\\dotplus",!0);U(se,We,hr,"∖","\\smallsetminus");U(se,We,hr,"⋒","\\Cap",!0);U(se,We,hr,"⋓","\\Cup",!0);U(se,We,hr,"⩞","\\doublebarwedge",!0);U(se,We,hr,"⊟","\\boxminus",!0);U(se,We,hr,"⊞","\\boxplus",!0);U(se,We,hr,"⋇","\\divideontimes",!0);U(se,We,hr,"⋉","\\ltimes",!0);U(se,We,hr,"⋊","\\rtimes",!0);U(se,We,hr,"⋋","\\leftthreetimes",!0);U(se,We,hr,"⋌","\\rightthreetimes",!0);U(se,We,hr,"⋏","\\curlywedge",!0);U(se,We,hr,"⋎","\\curlyvee",!0);U(se,We,hr,"⊝","\\circleddash",!0);U(se,We,hr,"⊛","\\circledast",!0);U(se,We,hr,"⋅","\\centerdot");U(se,We,hr,"⊺","\\intercal",!0);U(se,We,hr,"⋒","\\doublecap");U(se,We,hr,"⋓","\\doublecup");U(se,We,hr,"⊠","\\boxtimes",!0);U(se,We,Ye,"⇢","\\dashrightarrow",!0);U(se,We,Ye,"⇠","\\dashleftarrow",!0);U(se,We,Ye,"⇇","\\leftleftarrows",!0);U(se,We,Ye,"⇆","\\leftrightarrows",!0);U(se,We,Ye,"⇚","\\Lleftarrow",!0);U(se,We,Ye,"↞","\\twoheadleftarrow",!0);U(se,We,Ye,"↢","\\leftarrowtail",!0);U(se,We,Ye,"↫","\\looparrowleft",!0);U(se,We,Ye,"⇋","\\leftrightharpoons",!0);U(se,We,Ye,"↶","\\curvearrowleft",!0);U(se,We,Ye,"↺","\\circlearrowleft",!0);U(se,We,Ye,"↰","\\Lsh",!0);U(se,We,Ye,"⇈","\\upuparrows",!0);U(se,We,Ye,"↿","\\upharpoonleft",!0);U(se,We,Ye,"⇃","\\downharpoonleft",!0);U(se,ve,Ye,"⊶","\\origof",!0);U(se,ve,Ye,"⊷","\\imageof",!0);U(se,We,Ye,"⊸","\\multimap",!0);U(se,We,Ye,"↭","\\leftrightsquigarrow",!0);U(se,We,Ye,"⇉","\\rightrightarrows",!0);U(se,We,Ye,"⇄","\\rightleftarrows",!0);U(se,We,Ye,"↠","\\twoheadrightarrow",!0);U(se,We,Ye,"↣","\\rightarrowtail",!0);U(se,We,Ye,"↬","\\looparrowright",!0);U(se,We,Ye,"↷","\\curvearrowright",!0);U(se,We,Ye,"↻","\\circlearrowright",!0);U(se,We,Ye,"↱","\\Rsh",!0);U(se,We,Ye,"⇊","\\downdownarrows",!0);U(se,We,Ye,"↾","\\upharpoonright",!0);U(se,We,Ye,"⇂","\\downharpoonright",!0);U(se,We,Ye,"⇝","\\rightsquigarrow",!0);U(se,We,Ye,"⇝","\\leadsto");U(se,We,Ye,"⇛","\\Rrightarrow",!0);U(se,We,Ye,"↾","\\restriction");U(se,ve,Je,"‘","`");U(se,ve,Je,"$","\\$");U(Dt,ve,Je,"$","\\$");U(Dt,ve,Je,"$","\\textdollar");U(se,ve,Je,"%","\\%");U(Dt,ve,Je,"%","\\%");U(se,ve,Je,"_","\\_");U(Dt,ve,Je,"_","\\_");U(Dt,ve,Je,"_","\\textunderscore");U(se,ve,Je,"∠","\\angle",!0);U(se,ve,Je,"∞","\\infty",!0);U(se,ve,Je,"′","\\prime");U(se,ve,Je,"△","\\triangle");U(se,ve,Je,"Γ","\\Gamma",!0);U(se,ve,Je,"Δ","\\Delta",!0);U(se,ve,Je,"Θ","\\Theta",!0);U(se,ve,Je,"Λ","\\Lambda",!0);U(se,ve,Je,"Ξ","\\Xi",!0);U(se,ve,Je,"Π","\\Pi",!0);U(se,ve,Je,"Σ","\\Sigma",!0);U(se,ve,Je,"Υ","\\Upsilon",!0);U(se,ve,Je,"Φ","\\Phi",!0);U(se,ve,Je,"Ψ","\\Psi",!0);U(se,ve,Je,"Ω","\\Omega",!0);U(se,ve,Je,"A","Α");U(se,ve,Je,"B","Β");U(se,ve,Je,"E","Ε");U(se,ve,Je,"Z","Ζ");U(se,ve,Je,"H","Η");U(se,ve,Je,"I","Ι");U(se,ve,Je,"K","Κ");U(se,ve,Je,"M","Μ");U(se,ve,Je,"N","Ν");U(se,ve,Je,"O","Ο");U(se,ve,Je,"P","Ρ");U(se,ve,Je,"T","Τ");U(se,ve,Je,"X","Χ");U(se,ve,Je,"¬","\\neg",!0);U(se,ve,Je,"¬","\\lnot");U(se,ve,Je,"⊤","\\top");U(se,ve,Je,"⊥","\\bot");U(se,ve,Je,"∅","\\emptyset");U(se,We,Je,"∅","\\varnothing");U(se,ve,Vr,"α","\\alpha",!0);U(se,ve,Vr,"β","\\beta",!0);U(se,ve,Vr,"γ","\\gamma",!0);U(se,ve,Vr,"δ","\\delta",!0);U(se,ve,Vr,"ϵ","\\epsilon",!0);U(se,ve,Vr,"ζ","\\zeta",!0);U(se,ve,Vr,"η","\\eta",!0);U(se,ve,Vr,"θ","\\theta",!0);U(se,ve,Vr,"ι","\\iota",!0);U(se,ve,Vr,"κ","\\kappa",!0);U(se,ve,Vr,"λ","\\lambda",!0);U(se,ve,Vr,"μ","\\mu",!0);U(se,ve,Vr,"ν","\\nu",!0);U(se,ve,Vr,"ξ","\\xi",!0);U(se,ve,Vr,"ο","\\omicron",!0);U(se,ve,Vr,"π","\\pi",!0);U(se,ve,Vr,"ρ","\\rho",!0);U(se,ve,Vr,"σ","\\sigma",!0);U(se,ve,Vr,"τ","\\tau",!0);U(se,ve,Vr,"υ","\\upsilon",!0);U(se,ve,Vr,"ϕ","\\phi",!0);U(se,ve,Vr,"χ","\\chi",!0);U(se,ve,Vr,"ψ","\\psi",!0);U(se,ve,Vr,"ω","\\omega",!0);U(se,ve,Vr,"ε","\\varepsilon",!0);U(se,ve,Vr,"ϑ","\\vartheta",!0);U(se,ve,Vr,"ϖ","\\varpi",!0);U(se,ve,Vr,"ϱ","\\varrho",!0);U(se,ve,Vr,"ς","\\varsigma",!0);U(se,ve,Vr,"φ","\\varphi",!0);U(se,ve,hr,"∗","*",!0);U(se,ve,hr,"+","+");U(se,ve,hr,"−","-",!0);U(se,ve,hr,"⋅","\\cdot",!0);U(se,ve,hr,"∘","\\circ",!0);U(se,ve,hr,"÷","\\div",!0);U(se,ve,hr,"±","\\pm",!0);U(se,ve,hr,"×","\\times",!0);U(se,ve,hr,"∩","\\cap",!0);U(se,ve,hr,"∪","\\cup",!0);U(se,ve,hr,"∖","\\setminus",!0);U(se,ve,hr,"∧","\\land");U(se,ve,hr,"∨","\\lor");U(se,ve,hr,"∧","\\wedge",!0);U(se,ve,hr,"∨","\\vee",!0);U(se,ve,Je,"√","\\surd");U(se,ve,Xc,"⟨","\\langle",!0);U(se,ve,Xc,"∣","\\lvert");U(se,ve,Xc,"∥","\\lVert");U(se,ve,Fl,"?","?");U(se,ve,Fl,"!","!");U(se,ve,Fl,"⟩","\\rangle",!0);U(se,ve,Fl,"∣","\\rvert");U(se,ve,Fl,"∥","\\rVert");U(se,ve,Ye,"=","=");U(se,ve,Ye,":",":");U(se,ve,Ye,"≈","\\approx",!0);U(se,ve,Ye,"≅","\\cong",!0);U(se,ve,Ye,"≥","\\ge");U(se,ve,Ye,"≥","\\geq",!0);U(se,ve,Ye,"←","\\gets");U(se,ve,Ye,">","\\gt",!0);U(se,ve,Ye,"∈","\\in",!0);U(se,ve,Ye,"","\\@not");U(se,ve,Ye,"⊂","\\subset",!0);U(se,ve,Ye,"⊃","\\supset",!0);U(se,ve,Ye,"⊆","\\subseteq",!0);U(se,ve,Ye,"⊇","\\supseteq",!0);U(se,We,Ye,"⊈","\\nsubseteq",!0);U(se,We,Ye,"⊉","\\nsupseteq",!0);U(se,ve,Ye,"⊨","\\models");U(se,ve,Ye,"←","\\leftarrow",!0);U(se,ve,Ye,"≤","\\le");U(se,ve,Ye,"≤","\\leq",!0);U(se,ve,Ye,"<","\\lt",!0);U(se,ve,Ye,"→","\\rightarrow",!0);U(se,ve,Ye,"→","\\to");U(se,We,Ye,"≱","\\ngeq",!0);U(se,We,Ye,"≰","\\nleq",!0);U(se,ve,U0," ","\\ ");U(se,ve,U0," ","\\space");U(se,ve,U0," ","\\nobreakspace");U(Dt,ve,U0," ","\\ ");U(Dt,ve,U0," "," ");U(Dt,ve,U0," ","\\space");U(Dt,ve,U0," ","\\nobreakspace");U(se,ve,U0,"","\\nobreak");U(se,ve,U0,"","\\allowbreak");U(se,ve,f7,",",",");U(se,ve,f7,";",";");U(se,We,hr,"⊼","\\barwedge",!0);U(se,We,hr,"⊻","\\veebar",!0);U(se,ve,hr,"⊙","\\odot",!0);U(se,ve,hr,"⊕","\\oplus",!0);U(se,ve,hr,"⊗","\\otimes",!0);U(se,ve,Je,"∂","\\partial",!0);U(se,ve,hr,"⊘","\\oslash",!0);U(se,We,hr,"⊚","\\circledcirc",!0);U(se,We,hr,"⊡","\\boxdot",!0);U(se,ve,hr,"△","\\bigtriangleup");U(se,ve,hr,"▽","\\bigtriangledown");U(se,ve,hr,"†","\\dagger");U(se,ve,hr,"⋄","\\diamond");U(se,ve,hr,"⋆","\\star");U(se,ve,hr,"◃","\\triangleleft");U(se,ve,hr,"▹","\\triangleright");U(se,ve,Xc,"{","\\{");U(Dt,ve,Je,"{","\\{");U(Dt,ve,Je,"{","\\textbraceleft");U(se,ve,Fl,"}","\\}");U(Dt,ve,Je,"}","\\}");U(Dt,ve,Je,"}","\\textbraceright");U(se,ve,Xc,"{","\\lbrace");U(se,ve,Fl,"}","\\rbrace");U(se,ve,Xc,"[","\\lbrack",!0);U(Dt,ve,Je,"[","\\lbrack",!0);U(se,ve,Fl,"]","\\rbrack",!0);U(Dt,ve,Je,"]","\\rbrack",!0);U(se,ve,Xc,"(","\\lparen",!0);U(se,ve,Fl,")","\\rparen",!0);U(Dt,ve,Je,"<","\\textless",!0);U(Dt,ve,Je,">","\\textgreater",!0);U(se,ve,Xc,"⌊","\\lfloor",!0);U(se,ve,Fl,"⌋","\\rfloor",!0);U(se,ve,Xc,"⌈","\\lceil",!0);U(se,ve,Fl,"⌉","\\rceil",!0);U(se,ve,Je,"\\","\\backslash");U(se,ve,Je,"∣","|");U(se,ve,Je,"∣","\\vert");U(Dt,ve,Je,"|","\\textbar",!0);U(se,ve,Je,"∥","\\|");U(se,ve,Je,"∥","\\Vert");U(Dt,ve,Je,"∥","\\textbardbl");U(Dt,ve,Je,"~","\\textasciitilde");U(Dt,ve,Je,"\\","\\textbackslash");U(Dt,ve,Je,"^","\\textasciicircum");U(se,ve,Ye,"↑","\\uparrow",!0);U(se,ve,Ye,"⇑","\\Uparrow",!0);U(se,ve,Ye,"↓","\\downarrow",!0);U(se,ve,Ye,"⇓","\\Downarrow",!0);U(se,ve,Ye,"↕","\\updownarrow",!0);U(se,ve,Ye,"⇕","\\Updownarrow",!0);U(se,ve,pa,"∐","\\coprod");U(se,ve,pa,"⋁","\\bigvee");U(se,ve,pa,"⋀","\\bigwedge");U(se,ve,pa,"⨄","\\biguplus");U(se,ve,pa,"⋂","\\bigcap");U(se,ve,pa,"⋃","\\bigcup");U(se,ve,pa,"∫","\\int");U(se,ve,pa,"∫","\\intop");U(se,ve,pa,"∬","\\iint");U(se,ve,pa,"∭","\\iiint");U(se,ve,pa,"∏","\\prod");U(se,ve,pa,"∑","\\sum");U(se,ve,pa,"⨂","\\bigotimes");U(se,ve,pa,"⨁","\\bigoplus");U(se,ve,pa,"⨀","\\bigodot");U(se,ve,pa,"∮","\\oint");U(se,ve,pa,"∯","\\oiint");U(se,ve,pa,"∰","\\oiiint");U(se,ve,pa,"⨆","\\bigsqcup");U(se,ve,pa,"∫","\\smallint");U(Dt,ve,b3,"…","\\textellipsis");U(se,ve,b3,"…","\\mathellipsis");U(Dt,ve,b3,"…","\\ldots",!0);U(se,ve,b3,"…","\\ldots",!0);U(se,ve,b3,"⋯","\\@cdots",!0);U(se,ve,b3,"⋱","\\ddots",!0);U(se,ve,Je,"⋮","\\varvdots");U(Dt,ve,Je,"⋮","\\varvdots");U(se,ve,fs,"ˊ","\\acute");U(se,ve,fs,"ˋ","\\grave");U(se,ve,fs,"¨","\\ddot");U(se,ve,fs,"~","\\tilde");U(se,ve,fs,"ˉ","\\bar");U(se,ve,fs,"˘","\\breve");U(se,ve,fs,"ˇ","\\check");U(se,ve,fs,"^","\\hat");U(se,ve,fs,"⃗","\\vec");U(se,ve,fs,"˙","\\dot");U(se,ve,fs,"˚","\\mathring");U(se,ve,Vr,"","\\@imath");U(se,ve,Vr,"","\\@jmath");U(se,ve,Je,"ı","ı");U(se,ve,Je,"ȷ","ȷ");U(Dt,ve,Je,"ı","\\i",!0);U(Dt,ve,Je,"ȷ","\\j",!0);U(Dt,ve,Je,"ß","\\ss",!0);U(Dt,ve,Je,"æ","\\ae",!0);U(Dt,ve,Je,"œ","\\oe",!0);U(Dt,ve,Je,"ø","\\o",!0);U(Dt,ve,Je,"Æ","\\AE",!0);U(Dt,ve,Je,"Œ","\\OE",!0);U(Dt,ve,Je,"Ø","\\O",!0);U(Dt,ve,fs,"ˊ","\\'");U(Dt,ve,fs,"ˋ","\\`");U(Dt,ve,fs,"ˆ","\\^");U(Dt,ve,fs,"˜","\\~");U(Dt,ve,fs,"ˉ","\\=");U(Dt,ve,fs,"˘","\\u");U(Dt,ve,fs,"˙","\\.");U(Dt,ve,fs,"¸","\\c");U(Dt,ve,fs,"˚","\\r");U(Dt,ve,fs,"ˇ","\\v");U(Dt,ve,fs,"¨",'\\"');U(Dt,ve,fs,"˝","\\H");U(Dt,ve,fs,"◯","\\textcircled");var cMe={"--":!0,"---":!0,"``":!0,"''":!0};U(Dt,ve,Je,"–","--",!0);U(Dt,ve,Je,"–","\\textendash");U(Dt,ve,Je,"—","---",!0);U(Dt,ve,Je,"—","\\textemdash");U(Dt,ve,Je,"‘","`",!0);U(Dt,ve,Je,"‘","\\textquoteleft");U(Dt,ve,Je,"’","'",!0);U(Dt,ve,Je,"’","\\textquoteright");U(Dt,ve,Je,"“","``",!0);U(Dt,ve,Je,"“","\\textquotedblleft");U(Dt,ve,Je,"”","''",!0);U(Dt,ve,Je,"”","\\textquotedblright");U(se,ve,Je,"°","\\degree",!0);U(Dt,ve,Je,"°","\\degree");U(Dt,ve,Je,"°","\\textdegree",!0);U(se,ve,Je,"£","\\pounds");U(se,ve,Je,"£","\\mathsterling",!0);U(Dt,ve,Je,"£","\\pounds");U(Dt,ve,Je,"£","\\textsterling",!0);U(se,We,Je,"✠","\\maltese");U(Dt,We,Je,"✠","\\maltese");var bde='0123456789/@."';for(var zB=0;zB{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return Rde[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return wFt[s]}else{if(n===120485||n===120486)return Rde[0];if(120486{if(kg(t.classes)!==kg(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},uMe=t=>{for(var e=0;er&&(r=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Ft=function(e,r,n,i){var s=new v3(e,r,n,i);return sJ(s),s},Eg=(t,e,r,n)=>new v3(t,e,r,n),x5=function(e,r,n){var i=Ft([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Yt(i.height),i.maxFontSize=1,i},SFt=function(e,r,n,i){var s=new ID(e,r,n,i);return sJ(s),s},Y0=function(e){var r=new y3(e);return sJ(r),r},w5=function(e,r){return e instanceof y3?Ft([],[e],r):e},EFt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,a=1;a{var r=Ft(["mspace"],[],e),n=xs(t,e);return r.style.marginRight=Yt(n),r},v8=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},zW={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},dMe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},fMe=function(e,r){var[n,i,s]=dMe[e],a=new Sg(n),o=new C0([a],{width:Yt(i),height:Yt(s),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Eg(["overlay"],[o],r);return l.height=s,l.style.height=Yt(s),l.style.width=Yt(i),l},vs={number:3,unit:"mu"},Im={number:4,unit:"mu"},pf={number:5,unit:"mu"},AFt={mord:{mop:vs,mbin:Im,mrel:pf,minner:vs},mop:{mord:vs,mop:vs,mrel:pf,minner:vs},mbin:{mord:Im,mop:Im,mopen:Im,minner:Im},mrel:{mord:pf,mop:pf,mopen:pf,minner:pf},mopen:{},mclose:{mop:vs,mbin:Im,mrel:pf,minner:vs},mpunct:{mord:vs,mop:vs,mrel:pf,mopen:vs,mclose:vs,mpunct:vs,minner:vs},minner:{mord:vs,mop:vs,mbin:Im,mrel:pf,mopen:vs,mpunct:vs,minner:vs}},MFt={mord:{mop:vs},mop:{mord:vs,mop:vs},mbin:{},mrel:{},mopen:{},mclose:{mop:vs},mpunct:{},minner:{mop:vs}},pMe={},yL={},vL={};function sr(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=m.classes[0],v=g.classes[0];y==="mbin"&&_Ft.has(v)?m.classes[0]="mord":v==="mbin"&&RFt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),VW(s,(g,m)=>{var y,v,x=GW(m),b=GW(g),T=x&&b?g.hasClass("mtight")?(y=MFt[x])==null?void 0:y[b]:(v=AFt[x])==null?void 0:v[b]:null;if(T)return hMe(T,u)},{node:d},f,p),s},VW=function(e,r,n,i,s){i&&e.push(i);for(var a=0;af=>{e.splice(d+1,0,f),a++})(a)}i&&e.pop()},gMe=function(e){return e instanceof y3||e instanceof ID||e instanceof v3&&e.hasClass("enclosing")?e:null},HW=function(e,r){var n=gMe(e);if(n){var i=n.children;if(i.length){if(r==="right")return HW(i[i.length-1],"right");if(r==="left")return HW(i[0],"left")}}return e},GW=function(e,r){if(!e)return null;r&&(e=HW(e,r));var n=e.classes[0];return IFt[n]||null},F6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ft(r.concat(n))},ui=function(e,r,n){if(!e)return Ft();if(yL[e.type]){var i=yL[e.type](e,r);if(n&&r.size!==n.size){i=Ft(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Gt("Got group of unknown type: '"+e.type+"'")};function b8(t,e){var r=Ft(["base"],t,e),n=Ft(["strut"]);return n.style.height=Yt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Yt(-r.depth)),r.children.unshift(n),r}function WW(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=_a(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(b8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(b8(a,e));var u;r?(u=b8(_a(r,e,!0),e),u.classes=["tag"],s.push(u)):i&&s.push(i);var h=Ft(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Yt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Yt(-h.depth))}return h}function mMe(t){return new y3(t)}class qt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=kg(this.classes));for(var n=0;n0&&(e+=' class ="'+Ho(kg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ua{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ho(this.toText())}toText(){return this.text}}class yMe{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Yt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var NFt=new Set(["\\imath","\\jmath"]),DFt=new Set(["mrow","mtable"]),Iu=function(e,r,n){return ls[r][e]&&ls[r][e].replace&&e.charCodeAt(0)!==55349&&!(cMe.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ls[r][e].replace),new ua(e)},aJ=function(e){return e.length===1?e[0]:new qt("mrow",e)},OFt={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},oJ=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=OFt[r];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(NFt.has(s))return null;if(ls[n][s]){var a=ls[n][s].replace;a&&(s=a)}var o=zW[r].fontName;return nJ(s,o,n)?zW[r].variant:null};function WB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ua&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof ua&&r.text===","}else return!1}var Kc=function(e,r,n){if(e.length===1){var i=Mi(e[0],r);return n&&i instanceof qt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||WB(a))){var u=l.children[0];u instanceof qt&&u.type==="mn"&&(u.children=[...a.children,...u.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof ua&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ua&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},Ag=function(e,r,n){return aJ(Kc(e,r,n))},Mi=function(e,r){if(!e)return new qt("mrow");if(vL[e.type])return vL[e.type](e,r);throw new Gt("Got group of unknown type: '"+e.type+"'")};function _de(t,e,r,n,i){var s=Kc(t,r),a;s.length===1&&s[0]instanceof qt&&DFt.has(s[0].type)?a=s[0]:a=new qt("mrow",s);var o=new qt("annotation",[new ua(e)]);o.setAttribute("encoding","application/x-tex");var l=new qt("semantics",[a,o]),u=new qt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Ft([h],[u])}var PFt=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Lde=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ide=function(e,r){return r.size<2?e:PFt[e-1][r.size-1]};class _f{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||_f.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Lde[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new _f(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Ide(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Lde[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Ide(_f.BASESIZE,e);return this.size===r&&this.textSize===_f.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==_f.BASESIZE?["sizing","reset-size"+this.size,"size"+_f.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=bFt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}_f.BASESIZE=6;var vMe=function(e){return new _f({style:e.displayMode?dn.DISPLAY:dn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},bMe=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Ft(n,[e])}return e},$Ft=function(e,r,n){var i=vMe(n),s;if(n.output==="mathml")return _de(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=WW(e,i);s=Ft(["katex"],[a])}else{var o=_de(e,r,i,n.displayMode,!1),l=WW(e,i);s=Ft(["katex"],[o,l])}return bMe(s,n)},BFt=function(e,r,n){var i=vMe(n),s=WW(e,i),a=Ft(["katex"],[s]);return bMe(a,n)},FFt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},OD=function(e){var r=new qt("mo",[new ua(FFt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},zFt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},VFt=new Set(["widehat","widecheck","widetilde","utilde"]),PD=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(VFt.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new Sg(d),m=new C0([g],{width:"100%",height:Yt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Eg([],[m],r),minWidth:0,height:f}}else{var y=[],v=zFt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,T]=v,C=T/1e3,S=x.length,k,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],E=[v[3]]}else if(S===2)k=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)k=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+S+" children.");for(var A=0;A0&&(i.style.minWidth=Yt(s)),i},HFt=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=Ft(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new DW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new DW({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new C0(u,{width:"100%",height:Yt(o)});a=Eg([],[h],s)}return a.height=o,a.style.height=Yt(o),a},GFt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},WFt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function qFt(t){return t in GFt}function bn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function $D(t){var e=BD(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function BD(t){return t&&(t.type==="atom"||WFt.hasOwnProperty(t.type))?t:null}var xMe=t=>{if(t instanceof Wc)return t;if(vFt(t)&&t.children.length===1)return xMe(t.children[0])},lJ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=bn(t.base,"accent"),r=n.base,t.base=r,i=yFt(ui(t,e)),t.base=n):(n=bn(t,"accent"),r=n.base);var s=ui(r,e.havingCrampedStyle()),a=n.isShifty&&q0(r),o=0;if(a){var l,u;o=(l=(u=xMe(s))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=PD(n,e),f=ci({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Yt(2*o)+")",marginLeft:Yt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=fMe("vec",e),g=dMe.vec[1]):(p=DD({mode:n.mode,text:n.label},e,"textord"),p=mFt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Ft(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var y=o;m||(y-=g/2),f.style.left=Yt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=ci({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Ft(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},wMe=(t,e)=>{var r=t.isStretchy?OD(t.label):new qt("mo",[Iu(t.label,t.mode)]),n=new qt("mover",[Mi(t.base,e),r]);return n.setAttribute("accent","true"),n},UFt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));sr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=bL(e[0]),n=!UFt.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:lJ,mathmlBuilder:wMe});sr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:lJ,mathmlBuilder:wMe});sr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=ui(t.base,e),n=PD(t,e),i=t.label==="\\utilde"?.12:0,s=ci({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Ft(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=OD(t.label),n=new qt("munder",[Mi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var x8=t=>{var e=new qt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};sr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=w5(ui(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(n=e.havingStyle(r.sub()),a=w5(ui(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=PD(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(a){var d=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=ci({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else h=ci({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ft(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=OD(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=x8(Mi(t.body,e));if(t.below){var s=x8(Mi(t.below,e));n=new qt("munderover",[r,s,i])}else n=new qt("mover",[r,i])}else if(t.below){var a=x8(Mi(t.below,e));n=new qt("munder",[r,a])}else n=x8(),n=new qt("mover",[r,n]);return n}});function TMe(t,e){var r=_a(t.body,e,!0);return Ft([t.mclass],r,e)}function CMe(t,e){var r,n=Kc(t.body,e);return t.mclass==="minner"?r=new qt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new qt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new qt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}sr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ca(i),isCharacterBox:q0(i)}},htmlBuilder:TMe,mathmlBuilder:CMe});var FD=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};sr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:FD(e[0]),body:ca(e[1]),isCharacterBox:q0(e[1])}}});sr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],s=e[0],a;n!=="\\stackrel"?a=FD(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ca(i)},l={type:"supsub",mode:s.mode,base:o,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:r.mode,mclass:a,body:[l],isCharacterBox:q0(l)}},htmlBuilder:TMe,mathmlBuilder:CMe});sr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:FD(e[0]),body:ca(e[0])}},htmlBuilder(t,e){var r=_a(t.body,e,!0),n=Ft([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=Kc(t.body,e),n=new qt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var YFt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Nde=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Dde=t=>t.type==="textord"&&t.text==="@",jFt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function XFt(t,e,r){var n=YFt[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},a=r.callFunction("\\Big",[s],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function KFt(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Gt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;sAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',a[l]);var g=XFt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=Nde()}s%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}sr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=w5(ui(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Yt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new qt("mrow",[Mi(t.label,e)]);return r=new qt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new qt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});sr({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=w5(ui(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new qt("mrow",[Mi(t.fragment,e)])}});sr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=bn(e[0],"ordgroup"),i=n.body,s="",a=0;a=1114111)throw new Gt("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var kMe=(t,e)=>{var r=_a(t.body,e.withColor(t.color),!1);return Y0(r)},SMe=(t,e)=>{var r=Kc(t.body,e.withColor(t.color)),n=new qt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};sr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=bn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:ca(i)}},htmlBuilder:kMe,mathmlBuilder:SMe});sr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=bn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}},htmlBuilder:kMe,mathmlBuilder:SMe});sr({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&bn(i,"size").value}},htmlBuilder(t,e){var r=Ft(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Yt(xs(t.size,e)))),r},mathmlBuilder(t,e){var r=new qt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Yt(xs(t.size,e)))),r}});var qW={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},EMe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},ZFt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},AMe=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};sr({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(qW[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=qW[n.text]),bn(e.parseFunction(),"internal");throw new Gt("Invalid token after macro prefix",n)}});sr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Gt("Expected a control sequence",n);for(var s=0,a,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Gt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Gt('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if(n.text==="EOF")throw new Gt("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===qW[r]),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=EMe(e.gullet.popToken());e.gullet.consumeSpaces();var i=ZFt(e);return AMe(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=EMe(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return AMe(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ck=function(e,r,n){var i=ls.math[e]&&ls.math[e].replace,s=nJ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},cJ=function(e,r,n,i){var s=n.havingBaseStyle(r),a=Ft(i.concat(s.sizingClasses(n)),[e],n),o=s.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},MMe=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Yt(s),e.height-=s,e.depth+=s},QFt=function(e,r,n,i,s,a){var o=hl(e,"Main-Regular",s,i),l=cJ(o,r,i,a);return MMe(l,i,r),l},JFt=function(e,r,n,i){return hl(e,"Size"+r+"-Regular",n,i)},RMe=function(e,r,n,i,s,a){var o=JFt(e,r,s,i),l=cJ(Ft(["delimsizing","size"+r],[o],i),dn.TEXT,i,a);return n&&MMe(l,i,dn.TEXT),l},qB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=Ft(["delimsizinginner",i],[Ft([],[hl(e,r,n)])]);return{type:"elem",elem:s}},UB=function(e,r,n){var i=yd["Size4-Regular"][e.charCodeAt(0)]?yd["Size4-Regular"][e.charCodeAt(0)][4]:yd["Size1-Regular"][e.charCodeAt(0)][4],s=new Sg("inner",cFt(e,Math.round(1e3*r))),a=new C0([s],{width:Yt(i),height:Yt(r),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Eg([],[a],n);return o.height=r,o.style.height=Yt(r),o.style.width=Yt(i),{type:"elem",elem:o}},UW=.008,w8={type:"kern",size:-1*UW},ezt=new Set(["|","\\lvert","\\rvert","\\vert"]),tzt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),_Me=function(e,r,n,i,s,a){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):ezt.has(e)?(u="∣",d="vert",f=333):tzt.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=ck(o,p,s),m=g.height+g.depth,y=ck(u,p,s),v=y.height+y.depth,x=ck(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=ck(l,p,s);T=S.height+S.depth,C=2}var k=m+b+T,E=Math.max(0,Math.ceil((r-k)/(C*v))),A=k+E*C*v,R=i.fontMetrics().axisHeight;n&&(R*=i.sizeMultiplier);var _=A/2-R,P=[];if(d.length>0){var N=A-m-b,L=Math.round(A*1e3),I=uFt(d,Math.round(N*1e3)),$=new Sg(d,I),O=Yt(f/1e3),D=Yt(L/1e3),F=new C0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=Eg([],[F],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(qB(h,p,s)),P.push(w8),l===null){var V=A-m-b+2*UW;P.push(UB(u,V,i))}else{var B=(A-m-b-T)/2+2*UW;P.push(UB(u,B,i)),P.push(w8),P.push(qB(l,p,s)),P.push(w8),P.push(UB(u,B,i))}P.push(w8),P.push(qB(o,p,s))}var H=i.havingBaseStyle(dn.TEXT),G=ci({positionType:"bottom",positionData:_,children:P});return cJ(Ft(["delimsizing","mult"],[G],H),dn.TEXT,i,a)},YB=80,jB=.08,XB=function(e,r,n,i,s){var a=lFt(e,i,n),o=new Sg(e,a),l=new C0([o],{width:"400em",height:Yt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Eg(["hide-tail"],[l],s)},rzt=function(e,r){var n=r.havingBaseSizing(),i=OMe("\\surd",e*n.sizeMultiplier,DMe,n),s=n.sizeMultiplier,a=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*a+YB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+jB)/s,u=(1+a)/s,o=XB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+YB)*lS[i.size],u=(lS[i.size]+a)/s,l=(lS[i.size]+a+jB)/s,o=XB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+jB,u=e+a,h=Math.floor(1e3*e+a)+YB,o=XB("sqrtTall",l,h,a,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Yt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+a)*s}},LMe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),nzt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),IMe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),lS=[0,1.2,1.8,2.4,3],NMe=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),LMe.has(e)||IMe.has(e))return RMe(e,r,!1,n,i,s);if(nzt.has(e))return _Me(e,lS[r],!1,n,i,s);throw new Gt("Illegal delimiter: '"+e+"'")},izt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],szt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"stack"}],DMe=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],azt=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},OMe=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),a=s;ar)return o}return n[n.length-1]},YW=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;IMe.has(e)?o=izt:LMe.has(e)?o=DMe:o=szt;var l=OMe(e,r,o,i);return l.type==="small"?QFt(e,l.style,n,i,s,a):l.type==="large"?RMe(e,l.size,n,i,s,a):_Me(e,r,n,i,s,a)},KB=function(e,r,n,i,s,a){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return YW(e,d,!0,i,s,a)},Ode={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ozt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Pde(t){return"isMiddle"in t}function zD(t,e){var r=BD(t);if(r&&ozt.has(r.text))return r;throw r?new Gt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Gt("Invalid delimiter type '"+t.type+"'",t)}sr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=zD(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Ode[t.funcName].size,mclass:Ode[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ft([t.mclass]):NMe(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Iu(t.delim,t.mode));var r=new qt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Yt(lS[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function $de(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}sr({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Gt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:zD(e[0],t).text,color:r}}});sr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=zD(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=bn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{$de(t);for(var r=_a(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{$de(t);var r=Kc(t.body,e);if(t.left!=="."){var n=new qt("mo",[Iu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new qt("mo",[Iu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return aJ(r)}});sr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=zD(e[0],t);if(!t.parser.leftrightDepth)throw new Gt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=F6(e,[]):(r=NMe(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Iu("|","text"):Iu(t.delim,t.mode),n=new qt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var VD=(t,e)=>{var r=w5(ui(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,a,o=q0(t.body);if(n==="sout")s=Ft(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=xs({number:.6,unit:"pt"},e),u=xs({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Yt(d/2+l);var f=Math.floor(1e3*d*i),p=aFt(f),g=new C0([new Sg("phase",p)],{width:"400em",height:Yt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Eg(["hide-tail"],[g],e),s.style.height=Yt(d),a=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),s=HFt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Yt(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Yt(v),s.style.borderRightWidth=Yt(v)),a=r.depth+y,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=ci({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=ci({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?Ft(["mord","cancel-lap"],[x],e):Ft(["mord"],[x],e)},HD=(t,e)=>{var r,n=new qt(t.label.includes("colorbox")?"mpadded":"menclose",[Mi(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Yt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};sr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=bn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:VD,mathmlBuilder:HD});sr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=bn(e[0],"color-token").color,a=bn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,borderColor:s,body:o}},htmlBuilder:VD,mathmlBuilder:HD});sr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});sr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:VD,mathmlBuilder:HD});sr({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:VD,mathmlBuilder:HD});sr({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var PMe={};function Xd(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Gt("{"+t.envName+"} can be used only in display mode.")},lzt=new Set(["gather","gather*"]);function uJ(t){if(!t.includes("ed"))return!t.includes("*")}function tm(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)a=1;else if(a=parseFloat(p),!a||a<0)throw new Gt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new zc("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(Bde(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new Gt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){T(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:Ce[ne]})}for(T(a[0]),n=0;n0&&(_+=x,k<_&&(k=_),_=0)),e.addJot&&nCe))for(n=0;n=o)){var Q=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,re;Q=(Z=(re=H)==null?void 0:re.pregap)!=null?Z:f,Q!==0&&(I=Ft(["arraycolsep"],[]),I.style.width=Yt(Q),L.push(I))}var ie=[];for(n=0;n0){for(var ge=x5("hline",r,h),He=x5("hdashline",r,h),we=[{type:"elem",elem:Te,shift:0}];u.length>0;){var Me=u.pop(),je=Me.pos-P;Me.isDashed?we.push({type:"elem",elem:He,shift:je}):we.push({type:"elem",elem:ge,shift:je})}Te=ci({positionType:"individualShift",children:we})}if(O.length===0)return Ft(["mord"],[Te],r);var le=ci({positionType:"individualShift",children:O}),pe=Ft(["tag"],[le],r);return Y0([Te,pe])},czt={c:"center ",l:"left ",r:"right "},Zd=function(e,r){for(var n=[],i=new qt("mtd",[],["mtr-glue"]),s=new qt("mtd",[],["mml-eqn-num"]),a=0;a0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=A[A.length-1].length>0?"right ":"";for(var R=1;R0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return a.colSeparationType=p?"align":"alignat",a};Xd({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=BD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(a){var o=$D(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Gt("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return tm(t.parser,s,hJ(t.envName))},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Gt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=tm(t.parser,n,hJ(t.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=tm(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=BD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(o){var l=$D(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Gt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Gt("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},a=tm(t.parser,s,"script");if(a.body.length>0&&a.body[0].length>1)throw new Gt("{subarray} can contain only one column");return a},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=tm(t.parser,e,hJ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:BMe,htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){lzt.has(t.envName)&&GD(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:uJ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return tm(t.parser,e,"display")},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:BMe,htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){GD(t);var e={autoTag:uJ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return tm(t.parser,e,"display")},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return GD(t),KFt(t.parser)},htmlBuilder:Kd,mathmlBuilder:Zd});Se("\\nonumber","\\gdef\\@eqnsw{0}");Se("\\notag","\\nonumber");sr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Gt(t.funcName+" valid only within array environment")}});var Fde=PMe;sr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Gt("Invalid environment name",i);for(var s="",a=0;a{var r=t.font,n=e.withFont(r);return ui(t.body,n)},zMe=(t,e)=>{var r=t.font,n=e.withFont(r);return Mi(t.body,n)},zde={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};sr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=bL(e[0]),s=n;return s in zde&&(s=zde[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:FMe,mathmlBuilder:zMe});sr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:FD(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:q0(n)}}});sr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:s}=r,a=r.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:a}}},htmlBuilder:FMe,mathmlBuilder:zMe});var uzt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=ui(t.numer,s,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var x=e.fontMetrics().axisHeight;p-a.depth-(x+.5*d){var r=new qt("mfrac",[Mi(t.numer,e),Mi(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=xs(t.barSize,e);r.setAttribute("linethickness",Yt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var s=new qt("mo",[new ua(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(r),t.rightDelim!=null){var a=new qt("mo",[new ua(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return aJ(i)}return r},VMe=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};sr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1],a,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),VMe({type:"genfrac",mode:r.mode,numer:i,denom:s,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:uzt,mathmlBuilder:hzt});sr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Vde=["display","text","script","scriptscript"],Hde=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};sr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],s=bL(e[0]),a=s.type==="atom"&&s.family==="open"?Hde(s.text):null,o=bL(e[1]),l=o.type==="atom"&&o.family==="close"?Hde(o.text):null,u=bn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=bn(p.body[0],"textord");f=Vde[Number(g.text)]}}else p=bn(p,"textord"),f=Vde[Number(p.text)];return VMe({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:a,rightDelim:l},f)}});sr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:bn(e[0],"size").value,token:i}}});sr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=bn(e[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var a=e[2],o=s.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:o,barSize:s,leftDelim:null,rightDelim:null}}});var HMe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?ui(t.sup,e.havingStyle(r.sup()),e):ui(t.sub,e.havingStyle(r.sub()),e),i=bn(t.base,"horizBrace")):i=bn(t,"horizBrace");var s=ui(i.base,e.havingBaseStyle(dn.DISPLAY)),a=PD(i,e),o;if(i.isOver?o=ci({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=ci({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),n){var l=Ft(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=ci({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=ci({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ft(["minner",i.isOver?"mover":"munder"],[o],e)},dzt=(t,e)=>{var r=OD(t.label);return new qt(t.isOver?"mover":"munder",[Mi(t.base,e),r])};sr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:HMe,mathmlBuilder:dzt});sr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=bn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:ca(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=_a(t.body,e,!1);return SFt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Ag(t.body,e);return r instanceof qt||(r=new qt("mrow",[r])),r.setAttribute("href",t.href),r}});sr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=bn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:r,funcName:n,token:i}=t,s=bn(e[0],"raw").string,a=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=s,o={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,o={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,o={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),h=0;h{var r=_a(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Ft(n,r,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>Ag(t.body,e)});sr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:ca(e[0]),mathml:ca(e[1])}},htmlBuilder:(t,e)=>{var r=_a(t.html,e,!1);return Y0(r)},mathmlBuilder:(t,e)=>Ag(t.mathml,e)});var ZB=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Gt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!iMe(n))throw new Gt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};sr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(r[0])for(var l=bn(r[0],"raw").string,u=l.split(","),h=0;h{var r=xs(t.height,e),n=0;t.totalheight.number>0&&(n=xs(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=xs(t.width,e));var s={height:Yt(r+n)};i>0&&(s.width=Yt(i)),n>0&&(s.verticalAlign=Yt(-n));var a=new pFt(t.src,t.alt,s);return a.height=r,a.depth=n,a},mathmlBuilder:(t,e)=>{var r=new qt("mglyph",[]);r.setAttribute("alt",t.alt);var n=xs(t.height,e),i=0;if(t.totalheight.number>0&&(i=xs(t.totalheight,e)-n,r.setAttribute("valign",Yt(-i))),r.setAttribute("height",Yt(n+i)),t.width.number>0){var s=xs(t.width,e);r.setAttribute("width",Yt(s))}return r.setAttribute("src",t.src),r}});sr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=bn(e[0],"size");if(r.settings.strict){var s=n[1]==="m",a=i.value.unit==="mu";s?(a||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):a&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return hMe(t.dimension,e)},mathmlBuilder(t,e){var r=xs(t.dimension,e);return new yMe(r)}});sr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Ft([],[ui(t.body,e)]),r=Ft(["inner"],[r],e)):r=Ft(["inner"],[ui(t.body,e)]);var n=Ft(["fix"],[]),i=Ft([t.alignment],[r,n],e),s=Ft(["strut"]);return s.style.height=Yt(i.height+i.depth),i.depth&&(s.style.verticalAlign=Yt(-i.depth)),i.children.unshift(s),i=Ft(["thinbox"],[i],e),Ft(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new qt("mpadded",[Mi(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});sr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var s=r==="\\("?"\\)":"$",a=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:a}}});sr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Gt("Mismatched "+t.funcName)}});var Gde=(t,e)=>{switch(e.style.size){case dn.DISPLAY.size:return t.display;case dn.TEXT.size:return t.text;case dn.SCRIPT.size:return t.script;case dn.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};sr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:ca(e[0]),text:ca(e[1]),script:ca(e[2]),scriptscript:ca(e[3])}},htmlBuilder:(t,e)=>{var r=Gde(t,e),n=_a(r,e,!1);return Y0(n)},mathmlBuilder:(t,e)=>{var r=Gde(t,e);return Ag(r,e)}});var GMe=(t,e,r,n,i,s,a)=>{t=Ft([],[t]);var o=r&&q0(r),l,u;if(e){var h=ui(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=ui(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+a;f=ci({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-a;f=ci({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+a;f=ci({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&s!==0&&!o){var v=Ft(["mspace"],[],n);v.style.marginRight=Yt(s),y.unshift(v)}return Ft(["mop","op-limits"],y,n)},WMe=new Set(["\\smallint"]),x3=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=bn(t.base,"op"),i=!0):s=bn(t,"op");var a=e.style,o=!1;a.size===dn.DISPLAY.size&&s.symbol&&!WMe.has(s.name)&&(o=!0);var l,u;if(s.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=hl(s.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=fMe(d+"Size"+(o?"2":"1"),e);l=ci({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(s.body){var p=_a(s.body,e,!0);p.length===1&&p[0]instanceof Wc?(l=p[0],l.classes[0]="mop"):l=Ft(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new qt("mo",[Iu(t.name,t.mode)]),WMe.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new qt("mo",Kc(t.body,e));else{r=new qt("mi",[new ua(t.name.slice(1))]);var n=new qt("mo",[Iu("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=mMe([r,n])}return r},fzt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};sr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=fzt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:x3,mathmlBuilder:p7});sr({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ca(n)}},htmlBuilder:x3,mathmlBuilder:p7});var pzt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};sr({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:x3,mathmlBuilder:p7});sr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:x3,mathmlBuilder:p7});sr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=pzt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:x3,mathmlBuilder:p7});var qMe=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=bn(t.base,"operatorname"),i=!0):s=bn(t,"operatorname");var a;if(s.body.length>0){for(var o=s.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=_a(o,e.withFont("mathrm"),!0),u=0;u{for(var r=Kc(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new ua(o)]}var l=new qt("mi",r);l.setAttribute("mathvariant","normal");var u=new qt("mo",[Iu("⁡","text")]);return t.parentIsSupSub?new qt("mrow",[l,u]):mMe([l,u])};sr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:ca(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:qMe,mathmlBuilder:gzt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");nv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Y0(_a(t.body,e,!1)):Ft(["mord"],_a(t.body,e,!0),e)},mathmlBuilder(t,e){return Ag(t.body,e,!0)}});sr({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=ui(t.body,e.havingCrampedStyle()),n=x5("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ci({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Ft(["mord","overline"],[s],e)},mathmlBuilder(t,e){var r=new qt("mo",[new ua("‾")]);r.setAttribute("stretchy","true");var n=new qt("mover",[Mi(t.body,e),r]);return n.setAttribute("accent","true"),n}});sr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:ca(n)}},htmlBuilder:(t,e)=>{var r=_a(t.body,e.withPhantom(),!1);return Y0(r)},mathmlBuilder:(t,e)=>{var r=Kc(t.body,e);return new qt("mphantom",r)}});Se("\\hphantom","\\smash{\\phantom{#1}}");sr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Ft(["inner"],[ui(t.body,e.withPhantom())]),n=Ft(["fix"],[]);return Ft(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Kc(ca(t.body),e),n=new qt("mphantom",r),i=new qt("mpadded",[n]);return i.setAttribute("width","0px"),i}});sr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=bn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=ui(t.body,e),n=xs(t.dy,e);return ci({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[Mi(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});sr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});sr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],s=bn(e[0],"size"),a=bn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&bn(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var r=Ft(["mord","rule"],[],e),n=xs(t.width,e),i=xs(t.height,e),s=t.shift?xs(t.shift,e):0;return r.style.borderRightWidth=Yt(n),r.style.borderTopWidth=Yt(i),r.style.bottom=Yt(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=xs(t.width,e),n=xs(t.height,e),i=t.shift?xs(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new qt("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Yt(r)),a.setAttribute("height",Yt(n));var o=new qt("mpadded",[a]);return i>=0?o.setAttribute("height",Yt(i)):(o.setAttribute("height",Yt(i)),o.setAttribute("depth",Yt(-i))),o.setAttribute("voffset",Yt(i)),o}});function UMe(t,e,r){for(var n=_a(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return UMe(t.body,r,e)};sr({type:"sizing",names:Wde,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:Wde.indexOf(n)+1,body:s}},htmlBuilder:mzt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=Kc(t.body,r),i=new qt("mstyle",n);return i.setAttribute("mathsize",Yt(r.sizeMultiplier)),i}});sr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,s=!1,a=r[0]&&bn(r[0],"ordgroup");if(a)for(var o,l=0;l{var r=Ft([],[ui(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Ft(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new qt("mpadded",[Mi(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});sr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=ui(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=w5(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idr.height+r.depth+a&&(a=(a+d-r.height-r.depth)/2);var f=l.height-r.height-a-u;r.style.paddingLeft=Yt(h);var p=ci({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(dn.SCRIPTSCRIPT),m=ui(t.index,g,e),y=.6*(p.height-p.depth),v=ci({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=Ft(["root"],[v]);return Ft(["mord","sqrt"],[x,p],e)}else return Ft(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new qt("mroot",[Mi(r,e),Mi(n,e)]):new qt("msqrt",[Mi(r,e)])}});var jW={display:dn.DISPLAY,text:dn.TEXT,script:dn.SCRIPT,scriptscript:dn.SCRIPTSCRIPT};function yzt(t){return t in jW}sr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!0,r),a=n.slice(1,n.length-5);if(!yzt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=jW[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),UMe(t.body,n,e)},mathmlBuilder(t,e){var r=jW[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=Kc(t.body,n),s=new qt("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var vzt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===dn.DISPLAY.size||n.alwaysHandleSupSub);return i?x3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===dn.DISPLAY.size||n.limits);return s?qMe:null}else{if(n.type==="accent")return q0(n.base)?lJ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?HMe:null}else return null}else return null};nv({type:"supsub",htmlBuilder(t,e){var r=vzt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=ui(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&q0(n);if(i){var p=e.havingStyle(e.style.sup());o=ui(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=ui(s,g,e),f||(d=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===dn.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Yt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(a instanceof Wc||b){var T;x=Yt(-((T=a.italic)!=null?T:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var A=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];C=ci({positionType:"individualShift",children:A})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var R=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];C=ci({positionType:"shift",positionData:d,children:R})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=ci({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var _=GW(a,"right")||"mord";return Ft([_],[a,Ft(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Mi(t.base,e)];t.sub&&s.push(Mi(t.sub,e)),t.sup&&s.push(Mi(t.sup,e));var a;if(r)a=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===dn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===dn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===dn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===dn.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===dn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===dn.DISPLAY)?a="mover":a="msup"}return new qt(a,s)}});nv({type:"atom",htmlBuilder(t,e){return iJ(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new qt("mo",[Iu(t.text,t.mode)]);if(t.family==="bin"){var n=oJ(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var YMe={mi:"italic",mn:"normal",mtext:"normal"};nv({type:"mathord",htmlBuilder(t,e){return DD(t,e,"mathord")},mathmlBuilder(t,e){var r=new qt("mi",[Iu(t.text,t.mode,e)]),n=oJ(t,e)||"italic";return n!==YMe[r.type]&&r.setAttribute("mathvariant",n),r}});nv({type:"textord",htmlBuilder(t,e){return DD(t,e,"textord")},mathmlBuilder(t,e){var r=Iu(t.text,t.mode,e),n=oJ(t,e)||"normal",i;return t.mode==="text"?i=new qt("mtext",[r]):/[0-9]/.test(t.text)?i=new qt("mn",[r]):t.text==="\\prime"?i=new qt("mo",[r]):i=new qt("mi",[r]),n!==YMe[i.type]&&i.setAttribute("mathvariant",n),i}});var QB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},JB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};nv({type:"spacing",htmlBuilder(t,e){if(JB.hasOwnProperty(t.text)){var r=JB[t.text].className||"";if(t.mode==="text"){var n=DD(t,e,"textord");return n.classes.push(r),n}else return Ft(["mspace",r],[iJ(t.text,t.mode,e)],e)}else{if(QB.hasOwnProperty(t.text))return Ft(["mspace",QB[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(JB.hasOwnProperty(t.text))r=new qt("mtext",[new ua(" ")]);else{if(QB.hasOwnProperty(t.text))return new qt("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var qde=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};nv({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[qde(),new qt("mtd",[Ag(t.body,e)]),qde(),new qt("mtd",[Ag(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Ude={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Yde={"\\textbf":"textbf","\\textmd":"textmd"},bzt={"\\textit":"textit","\\textup":"textup"},jde=(t,e)=>{var r=t.font;if(r){if(Ude[r])return e.withTextFontFamily(Ude[r]);if(Yde[r])return e.withTextFontWeight(Yde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(bzt[r])};sr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:ca(i),font:n}},htmlBuilder(t,e){var r=jde(t,e),n=_a(t.body,r,!0);return Ft(["mord","text"],n,r)},mathmlBuilder(t,e){var r=jde(t,e);return Ag(t.body,r)}});sr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=ui(t.body,e),n=x5("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ci({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Ft(["mord","underline"],[s],e)},mathmlBuilder(t,e){var r=new qt("mo",[new ua("‾")]);r.setAttribute("stretchy","true");var n=new qt("munder",[Mi(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});sr({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=ui(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return ci({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[Mi(t.body,e)],["vcenter"]);return new qt("mrow",[r])}});sr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Gt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Xde(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),Wp=pMe,jMe=`[ \r + ]`,xzt="\\\\[a-zA-Z@]+",wzt="\\\\[^\uD800-\uDFFF]",Tzt="("+xzt+")"+jMe+"*",Czt=`\\\\( |[ \r ]+ -?)[ \r ]*`,qW="[̀-ͯ]",lzt=new RegExp(qW+"+$"),czt="("+HMe+"+)|"+(ozt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(qW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(qW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+azt)+("|"+szt+")");let Wde=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(czt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new $c("EOF",new ec(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Gt("Unexpected character: '"+e[r]+"'",new $c(e[r],new ec(this,r,r+1)));var i=n[6]||n[3]||(n[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 $c(i,new ec(this,r,this.tokenRegex.lastIndex))}};class uzt{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Gt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var hzt=LMe;Se("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var qde={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};Se("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Gt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=qde[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=qde[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Gt("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Gt("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new Gt("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Gt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};Se("\\newcommand",t=>lJ(t,!1,!0,!1));Se("\\renewcommand",t=>lJ(t,!0,!1,!1));Se("\\providecommand",t=>lJ(t,!0,!0,!0));Se("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Se("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Se("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),zp[r],ls.math[r],ls.text[r]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Se("∉","\\notin");Se("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Se("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Se("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Se("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Se("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Se("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Se("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Se("⟂","\\perp");Se("‼","\\mathclose{!\\mkern-0.8mu!}");Se("∌","\\notni");Se("⌜","\\ulcorner");Se("⌝","\\urcorner");Se("⌞","\\llcorner");Se("⌟","\\lrcorner");Se("©","\\copyright");Se("®","\\textregistered");Se("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Se("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Se("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Se("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Se("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Se("⋮","\\vdots");Se("\\varGamma","\\mathit{\\Gamma}");Se("\\varDelta","\\mathit{\\Delta}");Se("\\varTheta","\\mathit{\\Theta}");Se("\\varLambda","\\mathit{\\Lambda}");Se("\\varXi","\\mathit{\\Xi}");Se("\\varPi","\\mathit{\\Pi}");Se("\\varSigma","\\mathit{\\Sigma}");Se("\\varUpsilon","\\mathit{\\Upsilon}");Se("\\varPhi","\\mathit{\\Phi}");Se("\\varPsi","\\mathit{\\Psi}");Se("\\varOmega","\\mathit{\\Omega}");Se("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Se("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Se("\\boxed","\\fbox{$\\displaystyle{#1}$}");Se("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Se("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Se("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Se("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Se("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Ude={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},dzt=new Set(["bin","rel"]);Se("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Ude?e=Ude[r]:(r.slice(0,4)==="\\not"||r in ls.math&&dzt.has(ls.math[r].group))&&(e="\\dotsb"),e});var cJ={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Se("\\dotso",function(t){var e=t.future().text;return e in cJ?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in cJ&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in cJ?"\\@cdots\\,":"\\@cdots"});Se("\\dotsb","\\cdots");Se("\\dotsm","\\cdots");Se("\\dotsi","\\!\\cdots");Se("\\dotsx","\\ldots\\,");Se("\\DOTSI","\\relax");Se("\\DOTSB","\\relax");Se("\\DOTSX","\\relax");Se("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Se("\\,","\\tmspace+{3mu}{.1667em}");Se("\\thinspace","\\,");Se("\\>","\\mskip{4mu}");Se("\\:","\\tmspace+{4mu}{.2222em}");Se("\\medspace","\\:");Se("\\;","\\tmspace+{5mu}{.2777em}");Se("\\thickspace","\\;");Se("\\!","\\tmspace-{3mu}{.1667em}");Se("\\negthinspace","\\!");Se("\\negmedspace","\\tmspace-{4mu}{.2222em}");Se("\\negthickspace","\\tmspace-{5mu}{.277em}");Se("\\enspace","\\kern.5em ");Se("\\enskip","\\hskip.5em\\relax");Se("\\quad","\\hskip1em\\relax");Se("\\qquad","\\hskip2em\\relax");Se("\\tag","\\@ifstar\\tag@literal\\tag@paren");Se("\\tag@paren","\\tag@literal{({#1})}");Se("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Gt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Se("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Se("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Se("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Se("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Se("\\newline","\\\\\\relax");Se("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var GMe=Yt(pd["Main-Regular"][84][1]-.7*pd["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+GMe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+GMe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Se("\\hspace","\\@ifstar\\@hspacer\\@hspace");Se("\\@hspace","\\hskip #1\\relax");Se("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Se("\\ordinarycolon",":");Se("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Se("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Se("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Se("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Se("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Se("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Se("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Se("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Se("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Se("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Se("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Se("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Se("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Se("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Se("∷","\\dblcolon");Se("∹","\\eqcolon");Se("≔","\\coloneqq");Se("≕","\\eqqcolon");Se("⩴","\\Coloneqq");Se("\\ratio","\\vcentcolon");Se("\\coloncolon","\\dblcolon");Se("\\colonequals","\\coloneqq");Se("\\coloncolonequals","\\Coloneqq");Se("\\equalscolon","\\eqqcolon");Se("\\equalscoloncolon","\\Eqqcolon");Se("\\colonminus","\\coloneq");Se("\\coloncolonminus","\\Coloneq");Se("\\minuscolon","\\eqcolon");Se("\\minuscoloncolon","\\Eqcolon");Se("\\coloncolonapprox","\\Colonapprox");Se("\\coloncolonsim","\\Colonsim");Se("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Se("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Se("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Se("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Se("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Se("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Se("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Se("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Se("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Se("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Se("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Se("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Se("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Se("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Se("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Se("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Se("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Se("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Se("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Se("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Se("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Se("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Se("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Se("\\imath","\\html@mathml{\\@imath}{ı}");Se("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Se("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Se("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Se("⟦","\\llbracket");Se("⟧","\\rrbracket");Se("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Se("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Se("⦃","\\lBrace");Se("⦄","\\rBrace");Se("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Se("⦵","\\minuso");Se("\\darr","\\downarrow");Se("\\dArr","\\Downarrow");Se("\\Darr","\\Downarrow");Se("\\lang","\\langle");Se("\\rang","\\rangle");Se("\\uarr","\\uparrow");Se("\\uArr","\\Uparrow");Se("\\Uarr","\\Uparrow");Se("\\N","\\mathbb{N}");Se("\\R","\\mathbb{R}");Se("\\Z","\\mathbb{Z}");Se("\\alef","\\aleph");Se("\\alefsym","\\aleph");Se("\\Alpha","\\mathrm{A}");Se("\\Beta","\\mathrm{B}");Se("\\bull","\\bullet");Se("\\Chi","\\mathrm{X}");Se("\\clubs","\\clubsuit");Se("\\cnums","\\mathbb{C}");Se("\\Complex","\\mathbb{C}");Se("\\Dagger","\\ddagger");Se("\\diamonds","\\diamondsuit");Se("\\empty","\\emptyset");Se("\\Epsilon","\\mathrm{E}");Se("\\Eta","\\mathrm{H}");Se("\\exist","\\exists");Se("\\harr","\\leftrightarrow");Se("\\hArr","\\Leftrightarrow");Se("\\Harr","\\Leftrightarrow");Se("\\hearts","\\heartsuit");Se("\\image","\\Im");Se("\\infin","\\infty");Se("\\Iota","\\mathrm{I}");Se("\\isin","\\in");Se("\\Kappa","\\mathrm{K}");Se("\\larr","\\leftarrow");Se("\\lArr","\\Leftarrow");Se("\\Larr","\\Leftarrow");Se("\\lrarr","\\leftrightarrow");Se("\\lrArr","\\Leftrightarrow");Se("\\Lrarr","\\Leftrightarrow");Se("\\Mu","\\mathrm{M}");Se("\\natnums","\\mathbb{N}");Se("\\Nu","\\mathrm{N}");Se("\\Omicron","\\mathrm{O}");Se("\\plusmn","\\pm");Se("\\rarr","\\rightarrow");Se("\\rArr","\\Rightarrow");Se("\\Rarr","\\Rightarrow");Se("\\real","\\Re");Se("\\reals","\\mathbb{R}");Se("\\Reals","\\mathbb{R}");Se("\\Rho","\\mathrm{P}");Se("\\sdot","\\cdot");Se("\\sect","\\S");Se("\\spades","\\spadesuit");Se("\\sub","\\subset");Se("\\sube","\\subseteq");Se("\\supe","\\supseteq");Se("\\Tau","\\mathrm{T}");Se("\\thetasym","\\vartheta");Se("\\weierp","\\wp");Se("\\Zeta","\\mathrm{Z}");Se("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Se("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Se("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Se("\\bra","\\mathinner{\\langle{#1}|}");Se("\\ket","\\mathinner{|{#1}\\rangle}");Se("\\braket","\\mathinner{\\langle{#1}\\rangle}");Se("\\Bra","\\left\\langle#1\\right|");Se("\\Ket","\\left|#1\\right\\rangle");var WMe=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",a),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...s,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Se("\\bra@ket",WMe(!1));Se("\\bra@set",WMe(!0));Se("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Se("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Se("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Se("\\angln","{\\angl n}");Se("\\blue","\\textcolor{##6495ed}{#1}");Se("\\orange","\\textcolor{##ffa500}{#1}");Se("\\pink","\\textcolor{##ff00af}{#1}");Se("\\red","\\textcolor{##df0030}{#1}");Se("\\green","\\textcolor{##28ae7b}{#1}");Se("\\gray","\\textcolor{gray}{#1}");Se("\\purple","\\textcolor{##9d38bd}{#1}");Se("\\blueA","\\textcolor{##ccfaff}{#1}");Se("\\blueB","\\textcolor{##80f6ff}{#1}");Se("\\blueC","\\textcolor{##63d9ea}{#1}");Se("\\blueD","\\textcolor{##11accd}{#1}");Se("\\blueE","\\textcolor{##0c7f99}{#1}");Se("\\tealA","\\textcolor{##94fff5}{#1}");Se("\\tealB","\\textcolor{##26edd5}{#1}");Se("\\tealC","\\textcolor{##01d1c1}{#1}");Se("\\tealD","\\textcolor{##01a995}{#1}");Se("\\tealE","\\textcolor{##208170}{#1}");Se("\\greenA","\\textcolor{##b6ffb0}{#1}");Se("\\greenB","\\textcolor{##8af281}{#1}");Se("\\greenC","\\textcolor{##74cf70}{#1}");Se("\\greenD","\\textcolor{##1fab54}{#1}");Se("\\greenE","\\textcolor{##0d923f}{#1}");Se("\\goldA","\\textcolor{##ffd0a9}{#1}");Se("\\goldB","\\textcolor{##ffbb71}{#1}");Se("\\goldC","\\textcolor{##ff9c39}{#1}");Se("\\goldD","\\textcolor{##e07d10}{#1}");Se("\\goldE","\\textcolor{##a75a05}{#1}");Se("\\redA","\\textcolor{##fca9a9}{#1}");Se("\\redB","\\textcolor{##ff8482}{#1}");Se("\\redC","\\textcolor{##f9685d}{#1}");Se("\\redD","\\textcolor{##e84d39}{#1}");Se("\\redE","\\textcolor{##bc2612}{#1}");Se("\\maroonA","\\textcolor{##ffbde0}{#1}");Se("\\maroonB","\\textcolor{##ff92c6}{#1}");Se("\\maroonC","\\textcolor{##ed5fa6}{#1}");Se("\\maroonD","\\textcolor{##ca337c}{#1}");Se("\\maroonE","\\textcolor{##9e034e}{#1}");Se("\\purpleA","\\textcolor{##ddd7ff}{#1}");Se("\\purpleB","\\textcolor{##c6b9fc}{#1}");Se("\\purpleC","\\textcolor{##aa87ff}{#1}");Se("\\purpleD","\\textcolor{##7854ab}{#1}");Se("\\purpleE","\\textcolor{##543b78}{#1}");Se("\\mintA","\\textcolor{##f5f9e8}{#1}");Se("\\mintB","\\textcolor{##edf2df}{#1}");Se("\\mintC","\\textcolor{##e0e5cc}{#1}");Se("\\grayA","\\textcolor{##f6f7f7}{#1}");Se("\\grayB","\\textcolor{##f0f1f2}{#1}");Se("\\grayC","\\textcolor{##e3e5e6}{#1}");Se("\\grayD","\\textcolor{##d6d8da}{#1}");Se("\\grayE","\\textcolor{##babec2}{#1}");Se("\\grayF","\\textcolor{##888d93}{#1}");Se("\\grayG","\\textcolor{##626569}{#1}");Se("\\grayH","\\textcolor{##3b3e40}{#1}");Se("\\grayI","\\textcolor{##21242c}{#1}");Se("\\kaBlue","\\textcolor{##314453}{#1}");Se("\\kaGreen","\\textcolor{##71B307}{#1}");var qMe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class fzt{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new uzt(hzt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Wde(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new $c("EOF",n.loc)),this.pushTokens(i),new $c("",ec.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,a=0,o=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Gt("Extra }",s)}else if(s.text==="EOF")throw new Gt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",s);if(e&&n)if((a===0||a===1&&e[o]==="{")&&s.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(a!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Gt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Gt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Gt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Gt("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Gt("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new $c(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var s=0;if(i.includes("#"))for(var a=i.replace(/##/g,"");a.includes("#"+(s+1));)++s;for(var o=new Wde(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||zp.hasOwnProperty(e)||ls.math.hasOwnProperty(e)||ls.text.hasOwnProperty(e)||qMe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:zp.hasOwnProperty(e)&&!zp[e].primitive}}var Yde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,v8=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),KB={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},jde={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let UMe=class YMe{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new fzt(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Gt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new $c("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(YMe.endOfExpression.has(i.text)||r&&i.text===r||e&&zp[i.text]&&zp[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(Z8e(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:ec.range(e),text:r};else return null;if(this.consume(),s)for(var h=0;h1?i.setNode(s,r):i.setNode(s)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=_m,this._children[e]={},this._children[_m][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Et(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),Et(Ac(this._in[e]),r),delete this._in[e],delete this._preds[e],Et(Ac(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Us(r))r=_m;else{r+="";for(var n=r;!Us(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==_m)return r}}children(e){if(Us(e)&&(e=_m),this._isCompound){var r=this._children[e];if(r)return Ac(r)}else{if(e===_m)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Ac(r)}successors(e){var r=this._sucs[e];if(r)return Ac(r)}neighbors(e){var r=this.predecessors(e);if(r)return PV(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Et(this._nodes,function(a,o){e(o)&&r.setNode(o,a)}),Et(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&Et(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(e){return ES(e)||(e=U2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Uf(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return RE(e,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var e,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(e=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(e=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),e=""+e,r=""+r,Us(n)||(n=""+n);var o=ok(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!Us(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(e,r,n);var l=yzt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,Kde(this._preds[r],e),Kde(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?ZB(this._isDirected,arguments[0]):ok(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?ZB(this._isDirected,arguments[0]):ok(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?ZB(this._isDirected,arguments[0]):ok(this._isDirected,e,r,n),s=this._edgeObjs[i];return s&&(e=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Zde(this._preds[r],e),Zde(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Uf(n);return r?Nf(i,function(s){return s.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Uf(n);return r?Nf(i,function(s){return s.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}qo.prototype._nodeCount=0;qo.prototype._edgeCount=0;function Kde(t,e){t[e]?t[e]++:t[e]=1}function Zde(t,e){--t[e]||delete t[e]}function ok(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}return i+Xde+s+Xde+(Us(n)?mzt:n)}function yzt(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ZB(t,e){return ok(t,e.v,e.w,e.name)}function n0(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:vzt(t),edges:bzt(t)};return Us(t.graph())||(e.value=JR(t.graph())),e}function vzt(t){return oa(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Us(r)||(i.value=r),Us(n)||(i.parent=n),i})}function bzt(t){return oa(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Us(e.name)||(n.name=e.name),Us(r)||(n.value=r),n})}var hn=new Map,Vp=new Map,eRe=new Map,tRe=w(()=>{Vp.clear(),eRe.clear(),hn.clear()},"clear"),My=w((t,e)=>{const r=Vp.get(e)||[];return de.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),xzt=w((t,e)=>{const r=Vp.get(e)||[];return de.info("Descendants of ",e," is ",r),de.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||My(t.v,e)||My(t.w,e)||r.includes(t.w):(de.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),UW=w((t,e,r,n)=>{de.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),de.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(s=>{if(e.children(s).length>0)UW(s,e,r,n);else{const a=e.node(s);de.info("cp ",s," to ",n," with parent ",t),r.setNode(s,a),n!==e.parent(s)&&(de.warn("Setting parent",s,e.parent(s)),r.setParent(s,e.parent(s))),t!==n&&s!==t?(de.debug("Setting parent",s,t),r.setParent(s,t)):(de.info("In copy ",t,"root",n,"data",e.node(t),n),de.debug("Not Setting parent for node=",s,"cluster!==rootId",t!==n,"node!==clusterId",s!==t));const o=e.edges(s);de.debug("Copying Edges",o),o.forEach(l=>{de.info("Edge",l);const u=e.edge(l.v,l.w,l.name);de.info("Edge data",u,n);try{if(xzt(l,n)){const h=Vp.get(n)||[],d=h.includes(l.v)||My(l.v,n)||l.v===n,f=h.includes(l.w)||My(l.w,n)||l.w===n;if(d&&f)de.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),de.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;de.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else de.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){de.error(h)}})}de.debug("Removing node",s),e.removeNode(s)})},"copy"),rRe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)eRe.set(i,t),n=[...n,...rRe(i,e)];return n},"extractDescendants"),wzt=w((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),s=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),a=i.map(l=>({v:l.v,w:l.w}));return s.filter(l=>a.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),b5=w((t,e,r)=>{const n=e.children(t);if(de.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const s of n){const a=b5(s,e,r),o=wzt(e,r,a);if(a)if(o.length>0)i=a;else return a}return i},"findNonClusterChild"),Qde=w(t=>!hn.has(t)||!hn.get(t).externalConnections?t:hn.has(t)?hn.get(t).id:t,"getAnchorId"),Tzt=w((t,e)=>{var r;if(!t||e>10){de.debug("Opting out, no graph ");return}else de.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(de.warn("Cluster identified",n," Replacement id in edges: ",b5(n,t,n)),Vp.set(n,rRe(n,t)),hn.set(n,{id:b5(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),s=t.edges();i.length>0?(de.debug("Cluster identified",n,Vp),s.forEach(a=>{const o=My(a.v,n),l=My(a.w,n);o^l&&(de.warn("Edge: ",a," leaves cluster ",n),de.warn("Descendants of XXX ",n,": ",Vp.get(n)),hn.get(n).externalConnections=!0)})):de.debug("Not a cluster ",n,Vp)});for(let n of hn.keys()){const i=hn.get(n).id,s=t.parent(i);s!==n&&hn.has(s)&&!hn.get(s).externalConnections&&(hn.get(n).id=s);const a=t.edges().some(o=>o.v===n);if(i&&((r=hn.get(n))!=null&&r.externalConnections)&&a&&sRe(t,i,n)){const o=kzt(t,n,t.parent(i));o&&(hn.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let s=n.v,a=n.w;if(de.warn("Fix XXX",hn,"ids:",n.v,n.w,"Translating: ",hn.get(n.v)," --- ",hn.get(n.w)),hn.get(n.v)||hn.get(n.w)){if(de.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),s=Qde(n.v),a=Qde(n.w),t.removeEdge(n.v,n.w,n.name),s!==n.v){const o=t.parent(s);hn.get(o).externalConnections=!0,i.fromCluster=n.v}if(a!==n.w){const o=t.parent(a);hn.get(o).externalConnections=!0,i.toCluster=n.w}de.warn("Fix Replacing with XXX",s,a,n.name),t.setEdge(s,a,i,n.name)}}),de.warn("Adjusted Graph",n0(t)),nRe(t,0),de.trace(hn)},"adjustClustersAndEdges"),nRe=w((t,e)=>{var i,s,a,o;if(de.warn("extractor - ",e,n0(t),t.children("D")),e>10){de.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){de.debug("Done, no node has children",t.nodes());return}de.debug("Nodes = ",r,e);for(const l of r)if(de.debug("Extracting node",l,hn,hn.has(l)&&!hn.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!hn.has(l))de.debug("Not a cluster",l,e);else if((s=(i=hn.get(l))==null?void 0:i.clusterData)!=null&&s.explicitDir&&t.children(l)&&t.children(l).length>0){de.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=hn.get(l).clusterData.dir,h=new qo({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});UW(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:hn.get(l).clusterData,label:hn.get(l).label,graph:h}),de.warn("Subgraph for cluster with explicit dir created:",l,n0(h))}else if(!hn.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){de.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(a=hn.get(l))==null?void 0:a.clusterData)!=null&&o.dir&&(h=hn.get(l).clusterData.dir,de.warn("Fixing dir",hn.get(l).clusterData.dir,h));const d=new qo({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});UW(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:hn.get(l).clusterData,label:hn.get(l).label,graph:d}),de.debug("Old graph after copy",n0(t))}else de.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!hn.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),de.debug(hn);r=t.nodes(),de.warn("New list of nodes",r);for(const l of r){const u=t.node(l);de.warn(" Now next level",l,u),u!=null&&u.clusterNode&&nRe(u.graph,e+1)}},"extractor"),iRe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),s=iRe(t,i);r=[...r,...s]}),r},"sorter"),Czt=w(t=>iRe(t,t.children()),"sortNodesByHierarchy"),sRe=w((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=hn.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),kzt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||My(i,r))continue;const s=b5(i,t,e);if(s&&!sRe(t,s,e))return s}return null},"findSafeAnchorNode");class Szt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return Jde(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&Jde(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,Ezt)),n=n._prev;return"["+e.join(", ")+"]"}}function Jde(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Ezt(t,e){if(t!=="_next"&&t!=="_prev")return e}var Azt=U2(1);function Mzt(t,e){if(t.nodeCount()<=1)return[];var r=_zt(t,e||Azt),n=Rzt(r.graph,r.buckets,r.zeroIdx);return X5(oa(n,function(i){return t.outEdges(i.v,i.w)}))}function Rzt(t,e,r){for(var n=[],i=e[e.length-1],s=e[0],a;t.nodeCount();){for(;a=s.dequeue();)QB(t,e,r,a);for(;a=i.dequeue();)QB(t,e,r,a);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(a=e[o].dequeue(),a){n=n.concat(QB(t,e,r,a,!0));break}}}return n}function QB(t,e,r,n,i){var s=i?[]:void 0;return Et(t.inEdges(n.v),function(a){var o=t.edge(a),l=t.node(a.v);i&&s.push({v:a.v,w:a.w}),l.out-=o,YW(e,r,l)}),Et(t.outEdges(n.v),function(a){var o=t.edge(a),l=a.w,u=t.node(l);u.in-=o,YW(e,r,u)}),t.removeNode(n.v),s}function _zt(t,e){var r=new qo,n=0,i=0;Et(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),Et(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var s=PT(i+n+3).map(function(){return new Szt}),a=n+1;return Et(r.nodes(),function(o){YW(s,a,r.node(o))}),{graph:r,buckets:s,zeroIdx:a}}function YW(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function Lzt(t){var e=t.graph().acyclicer==="greedy"?Mzt(t,r(t)):Izt(t);Et(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,cN("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function Izt(t){var e=[],r={},n={};function i(s){Object.prototype.hasOwnProperty.call(n,s)||(n[s]=!0,r[s]=!0,Et(t.outEdges(s),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?e.push(a):i(a.w)}),delete r[s])}return Et(t.nodes(),i),e}function Nzt(t){Et(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function v3(t,e,r,n){var i;do i=cN(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Dzt(t){var e=new qo().setGraph(t.graph());return Et(t.nodes(),function(r){e.setNode(r,t.node(r))}),Et(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function aRe(t){var e=new qo({multigraph:t.isMultigraph()}).setGraph(t.graph());return Et(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Et(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function efe(t,e){var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=o*i/s,u=o):(i<0&&(a=-a),l=a,u=a*s/i),{x:r+l,y:n+u}}function HD(t){var e=oa(PT(oRe(t)+1),function(){return[]});return Et(t.nodes(),function(r){var n=t.node(r),i=n.rank;Us(i)||(e[i][n.order]=r)}),e}function Ozt(t){var e=LS(oa(t.nodes(),function(r){return t.node(r).rank}));Et(t.nodes(),function(r){var n=t.node(r);Y2(n,"rank")&&(n.rank-=e)})}function Pzt(t){var e=LS(oa(t.nodes(),function(s){return t.node(s).rank})),r=[];Et(t.nodes(),function(s){var a=t.node(s).rank-e;r[a]||(r[a]=[]),r[a].push(s)});var n=0,i=t.graph().nodeRankFactor;Et(r,function(s,a){Us(s)&&a%i!==0?--n:n&&Et(s,function(o){t.node(o).rank+=n})})}function tfe(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),v3(t,"border",i,e)}function oRe(t){return ag(oa(t.nodes(),function(e){var r=t.node(e).rank;if(!Us(r))return r}))}function $zt(t,e){var r={lhs:[],rhs:[]};return Et(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Bzt(t,e){return e()}function Fzt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Et(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,a=i.maxRank+1;sa.lim&&(o=a,l=!0);var u=Nf(e.edges(),function(h){return l===ife(t,t.node(h.v),o)&&l!==ife(t,t.node(h.w),o)});return uX(u,function(h){return $6(e,h)})}function mRe(t,e,r,n){var i=r.v,s=r.w;t.removeEdge(i,s),t.setEdge(n.v,n.w,{}),pJ(t),fJ(t,e),eVt(t,e)}function eVt(t,e){var r=lX(t.nodes(),function(i){return!e.node(i).parent}),n=Qzt(t,r);n=n.slice(1),Et(n,function(i){var s=t.node(i).parent,a=e.edge(i,s),o=!1;a||(a=e.edge(s,i),o=!0),e.node(i).rank=e.node(s).rank+(o?a.minlen:-a.minlen)})}function tVt(t,e,r){return t.hasEdge(e,r)}function ife(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function rVt(t){switch(t.graph().ranker){case"network-simplex":sfe(t);break;case"tight-tree":iVt(t);break;case"longest-path":nVt(t);break;default:sfe(t)}}var nVt=dJ;function iVt(t){dJ(t),cRe(t)}function sfe(t){rv(t)}function sVt(t){var e=v3(t,"root",{},"_root"),r=aVt(t),n=ag(Uf(r))-1,i=2*n+1;t.graph().nestingRoot=e,Et(t.edges(),function(a){t.edge(a).minlen*=i});var s=oVt(t)+1;Et(t.children(),function(a){yRe(t,e,i,s,n,r,a)}),t.graph().nodeRankFactor=i}function yRe(t,e,r,n,i,s,a){var o=t.children(a);if(!o.length){a!==e&&t.setEdge(e,a,{weight:0,minlen:r});return}var l=tfe(t,"_bt"),u=tfe(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(u,a),h.borderBottom=u,Et(o,function(d){yRe(t,e,r,n,i,s,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-s[a]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,l,{weight:0,minlen:i+s[a]})}function aVt(t){var e={};function r(n,i){var s=t.children(n);s&&s.length&&Et(s,function(a){r(a,i+1)}),e[n]=i}return Et(t.children(),function(n){r(n,1)}),e}function oVt(t){return RE(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function lVt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Et(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function cVt(t,e,r){var n={},i;Et(r,function(s){for(var a=t.parent(s),o,l;a;){if(o=t.parent(a),o?(l=n[o],n[o]=a):(l=i,i=a),l&&l!==a){e.setEdge(l,a);return}a=o}})}function uVt(t,e,r){var n=hVt(t),i=new qo({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(s){return t.node(s)});return Et(t.nodes(),function(s){var a=t.node(s),o=t.parent(s);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(s),i.setParent(s,o||n),Et(t[r](s),function(l){var u=l.v===s?l.w:l.v,h=i.edge(u,s),d=Us(h)?0:h.weight;i.setEdge(u,s,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(s,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function hVt(t){for(var e;t.hasNode(e=cN("_root")););return e}function dVt(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function pVt(t){var e={},r=Nf(t.nodes(),function(o){return!t.children(o).length}),n=ag(oa(r,function(o){return t.node(o).rank})),i=oa(PT(n+1),function(){return[]});function s(o){if(!Y2(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),Et(t.successors(o),s)}}var a=zg(r,function(o){return t.node(o).rank});return Et(a,s),i}function gVt(t,e){return oa(e,function(r){var n=t.inEdges(r);if(n.length){var i=RE(n,function(s,a){var o=t.edge(a),l=t.node(a.v);return{sum:s.sum+o.weight*l.order,weight:s.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function mVt(t,e){var r={};Et(t,function(i,s){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Us(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),Et(e.edges(),function(i){var s=r[i.v],a=r[i.w];!Us(s)&&!Us(a)&&(a.indegree++,s.out.push(r[i.w]))});var n=Nf(r,function(i){return!i.indegree});return yVt(n)}function yVt(t){var e=[];function r(s){return function(a){a.merged||(Us(a.barycenter)||Us(s.barycenter)||a.barycenter>=s.barycenter)&&vVt(s,a)}}function n(s){return function(a){a.in.push(s),--a.indegree===0&&t.push(a)}}for(;t.length;){var i=t.pop();e.push(i),Et(i.in.reverse(),r(i)),Et(i.out,n(i))}return oa(Nf(e,function(s){return!s.merged}),function(s){return OT(s,["vs","i","barycenter","weight"])})}function vVt(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function bVt(t,e){var r=$zt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=zg(r.rhs,function(h){return-h.i}),s=[],a=0,o=0,l=0;n.sort(xVt(!!e)),l=afe(s,i,l),Et(n,function(h){l+=h.vs.length,s.push(h.vs),a+=h.barycenter*h.weight,o+=h.weight,l=afe(s,i,l)});var u={vs:X5(s)};return o&&(u.barycenter=a/o,u.weight=o),u}function afe(t,e,r){for(var n;e.length&&(n=t9(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function xVt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function vRe(t,e,r,n){var i=t.children(e),s=t.node(e),a=s?s.borderLeft:void 0,o=s?s.borderRight:void 0,l={};a&&(i=Nf(i,function(g){return g!==a&&g!==o}));var u=gVt(t,i);Et(u,function(g){if(t.children(g.v).length){var m=vRe(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&TVt(g,m)}});var h=mVt(u,r);wVt(h,l);var d=bVt(h,n);if(a&&(d.vs=X5([a,d.vs,o]),t.predecessors(a).length)){var f=t.node(t.predecessors(a)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function wVt(t,e){Et(t,function(r){r.vs=X5(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function TVt(t,e){Us(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function CVt(t){var e=oRe(t),r=ofe(t,PT(1,e+1),"inEdges"),n=ofe(t,PT(e-1,-1,-1),"outEdges"),i=pVt(t);lfe(t,i);for(var s=Number.POSITIVE_INFINITY,a,o=0,l=0;l<4;++o,++l){kVt(o%2?r:n,o%4>=2),i=HD(t);var u=dVt(t,i);ua||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)s.push(l);return{path:i.concat(s.reverse()),lca:u}}function AVt(t){var e={},r=0;function n(i){var s=r;Et(t.children(i),n),e[i]={low:s,lim:r++}}return Et(t.children(),n),e}function MVt(t,e){var r={};function n(i,s){var a=0,o=0,l=i.length,u=t9(s);return Et(s,function(h,d){var f=_Vt(t,h),p=f?t.node(f).order:l;(f||h===u)&&(Et(s.slice(o,d+1),function(g){Et(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&bRe(r,f,h)})})}function i(s,a){var o=-1,l,u=0;return Et(a,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(a,u,d,o,l),u=d,o=l)}n(a,u,a.length,l,s.length)}),a}return RE(e,i),r}function _Vt(t,e){if(t.node(e).dummy)return lX(t.predecessors(e),function(r){return t.node(r).dummy})}function bRe(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function LVt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function IVt(t,e,r,n){var i={},s={},a={};return Et(e,function(o){Et(o,function(l,u){i[l]=l,s[l]=l,a[l]=u})}),Et(e,function(o){var l=-1;Et(o,function(u){var h=n(u);if(h.length){h=zg(h,function(m){return a[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];s[u]===u&&l{var n=r(" buildLayoutGraph",()=>JVt(t));r(" runLayout",()=>GVt(n,r)),r(" updateInputGraph",()=>WVt(t,n))})}function GVt(t,e){e(" makeSpaceForEdgeLabels",()=>eHt(t)),e(" removeSelfEdges",()=>cHt(t)),e(" acyclic",()=>Lzt(t)),e(" nestingGraph.run",()=>sVt(t)),e(" rank",()=>rVt(aRe(t))),e(" injectEdgeLabelProxies",()=>tHt(t)),e(" removeEmptyRanks",()=>Pzt(t)),e(" nestingGraph.cleanup",()=>lVt(t)),e(" normalizeRanks",()=>Ozt(t)),e(" assignRankMinMax",()=>rHt(t)),e(" removeEdgeLabelProxies",()=>nHt(t)),e(" normalize.run",()=>Wzt(t)),e(" parentDummyChains",()=>SVt(t)),e(" addBorderSegments",()=>Fzt(t)),e(" order",()=>CVt(t)),e(" insertSelfEdges",()=>uHt(t)),e(" adjustCoordinateSystem",()=>zzt(t)),e(" position",()=>VVt(t)),e(" positionSelfEdges",()=>hHt(t)),e(" removeBorderNodes",()=>lHt(t)),e(" normalize.undo",()=>Uzt(t)),e(" fixupEdgeLabelCoords",()=>aHt(t)),e(" undoCoordinateSystem",()=>Vzt(t)),e(" translateGraph",()=>iHt(t)),e(" assignNodeIntersects",()=>sHt(t)),e(" reversePoints",()=>oHt(t)),e(" acyclic.undo",()=>Nzt(t))}function WVt(t,e){Et(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),Et(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var qVt=["nodesep","edgesep","ranksep","marginx","marginy"],UVt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},YVt=["acyclicer","ranker","rankdir","align"],jVt=["width","height"],XVt={width:0,height:0},KVt=["minlen","weight","width","height","labeloffset"],ZVt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},QVt=["labelpos"];function JVt(t){var e=new qo({multigraph:!0,compound:!0}),r=rF(t.graph());return e.setGraph(Pi({},UVt,tF(r,qVt),OT(r,YVt))),Et(t.nodes(),function(n){var i=rF(t.node(n));e.setNode(n,jve(tF(i,jVt),XVt)),e.setParent(n,t.parent(n))}),Et(t.edges(),function(n){var i=rF(t.edge(n));e.setEdge(n,Pi({},ZVt,tF(i,KVt),OT(i,QVt)))}),e}function eHt(t){var e=t.graph();e.ranksep/=2,Et(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function tHt(t){Et(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),s={rank:(i.rank-n.rank)/2+n.rank,e};v3(t,"edge-proxy",s,"_ep")}})}function rHt(t){var e=0;Et(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=ag(e,n.maxRank))}),t.graph().maxRank=e}function nHt(t){Et(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function iHt(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,s=t.graph(),a=s.marginx||0,o=s.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}Et(t.nodes(),function(u){l(t.node(u))}),Et(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=a,n-=o,Et(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),Et(t.edges(),function(u){var h=t.edge(u);Et(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),s.width=r-e+a,s.height=i-n+o}function sHt(t){Et(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),s,a;r.points?(s=r.points[0],a=r.points[r.points.length-1]):(r.points=[],s=i,a=n),r.points.unshift(efe(n,s)),r.points.push(efe(i,a))})}function aHt(t){Et(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function oHt(t){Et(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function lHt(t){Et(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),s=t.node(t9(r.borderLeft)),a=t.node(t9(r.borderRight));r.width=Math.abs(a.x-s.x),r.height=Math.abs(i.y-n.y),r.x=s.x+r.width/2,r.y=n.y+r.height/2}}),Et(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function cHt(t){Et(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function uHt(t){var e=HD(t);Et(e,function(r){var n=0;Et(r,function(i,s){var a=t.node(i);a.order=s+n,Et(a.selfEdges,function(o){v3(t,"selfedge",{width:o.label.width,height:o.label.height,rank:a.rank,order:s+ ++n,e:o.e,label:o.label},"_se")}),delete a.selfEdges})})}function hHt(t){Et(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,s=n.y,a=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*a/3,y:s-o},{x:i+5*a/6,y:s-o},{x:i+a,y:s},{x:i+5*a/6,y:s+o},{x:i+2*a/3,y:s+o}],r.label.x=r.x,r.label.y=r.y}})}function tF(t,e){return lN(OT(t,e),Number)}function rF(t){var e={};return Et(t,function(r,n){e[n.toLowerCase()]=r}),e}var cfe=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),ufe=w((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),dHt=w(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),fHt=w((t,e,r,n,i)=>{const s=[],a=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&a.add(h),d!==n&&a.add(d)}),a.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&s.push(d)}),s.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&s.push(d)})}),s.length===0)return ufe(i);const o=s.reduce((h,d)=>({x:h.x+d.x/s.length,y:h.y+d.y/s.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":ufe(i)},"getSelfLoopSide"),pHt=w((t,e="top",r=0,n=0)=>{const i=t.x,s=t.y-r,a=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=cfe(Math.max(n,t.width*.35),36,l),h=cfe(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=s+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+a;return[{x:d,y:s-u/2},{x:d+h,y:s-u/2},{x:d+h,y:s+u/2},{x:d,y:s+u/2}]}case"left":{const d=i-a;return[{x:d,y:s-u/2},{x:d-h,y:s-u/2},{x:d-h,y:s+u/2},{x:d,y:s+u/2}]}case"top":default:{const d=s-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),gHt=w((t,e,r="top",n=0,i={})=>{const a=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:a,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:a,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),wRe=w((t,e=0,{mergeSelfLoops:r=!0}={})=>{var a;const n=new Map,i=[],s=(a=t.graph())==null?void 0:a.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(x=>i.push(x));return}o.sort((x,b)=>x.edge.selfLoop.order-b.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(x=>i.push(x));return}const p={width:u.edge.width,height:u.edge.height},g=fHt(t,f,o,d.start,s),m=pHt(f,g,e,p.width??0),y=gHt(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),TRe=w(async(t,e,r,n,i,s)=>{de.warn("Graph in recursive render:XAX",n0(e),i);const a=e.graph().rankdir;de.trace("Dir in recursive render - dir:",a);const o=t.insert("g").attr("class","root");e.nodes()?de.info("Recursive render XXX",e.nodes()):de.info("No nodes found for",e),e.edges().length>0&&de.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=dHt(r);await Promise.all(e.nodes().map(async function(x){const b=e.node(x);if(i!==void 0){const T=JSON.parse(JSON.stringify(i.clusterData));de.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,XW="[̀-ͯ]",kzt=new RegExp(XW+"+$"),Szt="("+jMe+"+)|"+(Czt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(XW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(XW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Tzt)+("|"+wzt+")");let Kde=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(Szt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new zc("EOF",new rc(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Gt("Unexpected character: '"+e[r]+"'",new zc(e[r],new rc(this,r,r+1)));var i=n[6]||n[3]||(n[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 zc(i,new rc(this,r,this.tokenRegex.lastIndex))}};class Ezt{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Gt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var Azt=$Me;Se("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Zde={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};Se("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Gt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Zde[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Zde[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Gt("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Gt("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new Gt("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Gt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};Se("\\newcommand",t=>dJ(t,!1,!0,!1));Se("\\renewcommand",t=>dJ(t,!0,!1,!1));Se("\\providecommand",t=>dJ(t,!0,!0,!0));Se("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Se("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Se("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Wp[r],ls.math[r],ls.text[r]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Se("∉","\\notin");Se("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Se("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Se("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Se("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Se("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Se("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Se("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Se("⟂","\\perp");Se("‼","\\mathclose{!\\mkern-0.8mu!}");Se("∌","\\notni");Se("⌜","\\ulcorner");Se("⌝","\\urcorner");Se("⌞","\\llcorner");Se("⌟","\\lrcorner");Se("©","\\copyright");Se("®","\\textregistered");Se("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Se("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Se("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Se("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Se("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Se("⋮","\\vdots");Se("\\varGamma","\\mathit{\\Gamma}");Se("\\varDelta","\\mathit{\\Delta}");Se("\\varTheta","\\mathit{\\Theta}");Se("\\varLambda","\\mathit{\\Lambda}");Se("\\varXi","\\mathit{\\Xi}");Se("\\varPi","\\mathit{\\Pi}");Se("\\varSigma","\\mathit{\\Sigma}");Se("\\varUpsilon","\\mathit{\\Upsilon}");Se("\\varPhi","\\mathit{\\Phi}");Se("\\varPsi","\\mathit{\\Psi}");Se("\\varOmega","\\mathit{\\Omega}");Se("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Se("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Se("\\boxed","\\fbox{$\\displaystyle{#1}$}");Se("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Se("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Se("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Se("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Se("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Qde={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Mzt=new Set(["bin","rel"]);Se("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Qde?e=Qde[r]:(r.slice(0,4)==="\\not"||r in ls.math&&Mzt.has(ls.math[r].group))&&(e="\\dotsb"),e});var fJ={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Se("\\dotso",function(t){var e=t.future().text;return e in fJ?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in fJ&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in fJ?"\\@cdots\\,":"\\@cdots"});Se("\\dotsb","\\cdots");Se("\\dotsm","\\cdots");Se("\\dotsi","\\!\\cdots");Se("\\dotsx","\\ldots\\,");Se("\\DOTSI","\\relax");Se("\\DOTSB","\\relax");Se("\\DOTSX","\\relax");Se("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Se("\\,","\\tmspace+{3mu}{.1667em}");Se("\\thinspace","\\,");Se("\\>","\\mskip{4mu}");Se("\\:","\\tmspace+{4mu}{.2222em}");Se("\\medspace","\\:");Se("\\;","\\tmspace+{5mu}{.2777em}");Se("\\thickspace","\\;");Se("\\!","\\tmspace-{3mu}{.1667em}");Se("\\negthinspace","\\!");Se("\\negmedspace","\\tmspace-{4mu}{.2222em}");Se("\\negthickspace","\\tmspace-{5mu}{.277em}");Se("\\enspace","\\kern.5em ");Se("\\enskip","\\hskip.5em\\relax");Se("\\quad","\\hskip1em\\relax");Se("\\qquad","\\hskip2em\\relax");Se("\\tag","\\@ifstar\\tag@literal\\tag@paren");Se("\\tag@paren","\\tag@literal{({#1})}");Se("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Gt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Se("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Se("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Se("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Se("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Se("\\newline","\\\\\\relax");Se("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var XMe=Yt(yd["Main-Regular"][84][1]-.7*yd["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+XMe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+XMe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Se("\\hspace","\\@ifstar\\@hspacer\\@hspace");Se("\\@hspace","\\hskip #1\\relax");Se("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Se("\\ordinarycolon",":");Se("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Se("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Se("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Se("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Se("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Se("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Se("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Se("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Se("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Se("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Se("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Se("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Se("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Se("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Se("∷","\\dblcolon");Se("∹","\\eqcolon");Se("≔","\\coloneqq");Se("≕","\\eqqcolon");Se("⩴","\\Coloneqq");Se("\\ratio","\\vcentcolon");Se("\\coloncolon","\\dblcolon");Se("\\colonequals","\\coloneqq");Se("\\coloncolonequals","\\Coloneqq");Se("\\equalscolon","\\eqqcolon");Se("\\equalscoloncolon","\\Eqqcolon");Se("\\colonminus","\\coloneq");Se("\\coloncolonminus","\\Coloneq");Se("\\minuscolon","\\eqcolon");Se("\\minuscoloncolon","\\Eqcolon");Se("\\coloncolonapprox","\\Colonapprox");Se("\\coloncolonsim","\\Colonsim");Se("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Se("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Se("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Se("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Se("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Se("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Se("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Se("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Se("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Se("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Se("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Se("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Se("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Se("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Se("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Se("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Se("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Se("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Se("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Se("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Se("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Se("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Se("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Se("\\imath","\\html@mathml{\\@imath}{ı}");Se("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Se("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Se("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Se("⟦","\\llbracket");Se("⟧","\\rrbracket");Se("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Se("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Se("⦃","\\lBrace");Se("⦄","\\rBrace");Se("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Se("⦵","\\minuso");Se("\\darr","\\downarrow");Se("\\dArr","\\Downarrow");Se("\\Darr","\\Downarrow");Se("\\lang","\\langle");Se("\\rang","\\rangle");Se("\\uarr","\\uparrow");Se("\\uArr","\\Uparrow");Se("\\Uarr","\\Uparrow");Se("\\N","\\mathbb{N}");Se("\\R","\\mathbb{R}");Se("\\Z","\\mathbb{Z}");Se("\\alef","\\aleph");Se("\\alefsym","\\aleph");Se("\\Alpha","\\mathrm{A}");Se("\\Beta","\\mathrm{B}");Se("\\bull","\\bullet");Se("\\Chi","\\mathrm{X}");Se("\\clubs","\\clubsuit");Se("\\cnums","\\mathbb{C}");Se("\\Complex","\\mathbb{C}");Se("\\Dagger","\\ddagger");Se("\\diamonds","\\diamondsuit");Se("\\empty","\\emptyset");Se("\\Epsilon","\\mathrm{E}");Se("\\Eta","\\mathrm{H}");Se("\\exist","\\exists");Se("\\harr","\\leftrightarrow");Se("\\hArr","\\Leftrightarrow");Se("\\Harr","\\Leftrightarrow");Se("\\hearts","\\heartsuit");Se("\\image","\\Im");Se("\\infin","\\infty");Se("\\Iota","\\mathrm{I}");Se("\\isin","\\in");Se("\\Kappa","\\mathrm{K}");Se("\\larr","\\leftarrow");Se("\\lArr","\\Leftarrow");Se("\\Larr","\\Leftarrow");Se("\\lrarr","\\leftrightarrow");Se("\\lrArr","\\Leftrightarrow");Se("\\Lrarr","\\Leftrightarrow");Se("\\Mu","\\mathrm{M}");Se("\\natnums","\\mathbb{N}");Se("\\Nu","\\mathrm{N}");Se("\\Omicron","\\mathrm{O}");Se("\\plusmn","\\pm");Se("\\rarr","\\rightarrow");Se("\\rArr","\\Rightarrow");Se("\\Rarr","\\Rightarrow");Se("\\real","\\Re");Se("\\reals","\\mathbb{R}");Se("\\Reals","\\mathbb{R}");Se("\\Rho","\\mathrm{P}");Se("\\sdot","\\cdot");Se("\\sect","\\S");Se("\\spades","\\spadesuit");Se("\\sub","\\subset");Se("\\sube","\\subseteq");Se("\\supe","\\supseteq");Se("\\Tau","\\mathrm{T}");Se("\\thetasym","\\vartheta");Se("\\weierp","\\wp");Se("\\Zeta","\\mathrm{Z}");Se("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Se("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Se("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Se("\\bra","\\mathinner{\\langle{#1}|}");Se("\\ket","\\mathinner{|{#1}\\rangle}");Se("\\braket","\\mathinner{\\langle{#1}\\rangle}");Se("\\Bra","\\left\\langle#1\\right|");Se("\\Ket","\\left|#1\\right\\rangle");var KMe=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",a),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...s,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Se("\\bra@ket",KMe(!1));Se("\\bra@set",KMe(!0));Se("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Se("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Se("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Se("\\angln","{\\angl n}");Se("\\blue","\\textcolor{##6495ed}{#1}");Se("\\orange","\\textcolor{##ffa500}{#1}");Se("\\pink","\\textcolor{##ff00af}{#1}");Se("\\red","\\textcolor{##df0030}{#1}");Se("\\green","\\textcolor{##28ae7b}{#1}");Se("\\gray","\\textcolor{gray}{#1}");Se("\\purple","\\textcolor{##9d38bd}{#1}");Se("\\blueA","\\textcolor{##ccfaff}{#1}");Se("\\blueB","\\textcolor{##80f6ff}{#1}");Se("\\blueC","\\textcolor{##63d9ea}{#1}");Se("\\blueD","\\textcolor{##11accd}{#1}");Se("\\blueE","\\textcolor{##0c7f99}{#1}");Se("\\tealA","\\textcolor{##94fff5}{#1}");Se("\\tealB","\\textcolor{##26edd5}{#1}");Se("\\tealC","\\textcolor{##01d1c1}{#1}");Se("\\tealD","\\textcolor{##01a995}{#1}");Se("\\tealE","\\textcolor{##208170}{#1}");Se("\\greenA","\\textcolor{##b6ffb0}{#1}");Se("\\greenB","\\textcolor{##8af281}{#1}");Se("\\greenC","\\textcolor{##74cf70}{#1}");Se("\\greenD","\\textcolor{##1fab54}{#1}");Se("\\greenE","\\textcolor{##0d923f}{#1}");Se("\\goldA","\\textcolor{##ffd0a9}{#1}");Se("\\goldB","\\textcolor{##ffbb71}{#1}");Se("\\goldC","\\textcolor{##ff9c39}{#1}");Se("\\goldD","\\textcolor{##e07d10}{#1}");Se("\\goldE","\\textcolor{##a75a05}{#1}");Se("\\redA","\\textcolor{##fca9a9}{#1}");Se("\\redB","\\textcolor{##ff8482}{#1}");Se("\\redC","\\textcolor{##f9685d}{#1}");Se("\\redD","\\textcolor{##e84d39}{#1}");Se("\\redE","\\textcolor{##bc2612}{#1}");Se("\\maroonA","\\textcolor{##ffbde0}{#1}");Se("\\maroonB","\\textcolor{##ff92c6}{#1}");Se("\\maroonC","\\textcolor{##ed5fa6}{#1}");Se("\\maroonD","\\textcolor{##ca337c}{#1}");Se("\\maroonE","\\textcolor{##9e034e}{#1}");Se("\\purpleA","\\textcolor{##ddd7ff}{#1}");Se("\\purpleB","\\textcolor{##c6b9fc}{#1}");Se("\\purpleC","\\textcolor{##aa87ff}{#1}");Se("\\purpleD","\\textcolor{##7854ab}{#1}");Se("\\purpleE","\\textcolor{##543b78}{#1}");Se("\\mintA","\\textcolor{##f5f9e8}{#1}");Se("\\mintB","\\textcolor{##edf2df}{#1}");Se("\\mintC","\\textcolor{##e0e5cc}{#1}");Se("\\grayA","\\textcolor{##f6f7f7}{#1}");Se("\\grayB","\\textcolor{##f0f1f2}{#1}");Se("\\grayC","\\textcolor{##e3e5e6}{#1}");Se("\\grayD","\\textcolor{##d6d8da}{#1}");Se("\\grayE","\\textcolor{##babec2}{#1}");Se("\\grayF","\\textcolor{##888d93}{#1}");Se("\\grayG","\\textcolor{##626569}{#1}");Se("\\grayH","\\textcolor{##3b3e40}{#1}");Se("\\grayI","\\textcolor{##21242c}{#1}");Se("\\kaBlue","\\textcolor{##314453}{#1}");Se("\\kaGreen","\\textcolor{##71B307}{#1}");var ZMe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Rzt{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new Ezt(Azt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Kde(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new zc("EOF",n.loc)),this.pushTokens(i),new zc("",rc.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,a=0,o=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Gt("Extra }",s)}else if(s.text==="EOF")throw new Gt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",s);if(e&&n)if((a===0||a===1&&e[o]==="{")&&s.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(a!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Gt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Gt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Gt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Gt("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Gt("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new zc(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var s=0;if(i.includes("#"))for(var a=i.replace(/##/g,"");a.includes("#"+(s+1));)++s;for(var o=new Kde(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||Wp.hasOwnProperty(e)||ls.math.hasOwnProperty(e)||ls.text.hasOwnProperty(e)||ZMe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Wp.hasOwnProperty(e)&&!Wp[e].primitive}}var Jde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,T8=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),eF={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},efe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let QMe=class JMe{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Rzt(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Gt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new zc("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(JMe.endOfExpression.has(i.text)||r&&i.text===r||e&&Wp[i.text]&&Wp[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(nMe(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:rc.range(e),text:r};else return null;if(this.consume(),s)for(var h=0;h1?i.setNode(s,r):i.setNode(s)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Nm,this._children[e]={},this._children[Nm][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Et(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),Et(_c(this._in[e]),r),delete this._in[e],delete this._preds[e],Et(_c(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Us(r))r=Nm;else{r+="";for(var n=r;!Us(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Nm)return r}}children(e){if(Us(e)&&(e=Nm),this._isCompound){var r=this._children[e];if(r)return _c(r)}else{if(e===Nm)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return _c(r)}successors(e){var r=this._sucs[e];if(r)return _c(r)}neighbors(e){var r=this.predecessors(e);if(r)return zV(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Et(this._nodes,function(a,o){e(o)&&r.setNode(o,a)}),Et(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&Et(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(e){return RS(e)||(e=j2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Kf(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return IE(e,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var e,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(e=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(e=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),e=""+e,r=""+r,Us(n)||(n=""+n);var o=uk(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!Us(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(e,r,n);var l=Nzt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,rfe(this._preds[r],e),rfe(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?tF(this._isDirected,arguments[0]):uk(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?tF(this._isDirected,arguments[0]):uk(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?tF(this._isDirected,arguments[0]):uk(this._isDirected,e,r,n),s=this._edgeObjs[i];return s&&(e=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],nfe(this._preds[r],e),nfe(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Kf(n);return r?Pf(i,function(s){return s.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Kf(n);return r?Pf(i,function(s){return s.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}qo.prototype._nodeCount=0;qo.prototype._edgeCount=0;function rfe(t,e){t[e]?t[e]++:t[e]=1}function nfe(t,e){--t[e]||delete t[e]}function uk(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}return i+tfe+s+tfe+(Us(n)?Izt:n)}function Nzt(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function tF(t,e){return uk(t,e.v,e.w,e.name)}function o0(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Dzt(t),edges:Ozt(t)};return Us(t.graph())||(e.value=n9(t.graph())),e}function Dzt(t){return oa(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Us(r)||(i.value=r),Us(n)||(i.parent=n),i})}function Ozt(t){return oa(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Us(e.name)||(n.name=e.name),Us(r)||(n.value=r),n})}var hn=new Map,qp=new Map,aRe=new Map,oRe=w(()=>{qp.clear(),aRe.clear(),hn.clear()},"clear"),_y=w((t,e)=>{const r=qp.get(e)||[];return de.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),Pzt=w((t,e)=>{const r=qp.get(e)||[];return de.info("Descendants of ",e," is ",r),de.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||_y(t.v,e)||_y(t.w,e)||r.includes(t.w):(de.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),KW=w((t,e,r,n)=>{de.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),de.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(s=>{if(e.children(s).length>0)KW(s,e,r,n);else{const a=e.node(s);de.info("cp ",s," to ",n," with parent ",t),r.setNode(s,a),n!==e.parent(s)&&(de.warn("Setting parent",s,e.parent(s)),r.setParent(s,e.parent(s))),t!==n&&s!==t?(de.debug("Setting parent",s,t),r.setParent(s,t)):(de.info("In copy ",t,"root",n,"data",e.node(t),n),de.debug("Not Setting parent for node=",s,"cluster!==rootId",t!==n,"node!==clusterId",s!==t));const o=e.edges(s);de.debug("Copying Edges",o),o.forEach(l=>{de.info("Edge",l);const u=e.edge(l.v,l.w,l.name);de.info("Edge data",u,n);try{if(Pzt(l,n)){const h=qp.get(n)||[],d=h.includes(l.v)||_y(l.v,n)||l.v===n,f=h.includes(l.w)||_y(l.w,n)||l.w===n;if(d&&f)de.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),de.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;de.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else de.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){de.error(h)}})}de.debug("Removing node",s),e.removeNode(s)})},"copy"),lRe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)aRe.set(i,t),n=[...n,...lRe(i,e)];return n},"extractDescendants"),$zt=w((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),s=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),a=i.map(l=>({v:l.v,w:l.w}));return s.filter(l=>a.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),T5=w((t,e,r)=>{const n=e.children(t);if(de.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const s of n){const a=T5(s,e,r),o=$zt(e,r,a);if(a)if(o.length>0)i=a;else return a}return i},"findNonClusterChild"),ife=w(t=>!hn.has(t)||!hn.get(t).externalConnections?t:hn.has(t)?hn.get(t).id:t,"getAnchorId"),Bzt=w((t,e)=>{var r;if(!t||e>10){de.debug("Opting out, no graph ");return}else de.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(de.warn("Cluster identified",n," Replacement id in edges: ",T5(n,t,n)),qp.set(n,lRe(n,t)),hn.set(n,{id:T5(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),s=t.edges();i.length>0?(de.debug("Cluster identified",n,qp),s.forEach(a=>{const o=_y(a.v,n),l=_y(a.w,n);o^l&&(de.warn("Edge: ",a," leaves cluster ",n),de.warn("Descendants of XXX ",n,": ",qp.get(n)),hn.get(n).externalConnections=!0)})):de.debug("Not a cluster ",n,qp)});for(let n of hn.keys()){const i=hn.get(n).id,s=t.parent(i);s!==n&&hn.has(s)&&!hn.get(s).externalConnections&&(hn.get(n).id=s);const a=t.edges().some(o=>o.v===n);if(i&&((r=hn.get(n))!=null&&r.externalConnections)&&a&&hRe(t,i,n)){const o=zzt(t,n,t.parent(i));o&&(hn.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let s=n.v,a=n.w;if(de.warn("Fix XXX",hn,"ids:",n.v,n.w,"Translating: ",hn.get(n.v)," --- ",hn.get(n.w)),hn.get(n.v)||hn.get(n.w)){if(de.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),s=ife(n.v),a=ife(n.w),t.removeEdge(n.v,n.w,n.name),s!==n.v){const o=t.parent(s);hn.get(o).externalConnections=!0,i.fromCluster=n.v}if(a!==n.w){const o=t.parent(a);hn.get(o).externalConnections=!0,i.toCluster=n.w}de.warn("Fix Replacing with XXX",s,a,n.name),t.setEdge(s,a,i,n.name)}}),de.warn("Adjusted Graph",o0(t)),cRe(t,0),de.trace(hn)},"adjustClustersAndEdges"),cRe=w((t,e)=>{var i,s,a,o;if(de.warn("extractor - ",e,o0(t),t.children("D")),e>10){de.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){de.debug("Done, no node has children",t.nodes());return}de.debug("Nodes = ",r,e);for(const l of r)if(de.debug("Extracting node",l,hn,hn.has(l)&&!hn.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!hn.has(l))de.debug("Not a cluster",l,e);else if((s=(i=hn.get(l))==null?void 0:i.clusterData)!=null&&s.explicitDir&&t.children(l)&&t.children(l).length>0){de.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=hn.get(l).clusterData.dir,h=new qo({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});KW(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:hn.get(l).clusterData,label:hn.get(l).label,graph:h}),de.warn("Subgraph for cluster with explicit dir created:",l,o0(h))}else if(!hn.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){de.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(a=hn.get(l))==null?void 0:a.clusterData)!=null&&o.dir&&(h=hn.get(l).clusterData.dir,de.warn("Fixing dir",hn.get(l).clusterData.dir,h));const d=new qo({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});KW(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:hn.get(l).clusterData,label:hn.get(l).label,graph:d}),de.debug("Old graph after copy",o0(t))}else de.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!hn.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),de.debug(hn);r=t.nodes(),de.warn("New list of nodes",r);for(const l of r){const u=t.node(l);de.warn(" Now next level",l,u),u!=null&&u.clusterNode&&cRe(u.graph,e+1)}},"extractor"),uRe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),s=uRe(t,i);r=[...r,...s]}),r},"sorter"),Fzt=w(t=>uRe(t,t.children()),"sortNodesByHierarchy"),hRe=w((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=hn.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),zzt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||_y(i,r))continue;const s=T5(i,t,e);if(s&&!hRe(t,s,e))return s}return null},"findSafeAnchorNode");class Vzt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return sfe(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&sfe(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,Hzt)),n=n._prev;return"["+e.join(", ")+"]"}}function sfe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Hzt(t,e){if(t!=="_next"&&t!=="_prev")return e}var Gzt=j2(1);function Wzt(t,e){if(t.nodeCount()<=1)return[];var r=Uzt(t,e||Gzt),n=qzt(r.graph,r.buckets,r.zeroIdx);return Q5(oa(n,function(i){return t.outEdges(i.v,i.w)}))}function qzt(t,e,r){for(var n=[],i=e[e.length-1],s=e[0],a;t.nodeCount();){for(;a=s.dequeue();)rF(t,e,r,a);for(;a=i.dequeue();)rF(t,e,r,a);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(a=e[o].dequeue(),a){n=n.concat(rF(t,e,r,a,!0));break}}}return n}function rF(t,e,r,n,i){var s=i?[]:void 0;return Et(t.inEdges(n.v),function(a){var o=t.edge(a),l=t.node(a.v);i&&s.push({v:a.v,w:a.w}),l.out-=o,ZW(e,r,l)}),Et(t.outEdges(n.v),function(a){var o=t.edge(a),l=a.w,u=t.node(l);u.in-=o,ZW(e,r,u)}),t.removeNode(n.v),s}function Uzt(t,e){var r=new qo,n=0,i=0;Et(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),Et(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var s=BT(i+n+3).map(function(){return new Vzt}),a=n+1;return Et(r.nodes(),function(o){ZW(s,a,r.node(o))}),{graph:r,buckets:s,zeroIdx:a}}function ZW(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function Yzt(t){var e=t.graph().acyclicer==="greedy"?Wzt(t,r(t)):jzt(t);Et(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,dN("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function jzt(t){var e=[],r={},n={};function i(s){Object.prototype.hasOwnProperty.call(n,s)||(n[s]=!0,r[s]=!0,Et(t.outEdges(s),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?e.push(a):i(a.w)}),delete r[s])}return Et(t.nodes(),i),e}function Xzt(t){Et(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function w3(t,e,r,n){var i;do i=dN(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Kzt(t){var e=new qo().setGraph(t.graph());return Et(t.nodes(),function(r){e.setNode(r,t.node(r))}),Et(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function dRe(t){var e=new qo({multigraph:t.isMultigraph()}).setGraph(t.graph());return Et(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Et(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function afe(t,e){var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=o*i/s,u=o):(i<0&&(a=-a),l=a,u=a*s/i),{x:r+l,y:n+u}}function qD(t){var e=oa(BT(fRe(t)+1),function(){return[]});return Et(t.nodes(),function(r){var n=t.node(r),i=n.rank;Us(i)||(e[i][n.order]=r)}),e}function Zzt(t){var e=DS(oa(t.nodes(),function(r){return t.node(r).rank}));Et(t.nodes(),function(r){var n=t.node(r);X2(n,"rank")&&(n.rank-=e)})}function Qzt(t){var e=DS(oa(t.nodes(),function(s){return t.node(s).rank})),r=[];Et(t.nodes(),function(s){var a=t.node(s).rank-e;r[a]||(r[a]=[]),r[a].push(s)});var n=0,i=t.graph().nodeRankFactor;Et(r,function(s,a){Us(s)&&a%i!==0?--n:n&&Et(s,function(o){t.node(o).rank+=n})})}function ofe(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),w3(t,"border",i,e)}function fRe(t){return cg(oa(t.nodes(),function(e){var r=t.node(e).rank;if(!Us(r))return r}))}function Jzt(t,e){var r={lhs:[],rhs:[]};return Et(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function eVt(t,e){return e()}function tVt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Et(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,a=i.maxRank+1;sa.lim&&(o=a,l=!0);var u=Pf(e.edges(),function(h){return l===ufe(t,t.node(h.v),o)&&l!==ufe(t,t.node(h.w),o)});return pX(u,function(h){return z6(e,h)})}function TRe(t,e,r,n){var i=r.v,s=r.w;t.removeEdge(i,s),t.setEdge(n.v,n.w,{}),vJ(t),yJ(t,e),mVt(t,e)}function mVt(t,e){var r=dX(t.nodes(),function(i){return!e.node(i).parent}),n=pVt(t,r);n=n.slice(1),Et(n,function(i){var s=t.node(i).parent,a=e.edge(i,s),o=!1;a||(a=e.edge(s,i),o=!0),e.node(i).rank=e.node(s).rank+(o?a.minlen:-a.minlen)})}function yVt(t,e,r){return t.hasEdge(e,r)}function ufe(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function vVt(t){switch(t.graph().ranker){case"network-simplex":hfe(t);break;case"tight-tree":xVt(t);break;case"longest-path":bVt(t);break;default:hfe(t)}}var bVt=mJ;function xVt(t){mJ(t),gRe(t)}function hfe(t){iv(t)}function wVt(t){var e=w3(t,"root",{},"_root"),r=TVt(t),n=cg(Kf(r))-1,i=2*n+1;t.graph().nestingRoot=e,Et(t.edges(),function(a){t.edge(a).minlen*=i});var s=CVt(t)+1;Et(t.children(),function(a){CRe(t,e,i,s,n,r,a)}),t.graph().nodeRankFactor=i}function CRe(t,e,r,n,i,s,a){var o=t.children(a);if(!o.length){a!==e&&t.setEdge(e,a,{weight:0,minlen:r});return}var l=ofe(t,"_bt"),u=ofe(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(u,a),h.borderBottom=u,Et(o,function(d){CRe(t,e,r,n,i,s,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-s[a]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,l,{weight:0,minlen:i+s[a]})}function TVt(t){var e={};function r(n,i){var s=t.children(n);s&&s.length&&Et(s,function(a){r(a,i+1)}),e[n]=i}return Et(t.children(),function(n){r(n,1)}),e}function CVt(t){return IE(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function kVt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Et(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function SVt(t,e,r){var n={},i;Et(r,function(s){for(var a=t.parent(s),o,l;a;){if(o=t.parent(a),o?(l=n[o],n[o]=a):(l=i,i=a),l&&l!==a){e.setEdge(l,a);return}a=o}})}function EVt(t,e,r){var n=AVt(t),i=new qo({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(s){return t.node(s)});return Et(t.nodes(),function(s){var a=t.node(s),o=t.parent(s);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(s),i.setParent(s,o||n),Et(t[r](s),function(l){var u=l.v===s?l.w:l.v,h=i.edge(u,s),d=Us(h)?0:h.weight;i.setEdge(u,s,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(s,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function AVt(t){for(var e;t.hasNode(e=dN("_root")););return e}function MVt(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function _Vt(t){var e={},r=Pf(t.nodes(),function(o){return!t.children(o).length}),n=cg(oa(r,function(o){return t.node(o).rank})),i=oa(BT(n+1),function(){return[]});function s(o){if(!X2(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),Et(t.successors(o),s)}}var a=Gg(r,function(o){return t.node(o).rank});return Et(a,s),i}function LVt(t,e){return oa(e,function(r){var n=t.inEdges(r);if(n.length){var i=IE(n,function(s,a){var o=t.edge(a),l=t.node(a.v);return{sum:s.sum+o.weight*l.order,weight:s.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function IVt(t,e){var r={};Et(t,function(i,s){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Us(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),Et(e.edges(),function(i){var s=r[i.v],a=r[i.w];!Us(s)&&!Us(a)&&(a.indegree++,s.out.push(r[i.w]))});var n=Pf(r,function(i){return!i.indegree});return NVt(n)}function NVt(t){var e=[];function r(s){return function(a){a.merged||(Us(a.barycenter)||Us(s.barycenter)||a.barycenter>=s.barycenter)&&DVt(s,a)}}function n(s){return function(a){a.in.push(s),--a.indegree===0&&t.push(a)}}for(;t.length;){var i=t.pop();e.push(i),Et(i.in.reverse(),r(i)),Et(i.out,n(i))}return oa(Pf(e,function(s){return!s.merged}),function(s){return $T(s,["vs","i","barycenter","weight"])})}function DVt(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function OVt(t,e){var r=Jzt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Gg(r.rhs,function(h){return-h.i}),s=[],a=0,o=0,l=0;n.sort(PVt(!!e)),l=dfe(s,i,l),Et(n,function(h){l+=h.vs.length,s.push(h.vs),a+=h.barycenter*h.weight,o+=h.weight,l=dfe(s,i,l)});var u={vs:Q5(s)};return o&&(u.barycenter=a/o,u.weight=o),u}function dfe(t,e,r){for(var n;e.length&&(n=s9(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function PVt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function kRe(t,e,r,n){var i=t.children(e),s=t.node(e),a=s?s.borderLeft:void 0,o=s?s.borderRight:void 0,l={};a&&(i=Pf(i,function(g){return g!==a&&g!==o}));var u=LVt(t,i);Et(u,function(g){if(t.children(g.v).length){var m=kRe(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&BVt(g,m)}});var h=IVt(u,r);$Vt(h,l);var d=OVt(h,n);if(a&&(d.vs=Q5([a,d.vs,o]),t.predecessors(a).length)){var f=t.node(t.predecessors(a)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function $Vt(t,e){Et(t,function(r){r.vs=Q5(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function BVt(t,e){Us(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function FVt(t){var e=fRe(t),r=ffe(t,BT(1,e+1),"inEdges"),n=ffe(t,BT(e-1,-1,-1),"outEdges"),i=_Vt(t);pfe(t,i);for(var s=Number.POSITIVE_INFINITY,a,o=0,l=0;l<4;++o,++l){zVt(o%2?r:n,o%4>=2),i=qD(t);var u=MVt(t,i);ua||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)s.push(l);return{path:i.concat(s.reverse()),lca:u}}function GVt(t){var e={},r=0;function n(i){var s=r;Et(t.children(i),n),e[i]={low:s,lim:r++}}return Et(t.children(),n),e}function WVt(t,e){var r={};function n(i,s){var a=0,o=0,l=i.length,u=s9(s);return Et(s,function(h,d){var f=UVt(t,h),p=f?t.node(f).order:l;(f||h===u)&&(Et(s.slice(o,d+1),function(g){Et(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&SRe(r,f,h)})})}function i(s,a){var o=-1,l,u=0;return Et(a,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(a,u,d,o,l),u=d,o=l)}n(a,u,a.length,l,s.length)}),a}return IE(e,i),r}function UVt(t,e){if(t.node(e).dummy)return dX(t.predecessors(e),function(r){return t.node(r).dummy})}function SRe(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function YVt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function jVt(t,e,r,n){var i={},s={},a={};return Et(e,function(o){Et(o,function(l,u){i[l]=l,s[l]=l,a[l]=u})}),Et(e,function(o){var l=-1;Et(o,function(u){var h=n(u);if(h.length){h=Gg(h,function(m){return a[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];s[u]===u&&l{var n=r(" buildLayoutGraph",()=>gHt(t));r(" runLayout",()=>sHt(n,r)),r(" updateInputGraph",()=>aHt(t,n))})}function sHt(t,e){e(" makeSpaceForEdgeLabels",()=>mHt(t)),e(" removeSelfEdges",()=>SHt(t)),e(" acyclic",()=>Yzt(t)),e(" nestingGraph.run",()=>wVt(t)),e(" rank",()=>vVt(dRe(t))),e(" injectEdgeLabelProxies",()=>yHt(t)),e(" removeEmptyRanks",()=>Qzt(t)),e(" nestingGraph.cleanup",()=>kVt(t)),e(" normalizeRanks",()=>Zzt(t)),e(" assignRankMinMax",()=>vHt(t)),e(" removeEdgeLabelProxies",()=>bHt(t)),e(" normalize.run",()=>aVt(t)),e(" parentDummyChains",()=>VVt(t)),e(" addBorderSegments",()=>tVt(t)),e(" order",()=>FVt(t)),e(" insertSelfEdges",()=>EHt(t)),e(" adjustCoordinateSystem",()=>rVt(t)),e(" position",()=>nHt(t)),e(" positionSelfEdges",()=>AHt(t)),e(" removeBorderNodes",()=>kHt(t)),e(" normalize.undo",()=>lVt(t)),e(" fixupEdgeLabelCoords",()=>THt(t)),e(" undoCoordinateSystem",()=>nVt(t)),e(" translateGraph",()=>xHt(t)),e(" assignNodeIntersects",()=>wHt(t)),e(" reversePoints",()=>CHt(t)),e(" acyclic.undo",()=>Xzt(t))}function aHt(t,e){Et(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),Et(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var oHt=["nodesep","edgesep","ranksep","marginx","marginy"],lHt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},cHt=["acyclicer","ranker","rankdir","align"],uHt=["width","height"],hHt={width:0,height:0},dHt=["minlen","weight","width","height","labeloffset"],fHt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},pHt=["labelpos"];function gHt(t){var e=new qo({multigraph:!0,compound:!0}),r=aF(t.graph());return e.setGraph(Pi({},lHt,sF(r,oHt),$T(r,cHt))),Et(t.nodes(),function(n){var i=aF(t.node(n));e.setNode(n,e2e(sF(i,uHt),hHt)),e.setParent(n,t.parent(n))}),Et(t.edges(),function(n){var i=aF(t.edge(n));e.setEdge(n,Pi({},fHt,sF(i,dHt),$T(i,pHt)))}),e}function mHt(t){var e=t.graph();e.ranksep/=2,Et(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function yHt(t){Et(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),s={rank:(i.rank-n.rank)/2+n.rank,e};w3(t,"edge-proxy",s,"_ep")}})}function vHt(t){var e=0;Et(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=cg(e,n.maxRank))}),t.graph().maxRank=e}function bHt(t){Et(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function xHt(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,s=t.graph(),a=s.marginx||0,o=s.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}Et(t.nodes(),function(u){l(t.node(u))}),Et(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=a,n-=o,Et(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),Et(t.edges(),function(u){var h=t.edge(u);Et(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),s.width=r-e+a,s.height=i-n+o}function wHt(t){Et(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),s,a;r.points?(s=r.points[0],a=r.points[r.points.length-1]):(r.points=[],s=i,a=n),r.points.unshift(afe(n,s)),r.points.push(afe(i,a))})}function THt(t){Et(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function CHt(t){Et(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function kHt(t){Et(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),s=t.node(s9(r.borderLeft)),a=t.node(s9(r.borderRight));r.width=Math.abs(a.x-s.x),r.height=Math.abs(i.y-n.y),r.x=s.x+r.width/2,r.y=n.y+r.height/2}}),Et(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function SHt(t){Et(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function EHt(t){var e=qD(t);Et(e,function(r){var n=0;Et(r,function(i,s){var a=t.node(i);a.order=s+n,Et(a.selfEdges,function(o){w3(t,"selfedge",{width:o.label.width,height:o.label.height,rank:a.rank,order:s+ ++n,e:o.e,label:o.label},"_se")}),delete a.selfEdges})})}function AHt(t){Et(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,s=n.y,a=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*a/3,y:s-o},{x:i+5*a/6,y:s-o},{x:i+a,y:s},{x:i+5*a/6,y:s+o},{x:i+2*a/3,y:s+o}],r.label.x=r.x,r.label.y=r.y}})}function sF(t,e){return hN($T(t,e),Number)}function aF(t){var e={};return Et(t,function(r,n){e[n.toLowerCase()]=r}),e}var gfe=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),mfe=w((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),MHt=w(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),RHt=w((t,e,r,n,i)=>{const s=[],a=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&a.add(h),d!==n&&a.add(d)}),a.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&s.push(d)}),s.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&s.push(d)})}),s.length===0)return mfe(i);const o=s.reduce((h,d)=>({x:h.x+d.x/s.length,y:h.y+d.y/s.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":mfe(i)},"getSelfLoopSide"),_Ht=w((t,e="top",r=0,n=0)=>{const i=t.x,s=t.y-r,a=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=gfe(Math.max(n,t.width*.35),36,l),h=gfe(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=s+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+a;return[{x:d,y:s-u/2},{x:d+h,y:s-u/2},{x:d+h,y:s+u/2},{x:d,y:s+u/2}]}case"left":{const d=i-a;return[{x:d,y:s-u/2},{x:d-h,y:s-u/2},{x:d-h,y:s+u/2},{x:d,y:s+u/2}]}case"top":default:{const d=s-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),LHt=w((t,e,r="top",n=0,i={})=>{const a=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:a,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:a,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),ARe=w((t,e=0,{mergeSelfLoops:r=!0}={})=>{var a;const n=new Map,i=[],s=(a=t.graph())==null?void 0:a.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(x=>i.push(x));return}o.sort((x,b)=>x.edge.selfLoop.order-b.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(x=>i.push(x));return}const p={width:u.edge.width,height:u.edge.height},g=RHt(t,f,o,d.start,s),m=_Ht(f,g,e,p.width??0),y=LHt(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),MRe=w(async(t,e,r,n,i,s)=>{de.warn("Graph in recursive render:XAX",o0(e),i);const a=e.graph().rankdir;de.trace("Dir in recursive render - dir:",a);const o=t.insert("g").attr("class","root");e.nodes()?de.info("Recursive render XXX",e.nodes()):de.info("No nodes found for",e),e.edges().length>0&&de.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=MHt(r);await Promise.all(e.nodes().map(async function(x){const b=e.node(x);if(i!==void 0){const T=JSON.parse(JSON.stringify(i.clusterData));de.trace(`Setting data for parent cluster XXX Node.id = `,x,` data=`,T.height,` -Parent cluster`,i.height),e.setNode(i.id,T),e.parent(x)||(de.trace("Setting parent",x,i.id),e.setParent(x,i.id,T))}if(de.info("(Insert) Node XXX"+x+": "+JSON.stringify(e.node(x))),b!=null&&b.clusterNode){de.info("Cluster identified XBX",x,b.width,e.node(x));const{ranksep:T,nodesep:C}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:T+25,nodesep:C});const S=await TRe(d,b.graph,r,n,e.node(x),s),k=S.elem;wr(b,k),b.diff=S.diff||0,de.info("New compound node after recursive render XAX",x,"width",b.width,"height",b.height),r3t(k,b)}else e.children(x).length>0?(de.trace("Cluster - the non recursive path XBX",x,b.id,b,b.width,"Graph:",e),de.trace(b5(b.id,e)),hn.set(b.id,{id:b5(b.id,e),node:b})):(de.trace("Node - the non recursive path XAX",x,d,e.node(x),a),await r7(d,e.node(x),{config:s,dir:a}))})),await w(async()=>{const x=e.edges().map(async function(b){const T=e.edge(b.v,b.w,b.name);if(de.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),de.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),de.info("Fix",hn,"ids:",b.v,b.w,"Translating: ",hn.get(b.v),hn.get(b.w)),f&&T.selfLoop){if(T.selfLoop.order!==1)return;const C=T.id;T.id=T.selfLoop.id,await h_(h,T),T.id=C;return}await h_(h,T)});await Promise.all(x)},"processEdges")(),de.info("Graph before layout:",JSON.stringify(n0(e))),de.info("############################################# XXX"),de.info("### Layout ### XXX"),de.info("############################################# XXX"),xRe(e),de.info("Graph after layout:",JSON.stringify(n0(e)));let g=0,{subGraphTitleTotalMargin:m}=s3(s);await Promise.all(Czt(e).map(async function(x){var T;const b=e.node(x);if(de.info("Position XBX => "+x+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,de.info("A tainted cluster node XBX1",x,b.id,b.width,b.height,b.x,b.y,e.parent(x)),hn.get(b.id).node=b,u_(b);else if(e.children(x).length>0){de.info("A pure cluster node XBX1",x,b.id,b.x,b.y,b.width,b.height,e.parent(x)),b.height+=m,e.node(b.parentId);const C=(b==null?void 0:b.padding)/2||0,S=((T=b==null?void 0:b.labelBBox)==null?void 0:T.height)||0,k=S-C||0;de.debug("OffsetY",k,"labelHeight",S,"halfPadding",C),await iD(l,b),hn.get(b.id).node=b}else{const C=e.node(b.parentId);b.y+=m/2,de.info("A regular node XBX1 - using the padding",b.id,"parent",b.parentId,b.width,b.height,b.x,b.y,"offsetY",b.offsetY,"parent",C,C==null?void 0:C.offsetY,b),u_(b)}}));const y=m/2;return wRe(e,y,{mergeSelfLoops:f}).forEach(function({edge:x,start:b,end:T}){de.info("Edge "+b+" -> "+T+": "+JSON.stringify(x),x),x.points.forEach(E=>E.y+=y);const C=e.node(b),S=e.node(T),k=kZ(u,x,hn,r,C,S,n);jSe(x,k)}),e.nodes().forEach(function(x){const b=e.node(x);de.info(x,b.type,b.diff),b.isGroup&&(g=b.diff)}),de.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),mHt=w(async(t,e)=>{var s,a,o,l,u,h;const r=new qo({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((s=t.config)==null?void 0:s.nodeSpacing)||((o=(a=t.config)==null?void 0:a.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");SZ(n,t.markers,t.type,t.diagramId),qSe(),YSe(),kke(),tRe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),de.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),x=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},x.originalEdge=y,x.selfLoop={id:y.id,order:1},b.originalEdge=y,b.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",x.startLabelRight="",x.startLabelLeft="",x.endLabelLeft="",x.endLabelRight="",x.arrowTypeStart="none",x.arrowTypeEnd="none",x.id=f+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,b.toCluster=f),b.id=f+"-cyclic-special-2",b.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,x,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),de.warn("Graph at first:",JSON.stringify(n0(r))),Tzt(r),de.warn("Graph after XAX:",JSON.stringify(n0(r)));const i=Ve();await TRe(n,r,t.type,t.diagramId,void 0,i)},"render");const yHt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:wRe,render:mHt},Symbol.toStringTag,{value:"Module"}));async function CRe(t,e){const r=new qo({multigraph:!0,compound:!0}),n=[...e.edges],i=Ve(),s=t.insert("g").attr("class","root"),a=s.insert("g").attr("class","clusters"),o=s.insert("g").attr("class","edges edgePath"),l=s.insert("g").attr("class","edgeLabels"),u=s.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await r7(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await Rr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>b4r);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:a,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:s},nodeElements:h}}w(CRe,"createGraphWithElements");var hfe=5,b8=1e-5,x8=1e-6;function yL(t){const e=[];for(let r=0;r=1-x8||f<=x8||f>=1-x8?null:{point:{x:t.x+d*i,y:t.y+d*s},tA:d,tB:f}}w(kRe,"segmentIntersection");function jW(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(jW,"isHorizontalSeg");function SRe(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(ERe,"getArcSweepFlag");var vHt=.001;function ARe(t,e){if(t.length<2)return t.map(s=>({...s}));const r=t.map(s=>({...s})),n=e.arrowTypeStart&&Oa[e.arrowTypeStart];if(n){const s=t[0],a=t[1],o=Math.atan2(a.y-s.y,a.x-s.x);r[0].x=s.x+n*Math.cos(o),r[0].y=s.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&Oa[e.arrowTypeEnd];if(i){const s=t.length,a=t[s-2],o=t[s-1],l=Math.atan2(o.y-a.y,o.x-a.x);r[s-1].x=o.x-i*Math.cos(l),r[s-1].y=o.y-i*Math.sin(l)}return r}w(ARe,"applyMarkerOffsets");function MRe(t,e,r,n,i){const s=t.point.x,a=t.point.y,o={x:s-e*t.r,y:a-r*t.r},l={x:s+e*t.r,y:a+r*t.r},u=[`L${Db(o)}`];return i==="arc"?u.push(`A${rh(t.r)},${rh(t.r)} 0 0 ${n} ${Db(l)}`):u.push(`M${Db(l)}`),u}w(MRe,"emitJump");function XW(t,e,r,n){const i=e.x-t.x,s=e.y-t.y,a=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,s),u=Math.hypot(a,o);if(l0){const b=XW(i[u-1],i[u],i[u+1]??i[u],hfe);b&&(m=b.cutLen)}let y=d,v=null;s&&ub.t-T.t);for(const b of x)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bT){const C=T/2;x[b].r=Math.min(x[b].r,C),x[b+1].r=Math.min(x[b+1].r,C)}}for(const b of x)b.r=2?n:null}catch{return null}}w(IRe,"decodeDataPoints");function NRe(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const s=[],a=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;a.set(u.id,d);const p=IRe(d.getAttribute("data-points"))??u.points;s.push({...u,points:p})}const o=SRe(s);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of s){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!LRe(f))continue;const p=a.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!_Re(b))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,x=RRe(u,h,r);if(p.setAttribute("d",x),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),T=Math.max(0,b-y-v),C=`0 ${y} ${T} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}w(NRe,"applyLineJumpsToSvg");async function DRe(t,e){var i,s;for(const a of t.nodes)a.isGroup?await iD(e.clusters,a):u_(a);const r=new Map;for(const a of t.nodes)a!=null&&a.id&&r.set(a.id,a);for(const a of t.edges){const o=a.start?r.get(a.start)??{}:{},l=a.end?r.get(a.end)??{}:{},u=kZ(e.edgePaths,{...a},{},t.type,o,l,t.diagramId);a.label&&await h_(e.rootGroups,a),a.label&&ORe(a,u)}const n=(s=(i=t.config)==null?void 0:i.swimlane)==null?void 0:s.lineHops;if(n!==!1){const a=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));NRe(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:a})}}w(DRe,"adjustLayout");function ORe(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=vr(),{subGraphTitleTotalMargin:i}=s3({flowchart:n.flowchart??{}});if(t.label){const s=T6.get(t.id);let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const s=Hs.get(t.id).startLeft;let a=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Hs.get(t.id).startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Hs.get(t.id).endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Hs.get(t.id).endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}}w(ORe,"positionEdgeLabel");var nF="__swimlane_default__",bHt=21,dfe=20;function KW(t){return Math.max(t.padding??dfe,dfe)}w(KW,"topLaneHorizontalPadding");function PRe(t){const{x:e,y:r,width:n,height:i}=t,s=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof s!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(s)||n<=0||i<=0){delete t.groupTitleRect;return}const a=r-i/2,o=Math.min(s,r+i/2),l=Math.min(bHt,Math.max(0,o-a)),u=a+l;if(u<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:a,bottom:u}}w(PRe,"assignTopLaneTitleRect");function $Re(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const s of t.nodes??[])s.isGroup&&!s.parentId&&(s.shape="swimlane",e&&(s.direction=e));const n=r.filter(s=>!s.isGroup&&!s.parentId);if(n.length===0)return;let i=r.find(s=>s.id===nF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:nF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const s of n)s.parentId=nF}w($Re,"prepareLayoutForSwimlanes");function BRe(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),s=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...s].map(l=>l.id),edges:r,layout:t,nodeById:e}}w(BRe,"toGraphView");function FRe(t,e,r,n){const{layout:i}=t,s=t.nodeById,a=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=s.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*a;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(x=>x.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const x of p){const b=x.x??r.x[x.id],T=x.y??r.y[x.id],C=x.width??0,S=x.height??0;b!=null&&T!=null&&(g=Math.min(g,b-C/2),m=Math.max(m,b+C/2),y=Math.min(y,T-S/2),v=Math.max(v,T+S/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const x=f.padding??20,b=f.parentId?x:2*KW(f),T=x,C=Math.max(0,m-g)+b,S=Math.max(0,v-y)+T,k=(g+m)/2,E=(y+v)/2;f.x=k,f.y=E,f.width=C,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),x=m+2*v,b=(f+p)/2;for(const A of d)A.y=b,A.height=x,A.swimlaneContentTop=f;const T=[...d].sort((A,R)=>{const _=A.x??0,P=R.x??0;return _-P}),C=[],S=[],k=[];for(const A of T){const R=h.get(A.id);if(!R)continue;const _=Math.max(0,R.maxX-R.minX)+2*KW(A),P=(R.minX+R.maxX)/2;C.push(A.id),S.push(P),k.push(_)}const E=C.length;if(E>0){const A=new Map;if(E===1)A.set(C[0],k[0]);else{const R=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:Ob(e,r,n,i)}:void 0}w(gJ,"measuredNodeRect");function mJ(t){if(t.isGroup)return;const e=gJ(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(mJ,"nodeBoundsInfoFor");function _u(t,e,r=Ja){return Math.abs(t.x-e.x)r}w(Is,"isHorizontalSegment");function Ns(t,e,r=Ja){return On(t,e,r)&&Math.abs(t.y-e.y)>r}w(Ns,"isVerticalSegment");function Ml(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}w(Ml,"overlapLength");function kd(t,e,r=Ja){return t.horizontal&&e.horizontal&&Bn(t.a,e.a,r)?Ml(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&On(t.a,e.a,r)?Ml(t.a.y,t.b.y,e.a.y,e.b.y):0}w(kd,"sameAxisSegmentOverlapLength");function x5(t,e=Ja){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!_u(i,n,e))&&r.push({x:n.x,y:n.y})}return r}w(Yn,"dedupeConsecutivePoints");function yJ(t,e=Ja){if(!t||t.length!==4)return;const[r,n,i,s]=t;return Is(r,n,e)&&Ns(n,i,e)&&Is(i,s,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:s}:Ns(r,n,e)&&Is(n,i,e)&&Ns(i,s,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:s}:void 0}w(yJ,"classifyThreeSegmentRoute");function GD(t,e,r,n=0){const i=Math.min(t.x,e.x),s=Math.max(t.x,e.x),a=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return s>r.left-n&&ir.top-n&&ae.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}w(VRe,"rectContainsRect");function vL(t,e){return t.lefte.left&&t.tope.top}w(vL,"rectsOverlap");function ZW(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(ZW,"inflateRect");function Ob(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w(Ob,"rectFromCenterSize");function dc(t){var e;return(e=gJ(t))==null?void 0:e.rect}w(dc,"rectOfNodeBounds");function $1(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}w($1,"portForRectSide");function bJ(t,e,r,n,i,s=Ja){const a=e==="left"||e==="right",o=n==="left"||n==="right";if(a&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Bn(t,r,s))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Bn(t,r,s))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!a&&!o){if(e===n){if(On(t,r,s))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(On(t,r,s))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(a&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}w(bJ,"buildOrthogonalPortPath");function xJ(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}w(xJ,"buildSameSideTrackPath");function WD(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=mJ(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(WD,"collectRealNodeBounds");function Jg(t){const e=[],r=[];for(const n of t){const i=mJ(n);if(!i)continue;const s={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(s):e.push(s)}return{realNodeRects:e,labelNodeRects:r}}w(Jg,"collectNodeRectEntries");function HRe(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,s=n.y??0,a=n.width??0,o=n.height??0;r.push({nodeId:n.id,...Ob(i,s,a,o)})}return r}w(HRe,"collectLayoutNodeRects");function wJ(t,e,r=Ja){const n=t.start,i=t.end;if(!n||!i)return;const s=e.get(n),a=e.get(i);if(!(!s||!a))return{srcId:n,dstId:i,srcInfo:s,dstInfo:a,collinearX:Math.abs(s.cx-a.cx)g||fv)return!1;const x=Math.abs(m-h.a.x)i:s&&o&&Bn(t,r,i)?Ml(t.x,e.x,r.x,n.x)>i:!1}w(GRe,"sameAxisSegmentsOverlap");function bL(t,e,r,n,{epsilon:i=Ja,skipDegenerateOther:s=!1}={}){for(const a of r){if(a===n||a.isLayoutOnly)continue;const o=a.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+Ja&&t=2?e[e.length-2]:void 0,l=(a?On(a,i):!1)?{x:i.x,y:s.y}:{x:s.x,y:i.y};e.push(l)}e.push(s)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!_u(i,n))&&r.push(n)}return r}w(xL,"orthogonalizePolyline");function Nd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=qRe(e);if(e=n.points,!n.changed)break}return e}w(Nd,"simplifyPolyline");var Zr=.001,wHt=.5,ffe=4;function CJ(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const s=i-n;if(s<0||s>=t.length)return t;const a=URe(t[i],t[s],e);return r?[a,...t.slice(i)]:[...t.slice(0,i+1),a]}w(JW,"clipEndpoint");function YRe(t,e){for(const r of t){const n=CJ(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=JW(i,n.srcRect,!0)),n.dstRect&&(i=JW(i,n.dstRect,!1)),i=Nd(xL(i)),i=kJ(i,n.srcRect,n.dstRect),n.edge.points=Nd(xL(i))}}w(YRe,"clipEdgeEndpointsToNodeBoundaries");function eq(t,e,r,n=!1){if(Bn(t,e,Zr)){if(e.yr.bottom+Zr)return e;if(n){if(t.xr.right+Zr)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(On(t,e,Zr)){if(e.xr.right+Zr)return e;if(n){if(t.yr.bottom+Zr)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}w(eq,"snapEndpointToBoundary");function wL(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}w(jRe,"intersectRanges");function rq(t,e){return e==="left"||e==="right"?TL(t.top,t.bottom):TL(t.left,t.right)}w(rq,"clearanceRangeForSide");function CL(t,e,r){const n=t.y>=r.top-Zr&&t.y<=r.bottom+Zr,i=t.x>=r.left-Zr&&t.x<=r.right+Zr;if(Bn(t,e,Zr)&&n){if(Math.abs(t.x-r.left)0?jRe(s):void 0}w(XRe,"straightClearanceRange");function nq(t,e,r,n,i){const s=XRe(t,e,r,n,i);if(!s)return;const a=i?t.y:t.x,o=Math.min(s.hi,Math.max(s.lo,a));if(!(Math.abs(o-a)({...o}));for(let o=e;o>=0&&o=r.left-Zr&&Math.max(t.x,e.x)<=r.right+Zr,i=Math.min(t.y,e.y)>=r.top-Zr&&Math.max(t.y,e.y)<=r.bottom+Zr;if(Math.abs(t.y-r.top)n.bottom+Zr;case"left":return Bn(e,r,Zr)&&r.xn.right+Zr}}w(aq,"leavesOutward");function oq(t,e,r){if(t.length<3)return t;if(r){const s=sq(t[0],t[1],e);return s&&aq(s,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=sq(t[n-1],t[n],e);return i&&aq(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(oq,"collapseOwnBorderStub");function QRe(t,e,r){let n=t;if(e){const s=wL(n,0,1);if(s){const a=eq(s,n[0],e);a!==n[0]&&(n=[a,...n.slice(1)])}n=oq(n,e,!0)}if(r){const s=n.length-1,a=wL(n,s,-1);if(a){const o=eq(a,n[s],r,!0);o!==n[s]&&(n=[...n.slice(0,s),o])}n=oq(n,r,!1)}const i=kJ(n,e,r);return i!==n||n.length===2?i:(e&&(n=iq(n,e,!0)),r&&(n=iq(n,r,!1)),n)}w(QRe,"snapAndCollapseEndpoints");function lq(t,e){for(const r of t){const n=CJ(r,e,2);if(!n)continue;const i=Yn(n.points,Zr),s=QRe(i,n.srcRect,n.dstRect);if(s.length<3){n.edge.points=s;continue}const a=[s[0],{...s[0]},...s.slice(1,-1),s[s.length-1],{...s[s.length-1]}];n.edge.points=a}}w(lq,"prepareEdgeEndpointsForRenderer");function SJ(t){return new Map(t.map(e=>[e.id,e]))}w(SJ,"buildNodeMap");function JRe(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}w(JRe,"resolveTopLevelGroupId");function cq(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}w(cq,"groupDepth");function EJ(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const s of t){const a=s.x,o=s.y;if(typeof a!="number"||typeof o!="number")continue;const l=s.width??0,u=s.height??0;e=Math.min(e,a-l/2),r=Math.max(r,a+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}w(EJ,"boundsForChildren");function e9e(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}w(e9e,"applyGroupBounds");function t9e(t){const e=SJ(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>cq(i,e)-cq(n,e));for(const n of r){const i=t.filter(a=>a.parentId===n.id),s=EJ(i);s&&e9e(n,s)}}w(t9e,"recomputeNestedGroupBounds");function kL(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let s=1/0,a=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(s=Math.min(s,u),a=Math.max(a,u))}if(!Number.isFinite(s)||!Number.isFinite(a))return!1;const o=w(l=>s+a-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}w(kL,"mirrorAxis");function r9e(t){return(t.nodes??[]).some(r=>!r.isGroup)?kL(t,"y"):!0}w(r9e,"applyBtDirectionTransform");function n9e(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(N=>!N.isGroup);let s=1/0,a=1/0;for(const N of i){const L=N.x??0,I=N.y??0;L0?Math.max(1,h/d):1;for(const N of i){const L=N.x??0,$=((N.y??0)-a)*f+o,O=L-s;N.x=$,N.y=O}for(const N of n)if(N.points)for(const L of N.points){const I=L.x,O=(L.y-a)*f+o,D=I-s;L.x=O,L.y=D}t9e(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&kL(t,"x"),!0;const g=SJ(r),m=new Map;for(const N of r){if(N.isGroup)continue;const L=JRe(N,g);if(!L)continue;const I=m.get(L)??[];I.push(N),m.set(L,I)}let y=0;for(const N of p){const L=N.padding??0;L>y&&(y=L)}const v=[];let x=1/0,b=-1/0;for(const N of p){const L=m.get(N.id)??[],I=EJ(L);I&&(x=Math.min(x,I.minX),b=Math.max(b,I.maxX),v.push({lane:N,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(x===1/0||b===-1/0)return!0;const T=Math.max(0,b-x),C=Math.max(y,10),S=T+2*C,k=o+S,R=(x+b)/2-S/2-o,_=R+k/2,P=Math.max(y,o);v.sort((N,L)=>N.centerY-L.centerY);for(let N=0;Nf.cy?v.bottom:v.top,P=f.cx+x;if(P<=v.left+zu||P>=v.right-zu)continue;b={x:P,y:_},T={x:P,y:o.y},C={x:o.x,y:o.y}}else{const _=p.cx>f.cx?v.right:v.left,P=f.cy+x;if(P<=v.top+zu||P>=v.bottom-zu)continue;b={x:_,y:P},T={x:o.x,y:P},C={x:o.x,y:o.y}}const S=_u(b,T,zu),k=_u(T,C,zu);if(S&&k||!S&&Xs(b,T,n,[h],1)||!k&&Xs(T,C,n,[d],1))continue;const E=!S&&bL(b,T,t,i,{epsilon:zu,skipDegenerateOther:!0}),A=!k&&bL(T,C,t,i,{epsilon:zu,skipDegenerateOther:!0});if(!(E||A)){S?y=[T,C]:k?y=[b,T]:y=[b,T,C];break}}y&&(i.points=y)}}w(i9e,"portSwapToLShape");function s9e(t,e){const{realNodeRects:s,labelNodeRects:a}=Jg(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Yn(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,x=f.y-p.y;if(Math.hypot(v,x)<.001)continue;const T=Is(f,d,.001),C=Ns(f,d,.001),S=Is(p,f,.001),k=Ns(p,f,.001);if(!(T&&k||C&&S))continue;const E=o.end,A=o.start,R=E?e.get(E):void 0;if(!R)continue;const _=R.x??0,P=R.y??0,N=dc(R);if(!N)continue;let L,I;if(k){const B=x<0;L={x:_,y:p.y},I={x:_,y:B?N.bottom:N.top}}else{const B=v>0;L={x:p.x,y:P},I={x:B?N.right:N.left,y:P}}if(Xs(L,I,s,E?[E]:[],-2)||Xs(L,I,a,[],-2))continue;if(A){const B=e.get(A),H=B?dc(B):void 0;if(H&&vJ(L,H,2))continue}const $=w((B,H)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${H.x.toFixed(3)},${H.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let B=0;B{for(const G of t){if(G===o||G.isLayoutOnly)continue;const W=G.points;if(!(!W||W.length<2))for(let K=0;K=0){const B=u[h-3],H=[A,E].filter(G=>!!G);if(Xs(B,L,s,H,-2)||D(B,L))continue}const z=[...u.slice(0,h-2),L,I];o.points=z;const V=o.labelNodeId;if(V){const B=e.get(V);if(B){const H=B.width??0,G=B.height??0;if(H>0&&G>0){let W,K,q=-1;for(let oe=0;oe=H+2||me&&re>=G+2)&&re>q&&(q=re,W=(Q.x+Z.x)/2,K=(Q.y+Z.y)/2)}W!==void 0&&K!==void 0&&(B.x=W,B.y=K)}}}}}w(s9e,"collapseShortTerminalStub");var mr=.001,Xa=8,yn=x5,iF=w((t,e)=>On(t,e,mr)||Bn(t,e,mr),"orthogonallyAligned");function a9e(t,e){const i=w((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,x=g.y-y;let b=(p.width??0)/2,T=(p.height??0)/2;return Math.abs(x)*b>Math.abs(v)*T?(x<0&&(T=-T),{x:m+(x===0?0:T*v/x),y:y+T}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*x/v)})},"rectIntersect"),s=w((p,g)=>{const m=Yn(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,x=v?dc(v):void 0;if(!v||!y||!x)return;const b=g?m[0]:m[m.length-1],T=g?m[1]:m[m.length-2],C=i(v,b);let S=b;if(iF(T,C)&&(S=T),On(C,S,mr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,S.y),max:Math.max(C.y,S.y),boundary:C,railEnd:S,rect:x};if(Bn(C,S,mr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,S.x),max:Math.max(C.x,S.x),boundary:C,railEnd:S,rect:x}},"terminalLaneFor"),a=w((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&On(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Bn(p.boundary,g.boundary,1),"sameTerminalFace"),l=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:a(p,g)>=Xa&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=w((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=a(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=w((p,g)=>{const m=Yn(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!w(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Bn(y,p.boundary,mr)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?On(y,p.boundary,mr)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&_u(m[1],p.railEnd,mr),k=m.slice(S?2:1),E=k[0];return E&&!iF(E,v)?void 0:[y,v,...k]}const b=m.length>1&&_u(m[m.length-2],p.railEnd,mr),T=m.slice(0,b?-2:-1),C=T[T.length-1];if(!(C&&!iF(C,v)))return[...T,v,y]},"shiftedCandidate"),d=w(p=>{const g=p.edge,m=Yn(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,x=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!x||!b)return!1;const T=x.x??0,C=x.y??0,S=b.x??0,k=b.y??0,[E,A]=m;return Bn(E,A,mr)&&Math.abs(C-k)<1&&Math.abs(T-S)>1||On(E,A,mr)&&Math.abs(T-S)<1&&Math.abs(C-k)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[s(y,!0),s(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const E=d(S),A=d(k);return E!==A?Number(E)-Number(A):+!k.atStart-+!S.atStart});for(const S of C){for(const k of f){const E=h(S,k);if(!E)continue;const A=s({...S.edge,points:E},S.atStart);if(!(!A||g.some(R=>R.edge!==S.edge&&(l(A,R)||T&&u(A,R))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}w(a9e,"separateSharedRenderedTerminalLanes");function o9e(t,e){const{realNodeRects:n,labelNodeRects:i}=Jg(e.values()),s=w((o,l)=>{const u=o.start,h=o.end,d=yn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Xs(p.a,p.b,n,f,-2)||Xs(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of yn(Yn(g)))if(kd(m,y,.5)>=Xa||W0(m.a,m.b,y.a,y.b,mr))return!1}}return!0},"candidateIsSafe"),a=w((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=Is(u,h)&&Ns(h,d)&&Is(d,f)&&Ns(f,p)&&On(u,f,mr)&&On(u,p,mr)&&On(h,d,mr)&&(h.x-u.x)*(f.x-d.x)<0,m=Ns(u,h)&&Is(h,d)&&Ns(d,f)&&Is(f,p)&&Bn(u,f,mr)&&Bn(u,p,mr)&&Bn(h,d,mr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Yn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ns(u,h)&&Is(h,d)&&Ns(d,f)&&Is(f,p)&&Ns(p,y)&&On(u,p,mr)&&On(u,y,mr)&&On(d,f,mr)&&(d.x-h.x)*(p.x-f.x)<0,x=Is(u,h)&&Ns(h,d)&&Is(d,f)&&Ns(f,p)&&Is(p,y)&&Bn(u,p,mr)&&Bn(u,y,mr)&&Bn(d,f,mr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!x))return Yn([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Yn(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=a(h,d);if(!(!f||!s(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}w(o9e,"collapseRedundantRectangularDoglegs");function uq(t,e){const{realNodeRects:s,labelNodeRects:a}=Jg(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=w((g,m,y)=>Yn(g===m?y??[]:g.points??[]),"pointsFor"),u=w((g,m)=>{let y=0;for(let v=0;v{const m=yn(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return s.filter(v=>{if(y.includes(v.id))return!1;const x=v.rect;return m.horizontal?Ml(m.a.x,m.b.x,x.left,x.right)>=Xa&&m.a.y>=x.top-2&&m.a.y<=x.bottom+2:Ml(m.a.y,m.b.y,x.top,x.bottom)>=Xa&&m.a.x>=x.left-2&&m.a.x<=x.right+2})},"blockingRectsFor"),f=w((g,m,y)=>{const v=g.map(b=>({...b}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const x=Nd(Yn(v));return yn(x).length===x.length-1?x:void 0},"candidateByMovingRail"),p=w((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),x=yn(m);if(x.length!==m.length-1)return!1;for(const b of x)if(Xs(b.a,b.b,s,v,-2)||Xs(b.a,b.b,a,[],-2))return!1;for(const b of o)if(b!==g){for(const T of x)for(const C of yn(l(b)))if(kd(T,C,.5)>=Xa)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const x=l(v),b=h(x);if(!b)continue;const T=d(v,b.segment);if(T.length===0)continue;const C=b.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of C){const k=f(x,b.segment,S);if(!(!k||!p(v,k,m))){v.points=k,y=!0;break}}if(y)break}if(!y)return}}w(uq,"liftObstacleHuggingSameSideRails");function hq(t,e){const n=w(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=w(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+mr||h>=u.bottom-mr?!1:Ml(l.a.x,l.b.x,u.left,u.right)>=Xa},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(i).filter(l=>!!l);if(a.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Yn(l.points??[]);for(const h of yn(u))for(const d of a)s(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=mr))for(const l of a){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}w(hq,"liftTopLaneTitleBandsAboveRails");function dq(t,e){const n=w(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=w(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+mr||d>=h.right-mr?!1:Ml(u.a.y,u.b.y,h.top,h.bottom)>=Xa},"verticalSegmentIntersectsTitle"),a=w((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+mr||d>=h.bottom-mr?!1:Ml(u.a.x,u.b.x,h.left,h.right)>=Xa},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Yn(u.points??[]);for(const d of yn(h))for(const f of o)if(s(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(a(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=mr))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}w(dq,"shiftLeftLaneTitleBandsLeftOfRails");function l9e(t,e){const{realNodeRects:n}=Jg(e.values()),i=t.filter(g=>!g.isLayoutOnly),s=w((g,m=new Map)=>Yn(m.get(g)??g.points??[]),"replacementPointsFor"),a=w((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+Mc(s(y,g)),0),"totalBends"),l=w(g=>{const m=s(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!Is(y,v,mr)&&!Ns(y,v,mr)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=w((g,m)=>{const y=s(g);if(y.length<3)return;const v=y[0],x=y[1];let b;if(Is(v,x,mr))b={x:x.x,y:m.tailStart.y};else if(Ns(v,x,mr))b={x:m.tailStart.x,y:x.y};else return;const T=Nd(Yn([v,x,b,m.tailStart,m.terminal]));return yn(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),h=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of yn(m))if(Xs(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=w((g,m,y)=>{for(const v of i)if(v!==g){for(const x of yn(m))for(const b of yn(s(v,y)))if(kd(x,b,.5)>=Xa)return!0}return!1},"pathHasSharedTrack"),f=w((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=w(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||s(m).length<4)continue;const x=g.get(y)??[];x.push(m),g.set(y,x)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=a();if(m===0)return;const y=o();let v,x=m,b=y;for(const T of p().values())for(let C=0;C=m||L>x||L===x&&I>=b||(v=N,x=L,b=I)}if(!v)return;for(const[T,C]of v)T.points=C}}w(l9e,"swapDestinationTerminalTailsToReduceCrossings");function c9e(t,e){const{realNodeRects:s,labelNodeRects:a}=Jg(e.values()),o=t.filter(T=>!T.isLayoutOnly),l=w((T,C=new Map)=>Yn(C.get(T)??T.points??[]),"replacementPointsFor"),u=w((T=new Map)=>{let C=0;for(let S=0;So.reduce((C,S)=>C+Mc(l(S,T)),0),"totalBends"),d=w(T=>{const C=T.start,S=T.end,k=C?e.get(C):void 0,E=S?e.get(S):void 0,A=k?dc(k):void 0,R=E?dc(E):void 0;return A&&R?{src:A,dst:R}:void 0},"endpointRectsFor"),f=w((T,C,S)=>{if(S.index<=0||S.index+1>=C.length-1)return;const k=d(T);if(k){if(S.vertical){const E=S.a.x,A=Math.min(k.src.left,k.dst.left),R=Math.max(k.src.right,k.dst.right),_=ER+mr?"right":void 0;return _?{edge:T,points:C,segmentIndex:S.index,axis:"vertical",side:_,coord:E,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const E=S.a.y,A=Math.min(k.src.top,k.dst.top),R=Math.max(k.src.bottom,k.dst.bottom),_=ER+mr?"bottom":void 0;return _?{edge:T,points:C,segmentIndex:S.index,axis:"horizontal",side:_,coord:E,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=w(()=>{const T=[];for(const C of o){const S=l(C);for(const k of yn(S)){const E=f(C,S,k);E&&T.push(E)}}return T},"collectExternalRails"),g=w((T,C)=>T.edge!==C.edge&&T.axis===C.axis&&T.side===C.side&&Ml(T.min,T.max,C.min,C.max)>=Xa,"railsInteract"),m=w(T=>{const C=[],S=new Set;for(const k of T){if(S.has(k))continue;const E=[k],A=[];for(S.add(k);E.length>0;){const R=E.pop();A.push(R);for(const _ of T)!S.has(_)&&g(R,_)&&(S.add(_),E.push(_))}A.length>1&&C.push(A)}return C},"connectedComponents"),y=w(T=>{const C=[];for(const S of T)C.some(k=>Math.abs(k-S.coord){const C=T.map(E=>E.coord),S=y(T),k=[];if(T.length<=6){const E=new Array(S.length).fill(!1),A=[],R=w(()=>{if(A.length===T.length){A.some((_,P)=>Math.abs(_-C[P])>=mr)&&k.push([...A]);return}for(const[_,P]of S.entries())E[_]||(E[_]=!0,A.push(P),R(),A.pop(),E[_]=!1)},"visit");return R(),k}for(let E=0;E{const S=new Map;for(const[E,A]of T.entries()){const R=C[E],_=S.get(A.edge)??A.points.map(P=>({x:P.x,y:P.y}));A.axis==="vertical"?(_[A.segmentIndex].x=R,_[A.segmentIndex+1].x=R):(_[A.segmentIndex].y=R,_[A.segmentIndex+1].y=R),S.set(A.edge,_)}const k=new Map;for(const[E,A]of S){const R=Nd(Yn(A));if(yn(R).length!==R.length-1)return;k.set(E,R)}return k},"replacementsForAssignment"),b=w(T=>{for(const[C,S]of T){const k=[C.start,C.end].filter(E=>!!E);for(const E of yn(S))if(Xs(E.a,E.b,s,k,-2)||Xs(E.a,E.b,a,[],-2))return!1}for(let C=0;C=Xa)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const C=u();if(C===0)return;let S,k=C,E=h(),A=Number.POSITIVE_INFINITY;for(const R of m(p()))for(const _ of v(R)){const P=x(R,_);if(!P||!b(P))continue;const N=u(P);if(N>=C)continue;const L=h(P),I=R.reduce(($,O,D)=>$+Math.abs(_[D]-O.coord),0);N>k||N===k&&(L>E||L===E&&I>=A)||(S=P,k=N,E=L,A=I)}if(!S)return;for(const[R,_]of S)R.points=_}}w(c9e,"reassignCrossingExternalRailChannels");function u9e(t,e){const{realNodeRects:n,labelNodeRects:i}=Jg(e.values()),s=t.filter(p=>!p.isLayoutOnly),a=w((p,g,m)=>Yn(p===g?m??[]:p.points??[]),"pointsFor"),o=w(p=>yn(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=w((p,g)=>{let m=0;for(let y=0;y{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&Ml(p.a.x,p.b.x,g.left,g.right)>=Xa}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Ml(p.a.y,p.b.y,g.top,g.bottom)>=Xa}return!1},"segmentRunsAlongRectBorder"),h=w(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),x=v?dc(v):void 0;x&&m.push(x)}return m},"endpointRectsFor"),d=w((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],x=p[g+3],b=Is(m,y,mr)&&Ns(y,v,mr)&&Is(v,x,mr),T=Ns(m,y,mr)&&Is(y,v,mr)&&Ns(v,x,mr);if(!b&&!T)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(x.x-v.x):Math.sign(y.y-m.y)!==Math.sign(x.y-v.y)))return[];const S=On(m,x,mr)||Bn(m,x,mr)?[]:[{x:m.x,y:x.y},{x:x.x,y:m.y}],k=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(A=>[...p.slice(0,g+1),A,...p.slice(g+3)]),E=new Set;return k.map(A=>Nd(Yn(A))).filter(A=>{if(yn(A).length!==A.length-1||!A.some(_=>_u(_,x,mr)))return!1;const R=A.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return E.has(R)?!1:(E.add(R),!0)})},"shortcutCandidatesAt"),f=w((p,g,m)=>{const y=[p.start,p.end].filter(x=>!!x),v=h(p);for(const x of yn(g))if(Xs(x.a,x.b,n,y,-2)||Xs(x.a,x.b,i,[],-2)||v.some(b=>u(x,b)))return!1;for(const x of s)if(x!==p){for(const b of yn(g))for(const T of yn(a(x)))if(kd(b,T,.5)>=Xa)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const T of s){const C=a(T),S=Mc(C,mr),k=o(C);for(let E=0;E<=C.length-4;E++)for(const A of d(C,E)){const R=Mc(A,mr),_=o(A);if(!(Rv||N===v&&(R>x||R===x&&_>=b)||(m=T,y=A,v=N,x=R,b=_)}}if(!m||!y)return;m.points=y}}w(u9e,"shortcutRedundantOrthogonalJogs");function h9e(t,e){const a=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const he=ce.x??0,Te=ce.y??0,ge=dc(ce);ge&&a.push({id:String(ce.id??""),cx:he,cy:Te,rect:ge})}if(a.length===0)return;const o=new Map(a.map(ce=>[ce.id,ce])),l=a.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...a.map(ce=>ce.rect.top))-20,bottom:Math.max(...a.map(ce=>ce.rect.bottom))+20,left:Math.min(...a.map(ce=>ce.rect.left))-20,right:Math.max(...a.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,he)=>[ce,he])),p=w(ce=>{const he=ce==="left"||ce==="top"?-1:1,Te=[];for(let ge=0;ge<=2;ge++)Te.push(h[ce]+he*20*ge);return Te},"outwardTracksForSide"),g=w((ce,he=new Map)=>Yn(he.get(ce)??ce.points??[]),"replacementPointsFor"),m=w((ce,he)=>{let Te=0;for(const ge of ce)for(const He of he)W0(ge.a,ge.b,He.a,He.b,mr)&&Te++;return Te},"crossingCountBetweenSegments"),y=w((ce,he)=>m(yn(ce),yn(he)),"crossingCountBetweenPaths"),v=w((ce=new Map)=>{let he=0;const Te=[],ge=new Set,He=[],we=w(Me=>{ge.has(Me)||(ge.add(Me),He.push(Me))},"addEdge");for(let Me=0;Me0&&(he+=ne,Te.push({first:je,second:Ce,count:ne}),we(je),we(Ce))}}return He.sort((Me,je)=>(f.get(Me)??0)-(f.get(je)??0)),{count:he,pairs:Te,edgeSet:ge,edges:He}},"crossingSnapshot"),x=w((ce,he)=>{const Te=new Set(he.keys());if(Te.size===0)return ce.count;let ge=0;for(const we of ce.pairs)(Te.has(we.first)||Te.has(we.second))&&(ge+=we.count);let He=0;for(let we=0;we{const he=new Map;for(const He of ce.pairs){const we=he.get(He.first)??new Set;we.add(He.second),he.set(He.first,we);const Me=he.get(He.second)??new Set;Me.add(He.first),he.set(He.second,Me)}const Te=[],ge=new Set;for(const He of ce.edges){if(ge.has(He))continue;const we=[He],Me=[];for(ge.add(He);we.length>0;){const je=we.pop();Me.push(je);for(const le of he.get(je)??[])ge.has(le)||(ge.add(le),we.push(le))}Me.sort((je,le)=>(f.get(je)??0)-(f.get(le)??0)),Me.length>1&&Te.push(Me)}return Te},"crossingComponents"),T=w(ce=>[ce.start,ce.end].filter(he=>!!he),"endpointIdsFor"),C=w(ce=>{const he=[];for(const Te of b(ce)){const ge=new Set(Te),He=new Set(Te.flatMap(Me=>T(Me))),we=[...Te];for(const Me of d)ge.has(Me)||T(Me).some(je=>He.has(je))&&we.push(Me);we.sort((Me,je)=>(f.get(Me)??0)-(f.get(je)??0)),he.push(we)}return he},"pairSearchGroups"),S=w((ce,he,Te)=>x(ce,new Map([[he,Te]])),"crossingCountWithSingleReplacement"),k=w(ce=>{const he=new Map;for(const Te of ce.pairs)he.set(Te.first,(he.get(Te.first)??0)+Te.count),he.set(Te.second,(he.get(Te.second)??0)+Te.count);return he},"currentCrossingsByEdge"),E=w(ce=>ce.slice(1).reduce((he,Te,ge)=>{const He=ce[ge];return he+Math.abs(Te.x-He.x)+Math.abs(Te.y-He.y)},0),"pathLength"),A=w((ce=new Map)=>d.reduce((he,Te)=>he+Mc(g(Te,ce)),0),"totalBends"),R=w((ce=new Map)=>d.reduce((he,Te)=>he+E(g(Te,ce)),0),"totalLength"),_=w((ce,he,Te=new Map)=>{const ge=yn(he);for(const He of d)if(He!==ce){for(const we of ge)for(const Me of yn(g(He,Te)))if(kd(we,Me,.5)>=Xa)return!0}return!1},"pathHasSegmentConflict"),P=w((ce,he)=>{const Te=[ce.start,ce.end].filter(ge=>!!ge);for(const ge of yn(he))if(Xs(ge.a,ge.b,l,Te,-2))return!0;return!1},"pathHitsNode"),N=w((ce,he)=>{const Te=Nd(Yn(he));yn(Te).length===Te.length-1&&ce.push(Te)},"pushOrthogonalCandidate"),L=w(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=w((ce,he,Te)=>{switch(he){case"left":return Math.min(ce.x,Te.x)-20;case"right":return Math.max(ce.x,Te.x)+20;case"top":return Math.min(ce.y,Te.y)-20;case"bottom":return Math.max(ce.y,Te.y)+20}},"localTrackForSameSide"),$=w((ce,he,Te,ge)=>{const He=Te==="left"||Te==="top"?-1:1,we=[I(he,Te,ge),h[Te]];for(const Me of we)for(let je=0;je<=2;je++)N(ce,xJ(he,Te,ge,Me+He*20*je))},"addSameSideCandidates"),O=w((ce,he,Te,ge,He)=>{for(const we of p(Te))for(const Me of p(He))N(ce,[he,{x:we,y:he.y},{x:we,y:Me},{x:ge.x,y:Me},ge])},"addHorizontalToVerticalCandidates"),D=w((ce,he,Te,ge,He)=>{for(const we of p(Te))for(const Me of p(He))N(ce,[he,{x:he.x,y:we},{x:Me,y:we},{x:Me,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=w((ce,he,Te,ge,He)=>{const we=[...p("top"),...p("bottom")];for(const Me of p(Te))for(const je of p(He))for(const le of we)N(ce,[he,{x:Me,y:he.y},{x:Me,y:le},{x:je,y:le},{x:je,y:ge.y},ge])},"addHorizontalPairCandidates"),z=w((ce,he,Te,ge,He)=>{const we=[...p("left"),...p("right")];for(const Me of p(Te))for(const je of p(He))for(const le of we)N(ce,[he,{x:he.x,y:Me},{x:le,y:Me},{x:le,y:je},{x:ge.x,y:je},ge])},"addVerticalPairCandidates"),V=w(ce=>{const he=new Set;return ce.map(Te=>Yn(Te)).filter(Te=>{const ge=Te.map(He=>`${He.x.toFixed(3)},${He.y.toFixed(3)}`).join("|");return he.has(ge)||Te.length<2?!1:(he.add(ge),!0)})},"dedupeCandidatePaths"),B=w((ce,he,Te,ge)=>{const He=[],we=bJ(ce,he,Te,ge,20,mr);we&&N(He,we),he===ge&&$(He,ce,he,Te);const Me=L(he),je=L(ge);return Me&&!je?O(He,ce,he,Te,ge):!Me&&je?D(He,ce,he,Te,ge):Me?F(He,ce,he,Te,ge):z(He,ce,he,Te,ge),V(He)},"buildCandidatesForSides"),H=w((ce,he,Te,ge)=>{const He=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Me of u){const je=$1(ge,Me),le=Me==="top"||Me==="bottom"?p(Me):we;for(const pe of He){N(ce,[he,Te,{x:pe,y:Te.y},{x:pe,y:je.y},je]);for(const Ce of le)N(ce,[he,Te,{x:pe,y:Te.y},{x:pe,y:Ce},{x:je.x,y:Ce},je])}}},"addVerticalDepartureOuterTrackCandidates"),G=w((ce,he,Te,ge)=>{const He=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Me of u){const je=$1(ge,Me),le=Me==="left"||Me==="right"?p(Me):He;for(const pe of we){N(ce,[he,Te,{x:Te.x,y:pe},{x:je.x,y:pe},je]);for(const Ce of le)N(ce,[he,Te,{x:Te.x,y:pe},{x:Ce,y:pe},{x:Ce,y:je.y},je])}}},"addHorizontalDepartureOuterTrackCandidates"),W=w(ce=>{const he=ce.start,Te=ce.end,ge=Te?o.get(Te):void 0;if(!he||!ge)return[];const He=Yn(ce.points??[]);if(He.length<4)return[];const we=He[0],Me=He[1],je=[];return Ns(we,Me,mr)?H(je,we,Me,ge):Is(we,Me,mr)&&G(je,we,Me,ge),je},"terminalPreservingOuterTrackCandidates"),K=w(ce=>{const he=ce.start,Te=ce.end,ge=he?o.get(he):void 0,He=Te?o.get(Te):void 0;if(!ge||!He)return[];const we=[];for(const Me of u){const je=$1(ge,Me);for(const le of u)we.push(...B(je,Me,$1(He,le),le))}return we.push(...W(ce)),we},"candidatePathsFor"),q=w(()=>new Map(d.map(ce=>[ce,yn(g(ce))])),"currentSegmentsByEdge"),oe=w((ce,he,Te)=>{const ge=new Set;for(const He of d){if(He===ce)continue;const we=Te.get(He)??yn(g(He));he.some(Me=>we.some(je=>kd(Me,je,.5)>=Xa))&&ge.add(He)}return ge},"sharedTrackConflictsFor"),Q=w((ce,he,Te,ge)=>{const He=new Set;return K(ce).map(Me=>Nd(Yn(Me))).filter(Me=>{if(P(ce,Me))return!1;const je=Me.map(le=>`${le.x.toFixed(3)},${le.y.toFixed(3)}`).join("|");return He.has(je)||Me.length<2?!1:(He.add(je),!0)}).map(Me=>{const je=yn(Me);let le=0;for(const pe of d)pe!==ce&&(le+=m(je,Te.get(pe)??yn(g(pe))));return{candidate:Me,candidateSegments:je,crossings:he.count-(ge.get(ce)??0)+le,bends:Mc(Me,mr),totalBends:Mc(Me),length:E(Me)}}).filter(({crossings:Me})=>Me<=he.count).sort((Me,je)=>Me.crossings-je.crossings||Me.bends-je.bends||Me.length-je.length).slice(0,48).map(Me=>({path:Me.candidate,segments:Me.candidateSegments,sharedTrackConflicts:oe(ce,Me.candidateSegments,Te),totalBends:Me.totalBends,length:Me.length}))},"pairCandidatesFor"),Z=w((ce,he,Te,ge,He,we)=>{let Me=0;for(const le of ce.pairs)(le.first===he||le.second===he||le.first===ge||le.second===ge)&&(Me+=le.count);let je=m(Te.segments,He.segments);for(const le of d){if(le===he||le===ge)continue;const pe=we.get(le)??yn(g(le));je+=m(Te.segments,pe)+m(He.segments,pe)}return ce.count-Me+je},"pairCrossingCount"),re=w((ce,he)=>{for(const Te of ce.sharedTrackConflicts)if(Te!==he)return!1;return!0},"conflictsOnlyWith"),ie=w((ce,he)=>ce.segments.some(Te=>he.segments.some(ge=>kd(Te,ge,.5)>=Xa)),"candidatesShareTrack"),me=w((ce,he,Te,ge)=>re(he,Te.edge)&&re(ge,ce.edge)&&!ie(he,ge),"pairCandidatesAreCompatible"),te=w((ce,he,Te,ge,He)=>{const we=Z(ce.current,he.edge,Te,ge.edge,He,ce.baseSegments);if(!(we>=ce.current.count))return{replacements:new Map([[he.edge,Te.path],[ge.edge,He.path]]),crossings:we,bends:ce.currentBends-(ce.baseBendsByEdge.get(he.edge)??0)-(ce.baseBendsByEdge.get(ge.edge)??0)+Te.totalBends+He.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(he.edge)??0)-(ce.baseLengthByEdge.get(ge.edge)??0)+Te.length+He.length}},"scorePairReplacement"),_e=w((ce,he)=>ce.crossings{let He=ge;for(const we of he.candidates)for(const Me of Te.candidates){if(!me(he,we,Te,Me))continue;const je=te(ce,he,we,Te,Me);je&&_e(je,He)&&(He=je)}return He},"bestScoreForOptionPair"),Fe=w(ce=>{const he=A(),Te=R(),ge=q(),He=k(ce),we=new Map(d.map(ne=>[ne,Mc(g(ne))])),Me=new Map(d.map(ne=>[ne,E(g(ne))])),je=new Map,le=C(ce);for(const ne of le)for(const j of ne){if(je.has(j))continue;const J=Q(j,ce,ge,He);J.length>0&&je.set(j,{edge:j,candidates:J})}let pe={replacements:new Map,crossings:ce.count,bends:he,length:Te};const Ce={current:ce,currentBends:he,currentLength:Te,baseBendsByEdge:we,baseLengthByEdge:Me,baseSegments:ge};for(const ne of le){const j=new Set(ne.filter(ue=>ce.edgeSet.has(ue))),J=ne.map(ue=>je.get(ue)).filter(ue=>!!ue);for(let ue=0;ue0?pe.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const he=v(),Te=he.count;if(Te===0)return;let ge,He,we=Te,Me=Number.POSITIVE_INFINITY;for(const le of he.edges){const pe=Mc(g(le),mr);for(const Ce of K(le)){const ne=P(le,Ce),j=!ne&&_(le,Ce),J=S(he,le,Ce),ue=Mc(Ce,mr);ne||j||!(Jwe||J===we&&ue>=Me||(ge=le,He=Ce,we=J,Me=ue)}}if(ge&&He){ge.points=He;continue}const je=Fe(he);if(!je)return;for(const[le,pe]of je)le.points=pe}}w(h9e,"resolveRenderedOrthogonalCrossings");var hp=.001,kHt=8;function d9e(t,e){const{nodeInfoById:r,realNodeRects:n}=WD(e),i=["top","bottom","left","right"],s=20,a={top:Math.min(...n.map(m=>m.rect.top))-s,bottom:Math.max(...n.map(m=>m.rect.bottom))+s,left:Math.min(...n.map(m=>m.rect.left))-s,right:Math.max(...n.map(m=>m.rect.right))+s},o=w((m,y,v,x)=>{const b=[],T=bJ(m,y,v,x,s,hp);return T&&b.push(T),y===x&&b.push(xJ(m,y,v,a[y])),b},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let x=0;const b=x5(m,hp),T=y.start,C=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const k=S.start,E=S.end;if(!v&&T&&C&&(k===T||k===C||E===T||E===C))continue;const A=S.points;if(!(!A||A.length<2))for(const R of b)for(const _ of x5(A,hp)){if(TJ(R.a,R.b,_.a,_.b,hp,hp)){x++;continue}kd(R,_,hp)>=kHt&&x++}}return x},"pathConflictCount"),h=4,d=w((m,y)=>{const v=Math.abs(m.y-y.rect.top),x=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),T=Math.abs(m.x-y.rect.right);let C="top",S=v;return x{const x=f.get(m)??[];x.push({side:y,edgeId:v}),f.set(m,x)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",x=m.start,b=m.end;if(x){const T=r.get(x);T&&p(x,d(y[0],T),v)}if(b){const T=r.get(b);T&&p(b,d(y[y.length-1],T),v)}}const g=w((m,y,v)=>{var x;return((x=f.get(m))==null?void 0:x.some(b=>b.edgeId!==v&&b.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=Mc(y,hp);if(v0){const D=u($,m,!0);if(D>R||D===R&&O>=_)continue;R=D,_=O,A=$;continue}u($,m)>E||O<_&&(_=O,A=$)}}}if(A){m.points=A;const P=f.get(x);P&&f.set(x,P.filter(L=>L.edgeId!==S));const N=f.get(b);N&&f.set(b,N.filter(L=>L.edgeId!==S)),p(x,d(A[0],T),S),p(b,d(A[A.length-1],C),S)}}}w(d9e,"simplifyDetouredEdges");var Xl=.001,pfe=10,T8=7;function fq(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],s=t[r+n];if(!i||!s)return;const a=s.x-i.x,o=s.y-i.y;if(!(Math.abs(a)+Math.abs(o)s&&vL(t,f9e(s)))}w(pq,"labelOverlapsOwnMarker");function UM(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y{const y=ZW(m,s);for(const{nodeId:v,rect:x}of n)if(v!==g&&vL(y,x))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=ZW(m,s);for(const v of r)if(v.edgeId!==g&&GD(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=w((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=w(g=>{for(const{id:m,rect:y}of i)if(VRe(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&vL(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const x=y.width??0,b=y.height??0;if(x<=0||b<=0)continue;const T=[];for(let V=0;V=Xl&&W>=Xl||T.push({idx:V,length:G+W,orientation:G>=Xl?"horizontal":"vertical",midX:(B.x+H.x)/2,midY:(B.y+H.y)/2})}if(T.length===0)continue;const C=T.length>=3?T.filter(V=>V.idx>0&&V.idx0?C:T,k=x>=b?"horizontal":"vertical",E=w(V=>[...V].sort((B,H)=>{const G=B.orientation===k,W=H.orientation===k;if(G!==W)return G?-1:1;const K=B.length>=(B.orientation==="horizontal"?x:b)+2,q=H.length>=(H.orientation==="horizontal"?x:b)+2;return K!==q?K?-1:1:H.length-B.length}),"rankSegments"),A=T[0],R=T[T.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=w((V,B)=>{const H=v[V.idx],G=v[V.idx+1];return{midX:H.x+(G.x-H.x)*B,midY:H.y+(G.y-H.y)*B}},"anchorAtT"),N=w((V,B,H)=>Math.min(H,Math.max(B,V)),"clamp"),L=w((V,B)=>V.midX>=B.left-Xl&&V.midX<=B.right+Xl&&V.midY>=B.top-Xl&&V.midY<=B.bottom+Xl,"pointInsideRectInclusive"),I=w(V=>{const B=Ob(V.midX,V.midY,x,b),H=f(B);if(H)return{laneId:H,anchor:V,rect:B};const G=i.find(({rect:re})=>L(V,re));if(!G)return;const W=G.rect.left+x/2+a,K=G.rect.right-x/2-a,q=G.rect.top+b/2+a,oe=G.rect.bottom-b/2-a;if(W>K||q>oe)return;const Q={midX:N(V.midX,W,K),midY:N(V.midY,q,oe)},Z=Ob(Q.midX,Q.midY,x,b);return L(V,Z)?{laneId:G.id,anchor:Q,rect:Z}:void 0},"placementForAnchor"),$=w((V,B,H)=>V.orientation==="horizontal"?Math.abs(B.midX-H.x):Math.abs(B.midY-H.y),"distanceAlongSegment"),O=w((V,B)=>{const G=(V.orientation==="horizontal"?x/2:b/2)+o;if(V===A){const W=v[V.idx];if($(V,B,W)+Xl{const B=E(V);for(const H of B)for(const G of _){const W=P(H,G);if(!O(H,W))continue;const K=I(W);if(K&&!pq(K.rect,v)&&!p(m,K.rect)&&!h(m,g.id,K.rect))return{laneId:K.laneId,anchor:K.anchor}}},"tryPool"),F=w((V,B,H=!1)=>{const G=E(V);for(const W of G){const K={midX:W.midX,midY:W.midY};if(B&&!O(W,K))continue;const q=I(K);if(q&&!pq(q.rect,v)&&!p(m,q.rect)&&!l(m,q.rect)&&(H||!u(g.id,q.rect)))return{laneId:q.laneId,anchor:q.anchor}}},"findLaneContainingFallback"),z=D(S)??(S.lengthH.labelId===m);B>=0?d[B]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}w(UM,"anchorLabelsToPolyline");var sF=1e-6,SHt=8,gfe=SHt/2,EHt=3;function gq(t,e){return t{const h=gq(o,l);let d=0;const f=w(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(a.labelNodeId);for(const p of t){if(p===a||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||gq(g,m)===h&&f(p.labelNodeId)}return d>0?d+EHt:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const o=a.points;if(!yJ(o,sF))continue;const l=wJ(a,r,sF);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Xs(m,y,n,[u,h],1))continue;const x=s(a,u,h,p?"x":"y"),b=x>gfe?x:gfe,T=[0,b,-b];for(const C of T){const S={...m},k={...y};if(p){if(S.x+=C,k.x+=C,S.x<=d.rect.left||S.x>=d.rect.right||k.x<=f.rect.left||k.x>=f.rect.right)continue}else if(S.y+=C,k.y+=C,S.y<=d.rect.top||S.y>=d.rect.bottom||k.y<=f.rect.top||k.y>=f.rect.bottom)continue;if(!Xs(S,k,n,[u,h],1)&&!bL(S,k,t,a,{epsilon:sF})){a.points=[S,k];break}}}}w(p9e,"straightenCollinearSiblingDetours");function mq(t,e){const{realNodeRects:l,labelNodeRects:u}=Jg(e.values()),h=w((C,S)=>x5(S,.001).map(k=>({...k,edge:C,interior:k.index>=1&&k.index<=S.length-3})),"segmentsFor"),d=w(()=>{const C=[];for(const S of t){if(S.isLayoutOnly)continue;const k=S.points;!k||k.length<2||C.push(...h(S,Yn(k)))}return C},"allSegments"),f=w((C,S)=>C.horizontal&&S.horizontal?Ml(C.a.x,C.b.x,S.a.x,S.b.x)>=8&&Math.abs(C.a.y-S.a.y)<7:C.vertical&&S.vertical?Ml(C.a.y,C.b.y,S.a.y,S.b.y)>=8&&Math.abs(C.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=w((C,S)=>{const k=C.start,E=C.end,A=h(C,S);if(A.length!==S.length-1)return!1;const R=[k,E].filter(P=>!!P),_=C.labelNodeId?[C.labelNodeId]:[];for(const P of A)if(Xs(P.a,P.b,l,R,-2)||Xs(P.a,P.b,u,_,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const N=P.points;if(!(!N||N.length<2)){for(const L of A)for(const I of h(P,Yn(N)))if(f(L,I)||W0(L.a,L.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=w((C,S)=>{const k=Yn(C.edge.points??[]);if(k.length<4||C.index>=k.length-1)return;const E=k.map(A=>({...A}));if(C.horizontal)E[C.index].y+=S,E[C.index+1].y+=S;else if(C.vertical)E[C.index].x+=S,E[C.index+1].x+=S;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=w((C,S)=>({x:C.x??(S.left+S.right)/2,y:C.y??(S.top+S.bottom)/2}),"nodeCenter"),y=w(C=>{const S=C.edge,k=Yn(S.points??[]);if(k.length!==4||C.index!==1)return;const E=S.start?e.get(S.start):void 0,A=S.end?e.get(S.end):void 0,R=E?dc(E):void 0,_=A?dc(A):void 0,P=k.slice(C.index+2);if(!(!E||!A||!R||!_||P.length===0))return{sourceCenter:m(E,R),targetCenter:m(A,_),sourceRect:R,tail:P}},"sourceDetourContextFor"),v=w((C,S,k,E,A,R)=>{const _=E.y>=k.y,P=_?A.bottom:A.top,N=P+(_?20:-20);if(_&&C.b.y<=N+.001||!_&&C.b.y>=N-.001)return;const L=C.a.x+S;return Yn([{x:k.x,y:P},{x:k.x,y:N},{x:L,y:N},{x:L,y:C.b.y},...R],.001)},"verticalSourceDetour"),x=w((C,S,k,E,A,R)=>{const _=E.x>=k.x,P=_?A.right:A.left,N=P+(_?20:-20);if(_&&C.b.x<=N+.001||!_&&C.b.x>=N-.001)return;const L=C.a.y+S;return Yn([{x:P,y:k.y},{x:N,y:k.y},{x:N,y:L},{x:C.b.x,y:L},...R],.001)},"horizontalSourceDetour"),b=w((C,S)=>{const k=y(C);if(k){if(C.vertical)return v(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail);if(C.horizontal)return x(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const S=d();let k=!1;for(let E=0;EN.interior);for(const N of P){for(const L of T){const I=g(N,L);if(I&&p(N.edge,I)){N.edge.points=I,k=!0;break}const $=b(N,L);if($&&p(N.edge,$)){N.edge.points=$,k=!0;break}}if(k)break}}if(!k)return}}w(mq,"nudgeSharedInteriorSubpaths");function g9e(t,e,r,n){const i=e.x-t.x,s=e.y-t.y,a=n.x-r.x,o=n.y-r.y,l=i*o-s*a;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*a)/l,f=(u*s-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}w(g9e,"segmentsIntersect");function m9e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=HRe(e),s=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;de.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)de.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}w(m9e,"validateSwimlanesLayout");function y9e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!n9e(t,e)||e==="BT"&&i.length>0&&!r9e(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Nd(xL(l)))}d9e(n,r),p9e(n,r),i9e(n,r);const s=new Map;for(const o of r)s.set(String(o.id),o);UM(n,s),YRe(n,s),s9e(n,s),mq(n,s),a9e(n,s),o9e(n,s),uq(n,s),l9e(n,s);const a=w(()=>{h9e(n,s),c9e(n,s),u9e(n,s),UM(n,s),lq(n,s),uq(n,s),UM(n,s),lq(n,s)},"finalizeRenderedEdges");a(),mq(n,s),a(),hq(n,s),dq(n,s),hq(n,s),dq(n,s)}w(y9e,"postProcessSwimlaneLayout");function em(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const s of t.edges){if(!e.has(s.src)||!e.has(s.dst))continue;const a=`${s.id}:${s.src}->${s.dst}`;r.has(a)||(r.add(a),n.push(s))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}w(em,"normalizeGraph");function AJ(t,e){return t.edges.filter(r=>r.dst===e)}w(AJ,"incoming");function v9e(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}w(v9e,"buildSuccessorMap");function MJ(t){const e=v9e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(MJ,"buildSortedSuccessorMap");function RJ(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}w(RJ,"buildInDegreeMap");function _J(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(_J,"sortedZeroInDegreeNodes");function qD(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}w(qD,"buildPredecessorSuccessorMaps");function LJ(t,e,r,n){var a,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((a=t.nodeById.get(l))!=null&&a.isGroup)||(i=Math.max(i,r[l]??0));const s=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||s[Math.max(0,r[l]??0)].push(l);return s}w(LJ,"buildLayersFromRanks");function d7(t){const e=RJ(t),r=_J(e),n=[],i=MJ(t);for(;r.length;){const s=r.shift();n.push(s);for(const a of i.get(s)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const s=n+i>>1;let a=r(n,s)+r(s,i),o=n,l=s,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],s=w(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?s(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),a=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of a)n[h]===0&&s(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}w(b9e,"removeCycles_DFS");function x9e(t){const e=new Map,r=w(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const s=i.parentId;if(!s)return e.set(n,null),null;const o=r(s)??s;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}w(x9e,"buildTopLaneMap");function q0(t){const e=x9e(t);return r=>e.get(r)??null}w(q0,"createTopLaneResolver");function UD(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(UD,"buildTopLaneOrder");function NJ(t,e){const r=UD(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,s=[];for(const a of e)!n.has(a)||i.has(a)||(i.add(a),s.push(a));for(const a of r)i.has(a)||s.push(a);return s}w(NJ,"resolveTopLaneOrder");var AHt={EPSILON:1e-6},SL={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},mfe={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function w9e(t,e){const r=em(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:s}=qD(r);for(const C of s.values())C.sort((S,k)=>S.localeCompare(k));const a=d7(r)??[...r.nodes].sort((C,S)=>C.localeCompare(S)),o=new Map;for(const[C,S]of a.entries())o.set(S,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of a){const S=(s.get(C)??[]).filter(k=>l.has(k));if(S.length>0){const k=T9e(C,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,k),u.get(k).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,S)=>{const k=o.get(C)??0,E=o.get(S)??0;return k===E?C.localeCompare(S):k-E}),f=C9e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=k9e(p),m=S9e(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const S of C.nodes){const k=y.get(S);k?k.push(C.id):y.set(S,[C.id])}const v=[],x=[],b=new Set,T=w(C=>{if(!b.has(C)){b.add(C),v.push(C);for(const S of u.get(C)??[])T(S);x.push(C)}},"walk");for(const C of d)T(C);for(const C of a)T(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:x,topologicalOrder:a}}w(w9e,"buildDrivingTree");function T9e(t,e,r){const n=r.laneOf(t);return[...e].sort((s,a)=>{var m,y;const o=r.laneOf(s),l=r.laneOf(a),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[s],f=(y=r.rankHint)==null?void 0:y[a];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(s)??0,g=r.topoIndex.get(a)??0;return p!==g?p-g:s.localeCompare(a)})[0]}w(T9e,"chooseParent");function C9e(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}w(C9e,"buildAdjacency");function k9e(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const s=i.pop();if(!e.has(s)){e.set(s,r);for(const a of t.get(s)??[])e.has(a)||i.push(a)}}r++}return e}w(k9e,"assignComponents");function S9e(t){const e=new Map,r=new Map,n=[],i=[];let s=0;const a=w((o,l)=>{e.set(o,++s),r.set(o,s);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??s,e.get(u)??s))):(n.push([o,u]),a(u,o),r.set(o,Math.min(r.get(o)??s,r.get(u)??s)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(E9e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||a(o,null);return i}w(S9e,"computeBlocks");function E9e(t,e,r,n){const i=[],s=new Set;for(;r.length>0;){const a=r.pop();if(i.push(a),s.add(a[0]),s.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:n,edges:i,nodes:[...s]}}w(E9e,"popBlock");function A9e(t,e,r){const n=[...t.nodes],i=new Map;for(const[x,b]of n.entries())i.set(b,x);const s=n.length,a=new Array(s).fill(-1),o=new Array(s).fill(0),l=[],u=new Set;for(const x of n){const b=r.parent.get(x)??null,T=i.get(x);T!=null&&b==null&&(a[T]=-1,o[T]=0,u.has(x)||(u.add(x),l.push(x)))}for(;l.length>0;){const x=l.shift(),b=i.get(x);if(b==null)continue;const T=r.children.get(x)??[];for(const C of T){if(u.has(C))continue;const S=i.get(C);S!=null&&(a[S]=b,o[S]=o[b]+1,u.add(C),l.push(C))}}for(const x of n){if(u.has(x))continue;const b=i.get(x);b!=null&&(a[b]=-1,o[b]=0,u.add(x))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,s)))+1),d=Array.from({length:h},()=>new Array(s).fill(-1));for(let x=0;x{if(x===-1||b===-1)return-1;o[x]>C&1&&(x=d[C][x],x===-1))return-1;if(x===b)return x;for(let C=h-1;C>=0;C--){const S=d[C][x],k=d[C][b];S===-1||k===-1||S!==k&&(x=S,b=k)}return d[0][x]},"lcaIndex"),p=Array.from({length:s},()=>new Map);for(const x of t.edges){let b=x.src,T=x.dst,C=e[b],S=e[T];if(C==null||S==null||(C>S&&([b,T]=[T,b],[C,S]=[S,C]),C==null||S==null||C===S))continue;const k=i.get(b),E=i.get(T);if(k==null||E==null)continue;const A=f(k,E);if(A===-1)continue;const R=p[A];for(let _=C;_{if(b.size!==0)for(const[T,C]of b)x.set(T,(x.get(T)??0)+C)},"mergeInto"),y=new Set,v=w(x=>{const b=i.get(x);y.add(x);const T=b==null?void 0:p[b],C=T?new Map(T):new Map,S=r.children.get(x)??[];for(const k of S){const E=v(k),A=e[x];if(A!=null){let R=g.get(x);R||(R=new Map,g.set(x,R));let _=E.get(A)??0;const P=e[k];P!=null&&P>A&&(_+=1),R.set(k,_)}m(C,E)}return C},"dfs");for(const x of r.roots)y.has(x)||v(x);for(const x of n)y.has(x)||v(x);return g}w(A9e,"computeSubtreeCrossCounts");function M9e(t,e,r){const n=new Map,i=w(s=>{let a=r[s]??0;const o=[...e.get(s)??[]];o.sort(DJ(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(a=Math.min(a,u))}n.set(s,a)},"annotate");for(const s of t)i(s);return n}w(M9e,"annotateMinimumLayers");function DJ(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(DJ,"compareByRankThenId");function R9e(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const s=Array.from({length:i+1},()=>[]),a=new Set,o=w(l=>{if(a.has(l))return;a.add(l);const u=r[l]??0;s[u]||(s[u]=[]),s[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!a.has(l)){const u=r[l]??0;s[u]||(s[u]=[]),s[u].push(l),a.add(l)}return s}w(R9e,"emitNodesInTreeOrder");function _9e(t){const e=[];for(const r of t){const n=new Set,i=[];for(const s of r)n.has(s)||(n.add(s),i.push(s));e.push(i)}return e}w(_9e,"deduplicateLayers");function L9e(t,e,r,n){return i=>{const s=t.get(i)??[];if(s.length===0)return[];const a=e[i]??0,o=[],l=[],u=r.get(i);for(const h of s){const d=n.get(h)??a;d>a?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??a,m=n.get(d)??a;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}w(L9e,"createChildOrderer");function EL(t,e,r){const n=w9e(t,{rankHint:e,laneOf:r}),{children:i,roots:s}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const a=A9e(t,e,n),o=[...s].sort(DJ(e)),l=M9e(o,i,e),u=L9e(i,e,a,l);let h=R9e(o,t.nodes,e,u);return h=_9e(h),h}w(EL,"buildMultitreeLayerOrder");function I9e(t,e,r){const n=new Set(t),i=new Set(e),s=w5(e),a=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&a.push(s.get(o.dst));return IJ(a)}w(I9e,"countCrossingsBetweenAdjacent");function yq(t,e,r){const n=[];for(const s of e){const a=r[s.src],o=r[s.dst];if(a==null||o==null||a===o)continue;let l=s.src,u=s.dst,h=a,d=o;a>o&&(l=s.dst,u=s.src,h=o,d=a);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=EL(t,r,i),y=yq(m,t.edges,r);y(e[i]??0)-(e[s]??0)||i.localeCompare(s));for(const i of n){const s=r(i);if(!s)continue;const a=t.edges.filter(m=>m.src===i);if(a.length===0)continue;let o=!1,l=0;for(const m of a){const y=r(m.dst);y==null||y===s?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===s?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}w(D9e,"adjustCrossLaneSources");function O9e(t,e){const r=em(t),n=d7(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,s=q0(r);let a=Object.create(null);for(const l of n){const u=AJ(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=s(d.src),p=s(l);return!f||!p?!0:f===p}):u;if(h.length===0)a[l]=0;else if(i&&h.length===1){const d=h[0].src,f=s(d),p=s(l);f!==p?a[l]=a[d]??0:a[l]=(a[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(a[f.src]??0)+1);a[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(a=N9e(r,a)),e!=null&&e.ignoreCrossLaneEdges&&D9e(r,a),{layers:EL(r,a,s),rankOf:a,dummy:new Set}}w(O9e,"assignLayers_LongestPath");function P9e(t,e){const r=em(t),i={...O9e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},s=q0(r),{preds:a,succs:o}=qD(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=s(g.src),y=s(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=d7(r)??[...r.nodes],u=[...l].reverse(),h=w((g,m)=>{let y=0;for(const b of a.get(g)??[])y=Math.max(y,(i[b]??0)+1);let v=Number.POSITIVE_INFINITY;const x=o.get(g)??[];return x.length>0&&(v=Math.min(...x.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=SL.GRAVITY_ITERATIONS,f=w(g=>{let m=!1;for(const y of g){const v=a.get(y)??[],x=o.get(y)??[];if(v.length===0&&x.length===0)continue;const b=v.length>0?v.reduce((k,E)=>k+(i[E]??0)+1,0)/v.length:i[y]??0,T=x.length>0?x.reduce((k,E)=>k+(i[E]??0)-1,0)/x.length:i[y]??0,C=Math.round((b+T)/2),S=h(y,C);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:LJ(r,l,i),rankOf:i,dummy:new Set}}w(P9e,"assignLayers_Gravity");function $9e(t){const e=RJ(t),r=MJ(t);let n=_J(e);const i=[];for(;n.length>0;){const s=[];for(const a of n){i.push(a);for(const o of r.get(a)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&s.push(o)}n=s.sort((a,o)=>a.localeCompare(o))}return i.length===t.nodes.length?i:null}w($9e,"topoSortByGenerationIfAcyclic");function B9e(t,e){const r=em(t),n=(e==null?void 0:e.direction)==="LR"?$9e(r)??[...r.nodes].sort():d7(r)??[...r.nodes].sort(),i=q0(r),s=w(h=>i(h)??h,"laneOf"),a=Object.create(null),o=new Map,l=w((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?s(h)===s(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=AJ(r,h);let p=0;if(f.length>0)for(const v of f){const x=v.src,b=a[x]??0;p=Math.max(p,b+l(x,h))}const g=s(h),m=o.get(g)??0,y=Math.max(p,m);a[h]=y,o.set(g,y+1)}return{layers:LJ(r,n,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}w(B9e,"assignLayers_LaneAwareCompact");function F9e(t,e){const r=em(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),s=new Set(t.dummy?[...t.dummy]:[]);let a=0;const o=new Map(r.nodeById),l=w(p=>{const g=`placeholder-${a++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),s.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let x=g+1,b=0;x!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:s},graphWithDummies:f}}w(F9e,"makeProperLayering");function vq(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}w(vq,"median");function bq(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(bq,"barycenter");function z9e(t,e,r,n){const i=new Map;for(const s of t)i.set(s,[]);for(const s of r)n==="down"?e.has(s.src)&&i.has(s.dst)&&i.get(s.dst).push(e.get(s.src)):e.has(s.dst)&&i.has(s.src)&&i.get(s.src).push(e.get(s.dst));return i}w(z9e,"neighborPositionsFor");function V9e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(V9e,"currentOrderTieBreak");function xq(t,e,r){const n=new Set(t),i=new Set(e),s=w5(t),a=w5(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:s.get(u.src),v:a.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return IJ(l)}w(xq,"countCrossingsBetweenAdjacent");function YM(t,e,r){return[...t].sort((n,i)=>{const s=vq(e.get(n)??[]),a=vq(e.get(i)??[]);return s===a?V9e(n,i,r):isFinite(s)?isFinite(a)?s-a:-1:1})}w(YM,"sortByHeuristic");function wq(t,e,r,n,i,s){const a=w5(t),o=w5(e),l=z9e(e,a,r,n);if(!i||!s||s.length===0)return YM(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of s){const p=u.get(f);if(!p||p.length===0)continue;const g=YM(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=YM(d,l,o);for(const p of f){const g=bq(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const x=bq(l.get(v)??[]);if(ga.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=w(m=>{let y=xq(t,m,u);return h&&n&&(y+=xq(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(s);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,s=q0(e),a=NJ(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=wq(n[l+1],n[l],i,"up",s,a),n[l]=Tq(n[l+1],n[l],i,n[l-1],s)}return{layers:n}}w(H9e,"orderLayers");function G9e(t,e,r){const n=(r==null?void 0:r.layerGap)??mfe.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??mfe.DEFAULT_NODE_GAP,s=(r==null?void 0:r.laneGap)??i*2,a=(r==null?void 0:r.direction)??"TB",o=a==="LR"||a==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=w(R=>e.nodeById.get(R),"getNode"),f=w(R=>{var _;return((_=d(R))==null?void 0:_.width)??0},"getWidth"),p=w(R=>{var _;return((_=d(R))==null?void 0:_.height)??0},"getHeight"),g=q0(e),m=NJ(e,r==null?void 0:r.laneOrder),y=l.map(R=>R.reduce((_,P)=>Math.max(_,p(P)),0)),v=[];if(o)for(let R=0;R+1Math.max(D,f(F)),0),P=l[R+1].reduce((D,F)=>Math.max(D,f(F)),0),N=y[R],L=y[R+1],I=N/2+L/2,$=(_+P)/2,O=Math.max(0,$-I-n);v.push(O)}const x=new Set;for(const R of l)for(const _ of R)x.add(g(_));const b=x.has(null),T=m.filter(R=>x.has(R)),C=[...b?[null]:[],...T],S=Object.create(null);for(const R of T)S[R]=0;b&&(S.null=0);for(const R of l){const _=Object.create(null),P=[];for(const N of R){const L=g(N);L===null?P.push(N):(_[L]||(_[L]=[])).push(N)}for(const[N,L]of Object.entries(_)){const I=L.reduce(($,O)=>$+f(O),0)+i*Math.max(0,L.length-1);S[N]=Math.max(S[N]??0,I)}if(b&&P.length){const N=P.reduce((L,I)=>L+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,N)}}const k=new Map;{const R=C.map(N=>(N===null?S.null:S[N])??0);let P=-(R.reduce((N,L)=>N+L,0)+s*Math.max(0,C.length-1))/2;for(let N=0;Nf(V)),F=D.reduce((V,B)=>V+B,0)+i*($.length-1);let z=O-F/2;for(const[V,B]of $.entries()){const H=D[V];u[B]=z+H/2,h[B]=E+P/2,z+=H+i}}}const L=v[R]??0;E+=P+n+L}const A=new Map;for(const R of e.edges){const _=R.ref.id;A.has(_)||A.set(_,[]),A.get(_).push(R)}for(const[,R]of A){if(R.length===0)continue;const _=R[0].ref,P=_.start,N=_.end;if(P==null||N==null)continue;const L=Math.round(((u[P]??0)+(u[N]??0))/2),I=new Set;for(const $ of R)I.add($.src),I.add($.dst);for(const $ of I){if($===P||$===N)continue;const O=e.nodeById.get($);O!=null&&O.isDummy&&(u[$]=L)}}return{x:u,y:h}}w(G9e,"assignCoordinates");var W9e=8;function q9e(t){let e=2166136261;for(let r=0;r>>0}w(q9e,"hashString");function U9e(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}w(U9e,"mulberry32");function Y9e(t,e){const r=[...t],n=U9e(e);for(let i=r.length-1;i>0;i--){const s=Math.floor(n()*(i+1));[r[i],r[s]]=[r[s],r[i]]}return r}w(Y9e,"deterministicShuffle");function j9e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(j9e,"sourceDistance");function Cq(t,e){const r=new Map;for(const[i,s]of t.entries())r.set(s,i);let n=0;for(const{a:i,b:s,weight:a}of e){const o=r.get(i),l=r.get(s);o==null||l==null||(n+=a*Math.abs(o-l))}return n}w(Cq,"laneArrangementCost");function X9e(t){const e=UD(t);if(e.length<2)return[];const r=new Map(e.map((s,a)=>[s,a])),n=q0(t),i=new Map;for(const s of t.layout.edges??[]){if(s.isLayoutOnly)continue;const a=typeof s.start=="string"?s.start:void 0,o=typeof s.end=="string"?s.end:void 0;if(!a||!o||!t.nodeById.has(a)||!t.nodeById.has(o))continue;const l=n(a),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}w(X9e,"buildWeightedLaneEdges");function kq(t,e,r){const n=[...t];let i=Cq(n,e),s=!0,a=0;const o=Math.max(1,n.length);for(;s&&ai.a===s.a?i.b.localeCompare(s.b):i.a.localeCompare(s.a)).map(({a:i,b:s,weight:a})=>`${i}:${s}:${a}`).join("|");return q9e(`${t.join("|")}#${n}#${r}`)}w(Z9e,"seedForRestart");function Q9e(t,e={}){const r=UD(t);if(r.length<2)return r;const n=X9e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let s=kq(r,n,i);const a=Math.max(0,e.restarts??W9e);for(let o=0;oCn&&l*3>=o?a>0?"bottom":"top":o>Cn?s>0?"right":"left":r}w(Sq,"chooseOrthogonalSide");function Eq(t,e){return Math.abs(t.to-e.from)le.isGroup&&!le.parentId);for(const le of u){const pe={id:le.id},Ce=w(ne=>{a.set(ne.id,pe),r.filter(j=>j.parentId===ne.id).forEach(Ce)},"assignLane");Ce(le)}const h=r.filter(le=>!le.isGroup&&!le.isEdgeLabel).map(le=>{const pe=le.width??10,Ce=le.height??10,ne=le.x??0,j=le.y??0,J=MHt;return{nodeId:le.id,minX:ne-pe/2-J,maxX:ne+pe/2+J,minY:j-Ce/2-J,maxY:j+Ce/2+J,visualXHalfExtent:l?Ce/2+J:pe/2+J}}),d=w((le,pe,Ce,ne)=>{let j=o.find(J=>J.orientation===le&&Math.abs(J.coord-pe)<1);return j||(j={id:`pipe-${le}-${pe.toFixed(0)}`,orientation:le,coord:pe,spanMin:Ce,spanMax:ne,tracks:[]},o.push(j)),j.spanMin=Math.min(j.spanMin,Ce),j.spanMax=Math.max(j.spanMax,ne),j},"getOrAddPipe"),f=w((le,pe)=>{const Ce=le.width??10,ne=le.height??10,j=le.x??0,J=le.y??0;switch(pe){case"top":return{x:j,y:J-ne/2};case"bottom":return{x:j,y:J+ne/2};case"left":return{x:j-Ce/2,y:J};case"right":return{x:j+Ce/2,y:J}}},"portForSide"),p=w((le,pe,Ce)=>f(le,Sq(le,pe,Ce?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,x=w((le,pe,Ce)=>{if(g.length===0)return 0;const ne=Math.abs(pe.y-Ce.y)fe||ee.from-Cn<=ue&&ee.to+Cn>=ue&&(J+=v)}else if(j){const ue=pe.x,X=Math.min(pe.y,Ce.y)-Cn,fe=Math.max(pe.y,Ce.y)+Cn;if(fe<=X)return 0;for(const ee of g)ee.edgeIndex===le||ee.orientation!=="horizontal"||ee.pipe.coordfe||ee.from-Cn<=ue&&ee.to+Cn>=ue&&(J+=v)}return J},"crossingPenalty"),b=i.map((le,pe)=>{if(!le.start||!le.end)return{idx:pe,crossLane:0,dx:0,dy:0};const Ce=s.get(le.start),ne=s.get(le.end),j=a.get(le.start),J=a.get(le.end),ue=j&&J&&j.id!==J.id?1:0,X=Ce&&ne?Math.abs((ne.x??0)-(Ce.x??0)):0,fe=Ce&&ne?Math.abs((ne.y??0)-(Ce.y??0)):0;return{idx:pe,crossLane:ue,dx:X,dy:fe}}).sort((le,pe)=>{if(le.crossLane!==pe.crossLane)return pe.crossLane-le.crossLane;const Ce=le.dx+le.dy,ne=pe.dx+pe.dy;return Math.abs(Ce-ne)>1?Ce-ne:le.idx-pe.idx}).map(le=>le.idx),T=w((le,pe,Ce,ne)=>{const j=Math.min(le.x,pe.x),J=Math.max(le.x,pe.x),ue=Math.min(le.y,pe.y),X=Math.max(le.y,pe.y);return!!h.find(ee=>Ce&&ee.nodeId===Ce||ne&&ee.nodeId===ne?!1:Math.abs(le.x-pe.x)>Cn?ee.minYle.y&&ee.maxX>j&&ee.minXle.x&&ee.maxY>ue&&ee.minYSq(le,pe,"bottom"),"determineSide"),E=new Map;for(const[le,pe]of i.entries()){if(!pe.start||!pe.end||pe.start===pe.end||pe.points&&pe.points.length>0)continue;const Ce=s.get(pe.start),ne=s.get(pe.end);if(!Ce||!ne)continue;const j=(ne.x??0)-(Ce.x??0),J=(ne.y??0)-(Ce.y??0);E.set(le,{edgeIdx:le,srcId:pe.start,dstId:pe.end,srcSide:k(Ce,{x:ne.x??0,y:ne.y??0}),dstSide:k(ne,{x:Ce.x??0,y:Ce.y??0}),absDx:Math.abs(j),absDy:Math.abs(J),dxSign:Math.sign(j),dySign:Math.sign(J)})}const A=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.absDx===0?1/0:le.absDy/le.absDx:le.absDy===0?1/0:le.absDx/le.absDy,"preferenceStrength"),R=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.dxSign>=0?"right":"left":le.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const le of E.values()){const pe=`${le.srcId}:${le.srcSide}`;_.has(pe)||_.set(pe,[]),_.get(pe).push(le)}const P=new Map,N=w((le,pe)=>`${le}:${pe}`,"loadKey");for(const le of E.values())P.set(N(le.srcId,le.srcSide),(P.get(N(le.srcId,le.srcSide))??0)+1),P.set(N(le.dstId,le.dstSide),(P.get(N(le.dstId,le.dstSide))??0)+1);for(const le of _.values())if(!(le.length<2)){le.sort((pe,Ce)=>{const ne=A(pe),j=A(Ce);return Math.abs(ne-j)>1e-9?j-ne:pe.edgeIdx-Ce.edgeIdx});for(let pe=1;pe=j||(P.set(N(Ce.srcId,Ce.srcSide),j-1),P.set(N(Ce.srcId,ne),J+1),Ce.srcSide=ne)}}const L=w(le=>{const pe=le==null?void 0:le.shape;return pe==="question"||pe==="diamond"},"isDiamondNode"),I=new Map;for(const le of E.values())I.has(le.dstId)||I.set(le.dstId,new Set),I.get(le.dstId).add(le.dstSide);for(const le of E.values()){if(!L(s.get(le.srcId)))continue;const pe=I.get(le.srcId);if(!(pe!=null&&pe.has(le.srcSide)))continue;const Ce=R(le);if(pe.has(Ce)||(P.get(N(le.srcId,Ce))??0)>0)continue;const ne=P.get(N(le.srcId,le.srcSide))??0;P.set(N(le.srcId,le.srcSide),Math.max(0,ne-1)),P.set(N(le.srcId,Ce),1),le.srcSide=Ce}for(const le of E.values()){const{edgeIdx:pe,srcId:Ce,dstId:ne,srcSide:j,dstSide:J}=le,ue=s.get(Ce),X=s.get(ne),fe=`${Ce}:${j}:src`,ee=j==="top"||j==="bottom"?X.x??0:X.y??0;C.has(fe)||C.set(fe,[]),C.get(fe).push({edgeIdx:pe,oppositeCoord:ee});const Ae=`${ne}:${J}:dst`,Re=J==="top"||J==="bottom"?ue.x??0:ue.y??0;C.has(Ae)||C.set(Ae,[]),C.get(Ae).push({edgeIdx:pe,oppositeCoord:Re})}const $=new Map,O=8;for(const[le,pe]of C){if(pe.length<2)continue;pe.sort((Ke,ze)=>Ke.oppositeCoord-ze.oppositeCoord);const Ce=le.split(":"),ne=Ce.slice(0,-2).join(":"),j=Ce[Ce.length-2],J=Ce[Ce.length-1],ue=s.get(ne);if(!ue)continue;const fe=j==="left"||j==="right"?ue.height??10:ue.width??10,ee=ue.shape,Re=ee==="question"||ee==="diamond"?fe*.3:fe,Ne=Math.min(20,Math.max(O,Re/(pe.length+1))),De=-(Ne*(pe.length-1))/2;for(const[Ke,ze]of pe.entries()){const st=De+Ke*Ne,Oe=`${ze.edgeIdx}:${J}`;$.set(Oe,st)}}const D=w(le=>{var pe;return!!((pe=i[le])!=null&&pe.labelNodeId)},"edgeHasLabelNode"),F=w((le,pe)=>le?(C.get(`${le}:${pe}:src`)??[]).some(({edgeIdx:Ce})=>D(Ce))||(C.get(`${le}:${pe}:dst`)??[]).some(({edgeIdx:Ce})=>D(Ce)):!1,"faceHasLabelNode"),z=w((le,pe,Ce)=>pe==="top"||pe==="bottom"?{x:le.x+Ce,y:le.y}:{x:le.x,y:le.y+Ce},"applyPortOffset"),V=w((le,pe,Ce)=>{const ne=E.get(le),j={x:Ce.x??0,y:Ce.y??0},J={x:pe.x??0,y:pe.y??0},ue=(ne==null?void 0:ne.srcSide)??k(pe,j),X=(ne==null?void 0:ne.dstSide)??k(Ce,J);let fe=ne?f(pe,ne.srcSide):p(pe,j,!0),ee=ne?f(Ce,ne.dstSide):p(Ce,J,!1);const Ae=$.get(`${le}:src`),Re=$.get(`${le}:dst`);return Ae!==void 0&&(fe=z(fe,ue,Ae)),Re!==void 0&&(ee=z(ee,X,Re)),{pSrcPort:fe,pDstPort:ee,srcSide:ue,dstSide:X}},"portsForEdge");for(const le of b){const pe=i[le];if(m[le]=[],!pe.start||!pe.end||pe.points&&pe.points.length>0||pe.start===pe.end)continue;const Ce=s.get(pe.start),ne=s.get(pe.end);if(!Ce||!ne)continue;const{pSrcPort:j,pDstPort:J,srcSide:ue,dstSide:X}=V(le,Ce,ne),fe={...j},ee={...J},Ae=ue==="top"||ue==="bottom",Re=X==="top"||X==="bottom";if(Ae){const ht=j.y>(Ce.y??0);fe.y=ht?j.y+tu:j.y-tu}else{const ht=j.x>(Ce.x??0);fe.x=ht?j.x+tu:j.x-tu}if(Re){const ht=J.y>(ne.y??0);ee.y=ht?J.y+tu:J.y-tu}else{const ht=J.x>(ne.x??0);ee.x=ht?J.x+tu:J.x-tu}const Xe=w((ht,vt)=>{for(const Kt of h)if(!vt.includes(Kt.nodeId)&&ht.x>Kt.minX&&ht.xKt.minY&&ht.y{if(cn){const Pt=ht.y>(vt.y??0);return{x:(Kt.x??0)>=ht.x?Br.maxX+Lm:Br.minX-Lm,y:Pt?Br.maxY+Uv:Br.minY-Uv,leavesPositiveSide:Pt}}const kt=ht.x>(vt.x??0),bt=(Kt.y??0)>=ht.y;return{x:kt?Br.maxX+Lm:Br.minX-Lm,y:bt?Br.maxY+Uv:Br.minY-Uv,leavesPositiveSide:kt}},"obstacleDetour");let qe=[];const De=[pe.start,pe.end],Ke=Xe(fe,De);if(Ke.inside&&Ke.obstacle){const ht=Ke.obstacle;if(Ae){const vt=Ne(j,Ce,ne,ht,!0);fe.x=vt.x,fe.y=vt.y;const Kt=vt.leavesPositiveSide?Math.min(ht.minY-2,j.y+tu):Math.max(ht.maxY+2,j.y-tu);qe=[{x:j.x,y:Kt},{x:vt.x,y:Kt},{x:vt.x,y:vt.y}]}else{const vt=Ne(j,Ce,ne,ht,!1),Kt=vt.leavesPositiveSide?Math.min(ht.minX-2,j.x+tu):Math.max(ht.maxX+2,j.x-tu);fe.x=vt.x,fe.y=vt.y,qe=[{x:Kt,y:j.y},{x:Kt,y:vt.y},{x:vt.x,y:vt.y}]}}let ze=[];const st=Xe(ee,De);if(st.inside&&st.obstacle){const ht=st.obstacle;if(Re){const vt=Ne(J,ne,Ce,ht,!0);ee.x=vt.x,ee.y=vt.y,ze=[{x:vt.x,y:vt.y},{x:J.x,y:vt.y}]}else{const vt=Ne(J,ne,Ce,ht,!1);ee.x=vt.x,ee.y=vt.y,ze=[{x:vt.x,y:vt.y},{x:vt.x,y:J.y}]}}if(qe.length===0&&ze.length===0){const ht=Lm,vt=Math.abs(fe.x-ee.x)1||kt>1,Pt=S.get(pe.start??"")??0,pt=S.get(pe.end??"")??0,ar=cn>1&&F(pe.start,ue)||kt>1&&F(pe.end,X),Ie=cn<=1||Pt<=2,si=kt<=1||pt<=2;if((vt||Kt)&&!Br&&(!bt||bt&&!ar&&Ie&&si)&&!T(j,J,pe.start,pe.end)){pe.points=[{...j},{...fe},{...ee},{...J}],y.add(le);const En=Kt?"horizontal":"vertical",gs=Kt?j.y:j.x,mn=Kt?Math.min(j.x,J.x):Math.min(j.y,J.y),mi=Kt?Math.max(j.x,J.x):Math.max(j.y,J.y),An={id:`fast-path-${En}-${gs.toFixed(0)}-${le}`,orientation:En,coord:gs,spanMin:mn,spanMax:mi,tracks:[]};g.push({edgeIndex:le,segmentIndex:0,orientation:En,pipe:An,trackIndex:0,from:mn,to:mi});continue}}const Oe=d("vertical",fe.x,fe.y,fe.y);fe.x=Oe.coord;const mt=d("vertical",ee.x,ee.y,ee.y);ee.x=mt.coord;let Le=Math.min(fe.x,ee.x)-50,St=Math.max(fe.x,ee.x)+50,At=Math.min(fe.y,ee.y)-50,lt=Math.max(fe.y,ee.y)+50;for(const ht of h){const vt=Math.min(fe.x,ee.x),Kt=Math.max(fe.x,ee.x),Br=Math.min(fe.y,ee.y),cn=Math.max(fe.y,ee.y);ht.minXvt&&ht.minYBr&&(Le=Math.min(Le,ht.minX-C8),St=Math.max(St,ht.maxX+C8),At=Math.min(At,ht.minY-C8),lt=Math.max(lt,ht.maxY+C8))}for(const ht of h){if(ht.maxXSt||ht.maxYlt)continue;const vt=Lm;d("horizontal",ht.minY-vt,Le,St),d("horizontal",ht.maxY+vt,Le,St);const Kt=Uv;d("vertical",ht.minX-Kt,At,lt),d("vertical",ht.maxX+Kt,At,lt)}d("horizontal",fe.y,Le,St),d("horizontal",ee.y,Le,St);const zt=o.filter(ht=>ht.orientation==="horizontal"&&ht.coord>=At&&ht.coord<=lt),It=o.filter(ht=>ht.orientation==="vertical"&&ht.coord>=Le&&ht.coord<=St),ft=w((ht,vt)=>`${ht.toFixed(1)},${vt.toFixed(1)}`,"getKey"),xe=ft(fe.x,fe.y),Nt=ft(ee.x,ee.y),Tt=new Map,yt=new Map,Rt=new Map,Or=new Set,Ee=[];Tt.set(xe,0),Rt.set(xe,"n"),Ee.push({key:xe,f:Math.hypot(ee.x-fe.x,ee.y-fe.y),pt:fe}),Or.add(xe);let it=[];const gt=w((ht,vt)=>T(ht,vt,pe.start,pe.end),"checkSegmentBlocked"),xt={x:ee.x,y:fe.y},nr=gt(fe,xt),$r=gt(xt,ee),Cr=nr||$r,Ur={x:fe.x,y:ee.y},Er=gt(fe,Ur),nn=gt(Ur,ee);if(Cr?Er||nn||(Math.abs(fe.x-ee.x)0;){Ee.sort((pt,ar)=>pt.f-ar.f);const ht=Ee.shift();if(Or.delete(ht.key),ht.key===Nt){let pt=Nt,ar=ee;for(it=[ar];yt.has(pt);){const Ie=yt.get(pt);it.unshift(Ie),ar=Ie,pt=ft(Ie.x,Ie.y)}break}const vt=ht.pt.x,Kt=ht.pt.y,Br=It.sort((pt,ar)=>pt.coord-ar.coord),cn=Br.findIndex(pt=>Math.abs(pt.coord-vt)<1),kt=zt.sort((pt,ar)=>pt.coord-ar.coord),bt=kt.findIndex(pt=>Math.abs(pt.coord-Kt)<1),Pt=[];cn>0&&Pt.push({x:Br[cn-1].coord,y:Kt}),cn>=0&&cn0&&Pt.push({x:vt,y:kt[bt-1].coord}),bt>=0&&btJs.nodeId===pe.start||Js.nodeId===pe.end?!1:ar!==Ie?Js.minYKt&&Js.maxX>ar&&Js.minXvt&&Js.maxY>si&&Js.minY10&&Ph<-5||Lo<-10&&Ph>5)&&(mi=Math.abs(Ph)*100),(An>10&&Bu<-5||An<-10&&Bu>5)&&(mi+=Math.abs(Bu)*50);let pm=0;const gm=Rt.get(ht.key)??"n",mm=Math.abs(Bu)>Cn?"h":"v";gm!=="n"&&gm!==mm&&(pm=50);const ga=gs+mn+mi+pm,Gl=(Tt.get(ht.key)??1/0)+ga,ao=Math.abs(ee.x-pt.x)+Math.abs(ee.y-pt.y);if(Gl<(Tt.get(En)??1/0))if(yt.set(En,ht.pt),Tt.set(En,Gl),Rt.set(En,mm),!Or.has(En))Ee.push({key:En,f:Gl+ao,pt}),Or.add(En);else{const Js=Ee.findIndex(xc=>xc.key===En);Js!==-1&&(Ee[Js].f=Gl+ao)}}}if(it.length===0&&(it=[fe,{x:fe.x,y:ee.y},ee]),it.length>4){const ht=it[0],vt=it[it.length-1];let Kt=Math.min(ht.x,vt.x),Br=Math.max(ht.x,vt.x),cn=Math.min(ht.y,vt.y),kt=Math.max(ht.y,vt.y);for(const si of it)Kt=Math.min(Kt,si.x),Br=Math.max(Br,si.x),cn=Math.min(cn,si.y),kt=Math.max(kt,si.y);const bt=Br>Math.max(ht.x,vt.x),Pt=Ktmn.minXBe&&mn.minYun);if(gs.length>0){let mn=Math.max(ht.x,vt.x);for(const mi of gs){const An=(mi.minX+mi.maxX)/2;if(mi.visualXHalfExtent===void 0||isNaN(mi.visualXHalfExtent))continue;const Lo=An+mi.visualXHalfExtent+si;mn=Math.max(mn,Lo)}isNaN(mn)||(Br=mn)}}if(Pt){const Be=h.filter(un=>un.minXMath.min(ht.y,vt.y));if(Be.length>0){let un=Math.min(ht.x,vt.x);for(const En of Be){const mn=(En.minX+En.maxX)/2-En.visualXHalfExtent-si;un=Math.min(un,mn)}Kt=un}}}const pt=w(si=>{const Be=vt.y>ht.y,un=h.filter(mn=>{const mi=Math.min(ht.x,vt.x)mn.minX,An=Math.min(ht.y,vt.y)mn.minY;return mi&&An});let En=un;if(l&&un.length>0){const mn=un.filter(mi=>mi.minXsi);mn.length>0&&(En=mn)}if(En.length===0)return vt.y;const gs=Lm;if(Be){const mi=Math.max(...En.map(An=>An.maxY))+gs;if(miAn.minY))-gs;if(mi>vt.y+Cn)return mi}return vt.y},"findBestReturnY"),ar=w(si=>{const Be=pt(si),un={x:si,y:ht.y},En={x:si,y:Be},gs={x:vt.x,y:Be},mn=gt(ht,un),mi=gt(un,En),An=gt(En,gs),Lo=Be!==vt.y?gt(gs,vt):!1;return!mn&&!mi&&!An&&!Lo?Math.abs(Be-vt.y)=3){const ht=Yr[Yr.length-1],vt=Yr[Yr.length-2],Kt=Yr[Yr.length-3],Br=Math.abs(Kt.y-vt.y)Math.abs(ht.x-Kt.x)&&Yr.splice(-2,1)}else if(cn){const kt=Math.sign(vt.y-Kt.y),bt=Math.sign(ht.y-Kt.y);kt!==0&&kt===bt&&Math.abs(vt.y-Kt.y)>Math.abs(ht.y-Kt.y)&&Yr.splice(-2,1)}}const wn=[Yr[0]];for(let ht=1;htvt.x,kt=Br.x>Kt.x;if(cn!==kt){wn.push(Kt);continue}continue}if(Math.abs(vt.x-Kt.x)vt.y,kt=Br.y>Kt.y;if(cn!==kt){wn.push(Kt);continue}continue}wn.push(Kt)}wn.push(Yr[Yr.length-1]);for(let ht=0;htle.from{const j=!ne.segments.some(ue=>(ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex)&&B(ue,le)),J=!Ce.segments.some(ue=>(ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex)&&B(ue,pe));return j&&J?(le.trackIndex=ne.index,pe.trackIndex=Ce.index,Ce.segments=[...Ce.segments.filter(ue=>ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex),{edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,from:pe.from,to:pe.to}],ne.segments=[...ne.segments.filter(ue=>ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],!0):!1},"trySwapSegmentsAcrossTracks"),G=w(le=>{const pe=le.tracks.length;return le.tracks[pe]={index:pe,coord:le.coord,segments:[]},pe},"createNewTrack"),W=w((le,pe)=>{const Ce=le.pipe.tracks[le.trackIndex];Ce.segments=Ce.segments.filter(j=>j.edgeIndex!==le.edgeIndex||j.segmentIndex!==le.segmentIndex),le.trackIndex=pe,le.pipe.tracks[pe].segments.push({edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to})},"moveSegmentToTrack"),K=w((le,pe)=>{const Ce=m[le.edgeIndex];for(const ne of Ce){const j=g[ne];j.pipe===le.pipe&&W(j,pe)}},"moveSegmentChainToTrack"),q=w(le=>{const pe=m[le.edgeIndex],Ce=pe.indexOf(g.indexOf(le)),ne=[];return Ce>0&&ne.push(g[pe[Ce-1]]),Ce{if(le.orientation===pe.orientation)return!1;const Ce=le.orientation==="horizontal"?le:pe,ne=le.orientation==="horizontal"?pe:le;return ne.pipe.coord>Ce.from&&ne.pipe.coordne.from&&Ce.pipe.coord{for(const Ce of le.tracks)if(!Ce.segments.some(j=>(j.edgeIndex!==pe.edgeIndex||j.segmentIndex!==pe.segmentIndex)&&B(j,pe)))return Ce.index;return-1},"findAvailableTrack"),Z=w((le,pe)=>{if(le.trackIndex===pe.trackIndex)return B(le,pe);const Ce=q(le),ne=q(pe);return Ce.some(j=>ne.some(J=>oe(j,J)))},"segmentsConflict"),re=w((le,pe,Ce)=>{if(H(le,pe,le.pipe.tracks[le.trackIndex],pe.pipe.tracks[pe.trackIndex]))return;const ne=Q(le.pipe,pe);Ce(pe,ne!==-1?ne:G(le.pipe))},"resolveTrackConflict"),ie=w(le=>{let pe=0;for(let Ce=0;Ce{if(me.has(le))return me.get(le);const pe=m[le];if(pe.length===0){const X={dest:0,deviation:0,base:0,delta:0};return me.set(le,X),X}const ne=g[pe[0]].pipe.coord;let j=ne;for(let X=1;XMath.abs(Ae-ne)?ee:Ae;break}}const J=Math.abs(j-ne),ue={dest:j,deviation:J,base:ne,delta:j-ne};return me.set(le,ue),ue},"getDestInfo"),_e=w(()=>{let le=0;const pe=new Map;for(const[ne,j]of i.entries())m[ne].length!==0&&j.start&&(pe.has(j.start)||pe.set(j.start,[]),pe.get(j.start).push(ne));const Ce=w(ne=>{const j=i[ne];if(!j.start||!j.end)return 0;const J=s.get(j.start),ue=s.get(j.end);if(!J||!ue)return 0;const X=(ue.x??0)-(J.x??0),fe=(ue.y??0)-(J.y??0);return Math.abs(X)+Math.abs(fe)},"getEdgeDistance");for(const ne of pe.values()){ne.sort((J,ue)=>{const X=te(J),fe=te(ue);if(Math.abs(X.deviation-fe.deviation)>1)return X.deviation-fe.deviation;if(Math.abs(X.dest-fe.dest)>1)return X.dest-fe.dest;const ee=Ce(J),Ae=Ce(ue);if(Math.abs(ee-Ae)>1)return Ae-ee;const Re=m[J].length,Xe=m[ue].length;if(Re!==Xe)return Re-Xe;if(Re===1){const Ne=m[J][0],qe=m[ue][0];if(g[Ne]&&g[qe]){const De=g[Ne],Ke=g[qe],ze=Math.abs(De.to-De.from),st=Math.abs(Ke.to-Ke.from);if(Math.abs(ze-st)>1)return ze-st}}return 0});const j=ne.map(J=>g[m[J][0]]);le+=ie(j)}return le},"fixSourceHandleCrossings"),$e=w(()=>{let le=0;const pe=new Map;for(const[Ce,ne]of i.entries())m[Ce].length!==0&&ne.end&&(pe.has(ne.end)||pe.set(ne.end,[]),pe.get(ne.end).push(Ce));for(const Ce of pe.values()){Ce.sort((j,J)=>{const ue=w(ee=>{const Ae=m[ee];if(Ae.length<2)return 0;const Re=g[Ae[Ae.length-2]];return Math.abs(Re.to-Re.from)},"getDist"),X=ue(j),fe=ue(J);return Math.abs(X-fe)>.1?X-fe:j-J});const ne=Ce.map(j=>g[m[j][m[j].length-1]]);le+=ie(ne)}return le},"fixTargetHandleCrossings"),Fe=w(()=>{let le=0;for(const pe of o){const Ce=[];for(const ne of pe.tracks)for(const j of ne.segments){const J=m[j.edgeIndex].find(ue=>g[ue].segmentIndex===j.segmentIndex);J!==void 0&&Ce.push(g[J])}Ce.sort((ne,j)=>ne.edgeIndex-j.edgeIndex||ne.segmentIndex-j.segmentIndex);for(let ne=0;ne{ne.segments.forEach(j=>{pe.push({edgeIndex:j.edgeIndex,segmentIndex:j.segmentIndex,trackIndex:ne.index,from:j.from,to:j.to})})}),pe.sort((ne,j)=>ne.from-j.from);const Ce=[];if(pe.length>0){let ne=[pe[0]],j=pe[0].to;for(let J=1;Jj.add(Ne.trackIndex));const J=new Map;ne.forEach(Ne=>{const qe=te(Ne.edgeIndex);J.set(Ne.trackIndex,(J.get(Ne.trackIndex)??0)+qe.delta)});const ue=[...j].filter(Ne=>(J.get(Ne)??0)<-1),X=[...j].filter(Ne=>(J.get(Ne)??0)>1),fe=[...j].filter(Ne=>Math.abs(J.get(Ne)??0)<=1);ue.sort((Ne,qe)=>(J.get(qe)??0)-(J.get(Ne)??0)),X.sort((Ne,qe)=>(J.get(Ne)??0)-(J.get(qe)??0));const ee=w((Ne,qe)=>{ne.filter(De=>De.trackIndex===Ne).forEach(De=>{const Ke=y.has(De.edgeIndex)?le.coord:qe;Te.set(`${De.edgeIndex}-${De.segmentIndex}`,Ke)})},"assignCoord");let Ae=0;for(const Ne of ue)Ae++,ee(Ne,le.coord-Ae*aF);if(fe.length===0&&j.size>0){const Ne=[...j].sort((Ke,ze)=>Math.abs(J.get(Ke)??0)-Math.abs(J.get(ze)??0))[0],qe=ue.indexOf(Ne);qe!==-1&&ue.splice(qe,1);const De=X.indexOf(Ne);De!==-1&&X.splice(De,1),fe.push(Ne)}let Re=0;for(const Ne of fe){if(Re===0)ee(Ne,le.coord);else{const qe=Re%2===1?1:-1,De=Math.ceil(Re/2);ee(Ne,le.coord+qe*De*aF*.5)}Re++}let Xe=0;for(const Ne of X)Xe++,ee(Ne,le.coord+Xe*aF)}}for(const[le,pe]of i.entries()){const Ce=m[le]??[];if(Ce.length===0)continue;const ne=[],j=s.get(pe.start),J=s.get(pe.end),{pSrcPort:ue,pDstPort:X}=V(le,j,J),fe=Ce.map(Re=>{const Xe=g[Re],Ne=Te.get(`${Xe.edgeIndex}-${Xe.segmentIndex}`)??Xe.pipe.coord;return{orient:Xe.orientation,coord:Ne,from:Xe.from,to:Xe.to}});ne.push(ue);for(let Re=0;ReCn&&ne.push(Um(Xe,qe)),ze&&Ke.orient===Xe.orient)if(Math.abs(Xe.coord-Ke.coord)>Cn){const st=Xe.orient==="vertical"?(qe+Ke.from)/2:Eq(Xe,Ke);ne.push(Um(Xe,st),Um(Ke,st))}else(Re===0||Re===fe.length-2)&&ne.push(Um(Xe,Eq(Xe,Ke)));else if(ze)ne.push(Um(Xe,Ke.coord));else{const st=Math.abs(Xe.from-qe)Cn||Math.abs(ee.y-X.y)>Cn)&&ne.push(X);const Ae=[];ne.length>0&&Ae.push(ne[0]);for(let Re=1;ReCn||Math.abs(Xe.y-Ne.y)>Cn)&&Ae.push(Xe)}pe.points=Ae}for(const le of i){const pe=le.__originalEdge;pe&&le.points&&(pe.points=le.points)}t.edges=(t.edges??[]).filter(le=>!le.isLayoutOnly);const ge=w((le,pe)=>{const Ce=pe.x??0,ne=pe.y??0,j=pe.width??0,J=pe.height??0;if(j<=0||J<=0)return le;const ue=Ce-j/2,X=Ce+j/2,fe=ne-J/2,ee=ne+J/2;if(le.xX||le.yee)return le;const Ae=le.x-ue,Re=X-le.x,Xe=le.y-fe,Ne=ee-le.y,qe=Math.min(Ae,Re,Xe,Ne);return qe===Ae?{x:ue,y:le.y}:qe===Re?{x:X,y:le.y}:qe===Xe?{x:le.x,y:fe}:{x:le.x,y:ee}},"nodeBoundaryClamp");for(const le of t.edges){const pe=le.points;if(!pe||pe.length<2)continue;const Ce=le.start,ne=le.end,j=Ce?s.get(Ce):void 0,J=ne?s.get(ne):void 0;j&&(pe[0]=ge(pe[0],j)),J&&(pe[pe.length-1]=ge(pe[pe.length-1],J))}return t}w(e_e,"routeEdgesOrthogonal");function t_e(t){return t.direction??"TB"}w(t_e,"getSwimlaneDirection");function r_e(t){var h,d,f,p,g;const e=BRe(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,s=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,a=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=t_e(t),{ordered:l,coordinates:u}=J9e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:s,automaticLaneOrdering:a,direction:o});FRe(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;e_e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return y9e(t,o),m9e(t),o}w(r_e,"runSwimlaneLayoutCore");async function n_e(t,e){const r=e.select("g");SZ(r,t.markers,t.type,t.diagramId),qSe(),YSe(),kke(),tRe(),$Re(t);const n=zRe(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await CRe(r,t);r_e(t),await DRe(t,i)}w(n_e,"render");const RHt=Object.freeze(Object.defineProperty({__proto__:null,render:n_e},Symbol.toStringTag,{value:"Module"}));function Aq(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}function i_e(t,e,r){return(e=s_e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NHt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function DHt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],l=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function OHt(){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 PHt(){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 ra(t,e){return _Ht(t)||DHt(t,e)||OJ(t,e)||OHt()}function AL(t){return LHt(t)||NHt(t)||OJ(t)||PHt()}function $Ht(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function s_e(t){var e=$Ht(t,"string");return typeof e=="symbol"?e:e+""}function La(t){"@babel/helpers - typeof";return La=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},La(t)}function OJ(t,e){if(t){if(typeof t=="string")return Aq(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Aq(t,e):void 0}}var xa=typeof window>"u"?null:window,yfe=xa?xa.navigator:null;xa&&xa.document;var BHt=La(""),a_e=La({}),FHt=La(function(){}),zHt=typeof HTMLElement>"u"?"undefined":La(HTMLElement),f7=function(e){return e&&e.instanceString&&Ts(e.instanceString)?e.instanceString():null},Dr=function(e){return e!=null&&La(e)==BHt},Ts=function(e){return e!=null&&La(e)===FHt},Ei=function(e){return!Bc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},jn=function(e){return e!=null&&La(e)===a_e&&!Ei(e)&&e.constructor===Object},VHt=function(e){return e!=null&&La(e)===a_e},Zt=function(e){return e!=null&&La(e)===La(1)&&!isNaN(e)},o_e=function(e){return Zt(e)&&Math.floor(e)===e},ML=function(e){if(zHt!=="undefined")return e!=null&&e instanceof HTMLElement},Bc=function(e){return p7(e)||l_e(e)},p7=function(e){return f7(e)==="collection"&&e._private.single},l_e=function(e){return f7(e)==="collection"&&!e._private.single},PJ=function(e){return f7(e)==="core"},c_e=function(e){return f7(e)==="stylesheet"},HHt=function(e){return f7(e)==="event"},Sg=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},GHt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},WHt=function(e){return jn(e)&&Zt(e.x1)&&Zt(e.x2)&&Zt(e.y1)&&Zt(e.y2)},qHt=function(e){return VHt(e)&&Ts(e.then)},UHt=function(){return yfe&&yfe.userAgent.match(/msie|trident|edge/i)},T5=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var s=[],a=0;ar?1:0},JHt=function(e,r){return-1*h_e(e,r)},Gr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+XHt+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,s=parseFloat(d[3]),s<0||s>100)||(s=s/100,a=d[4],a!==void 0&&(a=parseFloat(a),a<0||a>1)))return;if(i===0)o=l=u=Math.round(s*255);else{var f=s<.5?s*(1+i):s+i-s*i,p=2*s-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,a]}return r},rGt=function(e){var r,n=new RegExp("^"+YHt+"$").exec(e);if(n){r=[];for(var i=[],s=1;s<=3;s++){var a=n[s];if(a[a.length-1]==="%"&&(i[s]=!0),a=parseFloat(a),i[s]&&(a=a/100*255),a<0||a>255)return;r.push(Math.floor(a))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},nGt=function(e){return iGt[e.toLowerCase()]},d_e=function(e){return(Ei(e)?e:null)||nGt(e)||eGt(e)||rGt(e)||tGt(e)},iGt={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},f_e=function(e){for(var r=e.map,n=e.keys,i=n.length,s=0;s=l||L<0||x&&I>=f}function E(){var N=e();if(k(N))return A(N);g=setTimeout(E,S(N))}function A(N){return g=void 0,b&&h?T(N):(h=d=void 0,p)}function R(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function _(){return g===void 0?p:A(e())}function P(){var N=e(),L=k(N);if(h=arguments,d=this,m=N,L){if(g===void 0)return C(m);if(x)return clearTimeout(g),g=setTimeout(E,l),T(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=R,P.flush=_,P}return xF=a,xF}var pGt=fGt(),v7=g7(pGt),wF=xa?xa.performance:null,m_e=wF&&wF.now?function(){return wF.now()}:function(){return Date.now()},gGt=(function(){if(xa){if(xa.requestAnimationFrame)return function(t){xa.requestAnimationFrame(t)};if(xa.mozRequestAnimationFrame)return function(t){xa.mozRequestAnimationFrame(t)};if(xa.webkitRequestAnimationFrame)return function(t){xa.webkitRequestAnimationFrame(t)};if(xa.msRequestAnimationFrame)return function(t){xa.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(m_e())},1e3/60)}})(),RL=function(e){return gGt(e)},b0=m_e,c1=9261,y_e=65599,S2=5381,v_e=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c1,n=r,i;i=e.next(),!i.done;)n=n*y_e+i.value|0;return n},F6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c1;return r*y_e+e|0},z6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S2;return(r<<5)+r+e|0},mGt=function(e,r){return e*2097152+r},dp=function(e){return e[0]*2097152+e[1]},S8=function(e,r){return[F6(e[0],r[0]),z6(e[1],r[1])]},Nfe=function(e,r){var n={value:0,done:!1},i=0,s=e.length,a={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},VJ=function(e){e.splice(0,e.length)},EGt=function(e,r){for(var n=0;n"u"?"undefined":La(Set))!==MGt?Set:RGt,XD=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!PJ(e)){as("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){as("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var s=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new b3,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(s.position.x==null&&(s.position.x=0),s.position.y==null&&(s.position.y=0),r.renderedPosition){var a=r.renderedPosition,o=e.pan(),l=e.zoom();s.position={x:(a.x-o.x)/l,y:(a.y-o.y)/l}}var u=[];Ei(r.classes)?u=r.classes:Dr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,T,C){var S;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(T==null&&(T=v.length);bR;0<=R?A++:A--)E.push(A);return E}).apply(this).reverse(),k=[],T=0,C=S.length;T_;0<=_?++E:--E)P.push(a(v,b));return P},m=function(v,x,b,T){var C,S,k;for(T==null&&(T=n),C=v[b];b>x;){if(k=b-1>>1,S=v[k],T(C,S)<0){v[b]=S,b=k;continue}break}return v[b]=C},y=function(v,x,b){var T,C,S,k,E;for(b==null&&(b=n),C=v.length,E=x,S=v[x],T=2*x+1;T0;){var S=x.pop(),k=y(S),E=S.id();if(f[E]=k,k!==1/0)for(var A=S.neighborhood().intersect(g),R=0;R0)for(D.unshift(O);d[z];){var V=d[z];D.unshift(V.edge),D.unshift(V.node),F=V.node,z=F.id()}return o.spawn(D)}}}},PGt={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,s=n.length,a=new Array(s),o=n,l=function(T){for(var C=0;C0;){if(C(),k++,T===h){for(var E=[],A=s,R=h,_=v[R];E.unshift(A),_!=null&&E.unshift(_),A=y[R],A!=null;)R=A.id(),_=v[R];return{found:!0,distance:d[T],path:this.spawn(E),steps:k}}p[T]=!0;for(var P=b._private.edges,N=0;N_&&(g[R]=_,x[R]=A,b[R]=C),!s){var P=A*h+E;!s&&g[P]>_&&(g[P]=_,x[P]=E,b[P]=C)}}}for(var N=0;N1&&arguments[1]!==void 0?arguments[1]:a,Te=b(ce),ge=[],He=Te;;){if(He==null)return r.spawn();var we=x(He),Me=we.edge,je=we.pred;if(ge.unshift(He[0]),He.same(he)&&ge.length>0)break;Me!=null&&ge.unshift(Me),He=je}return l.spawn(ge)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var s=Math.floor(Math.random()*r.length);r=WGt(s,e,r),n--}return r},qGt={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(D){return D.isLoop()});var s=n.length,a=i.length,o=Math.ceil(Math.pow(Math.log(s)/Math.LN2,2)),l=Math.floor(s/GGt);if(s<2){as("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,s=0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];a?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}s&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},S_e=function(e,r){return r===0?e:S_e(r,e%r)},ZGt=function(e){for(var r=e[0],n=0;n0&&(r=S_e(r,e[n]));else return 0;return r},QGt=function(e){return Math.PI*e/180},E8=function(e,r){return Math.atan2(r,e)-Math.PI/2},HJ=Math.log2||function(t){return Math.log(t)/Math.log(2)},GJ=function(e){return e>0?1:e<0?-1:0},_y=function(e,r){return Math.sqrt(Ym(e,r))},Ym=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},JGt=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},tWt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},rWt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},nWt=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},E_e=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},XM=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},KM=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,s,a;if(r.length===1)n=i=s=a=r[0];else if(r.length===2)n=s=r[0],a=i=r[1];else if(r.length===4){var o=ra(r,4);n=o[0],i=o[1],s=o[2],a=o[3]}return e.x1-=a,e.x2+=i,e.y1-=n,e.y2+=s,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ffe=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},WJ=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Gp=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},zfe=function(e,r){return Gp(e,r.x,r.y)},A_e=function(e,r){return Gp(e,r.x1,r.y1)&&Gp(e,r.x2,r.y2)},iWt=(kF=Math.hypot)!==null&&kF!==void 0?kF:function(t,e){return Math.sqrt(t*t+e*e)};function sWt(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,A){return{x:E.x+A.x,y:E.y+A.y}},n=function(E,A){return{x:E.x-A.x,y:E.y-A.y}},i=function(E,A){return{x:E.x*A,y:E.y*A}},s=function(E,A){return E.x*A.y-E.y*A.x},a=function(E){var A=iWt(E.x,E.y);return A===0?{x:0,y:0}:{x:E.x/A,y:E.y/A}},o=function(E){for(var A=0,R=0;R7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Ag(s,a):l,h=s/2,d=a/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,x=y;if(g=Wp(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,T=i-d+u-o,C=b,S=i+d-u+o;if(g=Wp(e,r,n,i,b,T,C,S,!1),g.length>0)return g}if(f){var k=n-h+u-o,E=i+d+o,A=n+h-u+o,R=E;if(g=Wp(e,r,n,i,k,E,A,R,!1),g.length>0)return g}if(p){var _=n-h-o,P=i-d+u-o,N=_,L=i+d-u+o;if(g=Wp(e,r,n,i,_,P,N,L,!1),g.length>0)return g}var I;{var $=n-h+u,O=i-d+u;if(I=lk(e,r,n,i,$,O,u+o),I.length>0&&I[0]<=$&&I[1]<=O)return[I[0],I[1]]}{var D=n+h-u,F=i-d+u;if(I=lk(e,r,n,i,D,F,u+o),I.length>0&&I[0]>=D&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,V=i+d-u;if(I=lk(e,r,n,i,z,V,u+o),I.length>0&&I[0]>=z&&I[1]>=V)return[I[0],I[1]]}{var B=n-h+u,H=i+d-u;if(I=lk(e,r,n,i,B,H,u+o),I.length>0&&I[0]<=B&&I[1]>=H)return[I[0],I[1]]}return[]},oWt=function(e,r,n,i,s,a,o){var l=o,u=Math.min(n,s),h=Math.max(n,s),d=Math.min(i,a),f=Math.max(i,a);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},lWt=function(e,r,n,i,s,a,o,l,u){var h={x1:Math.min(n,o,s)-u,x2:Math.max(n,o,s)+u,y1:Math.min(i,l,a)-u,y2:Math.max(i,l,a)+u};return!(eh.x2||rh.y2)},cWt=function(e,r,n,i){n-=i;var s=r*r-4*e*n;if(s<0)return[];var a=Math.sqrt(s),o=2*e,l=(-r+a)/o,u=(-r-a)/o;return[l,u]},uWt=function(e,r,n,i,s){var a=1e-5;e===0&&(e=a),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,s[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),s[0]=-p+d+f,p+=(d+f)/2,s[4]=s[2]=-p,p=Math.sqrt(3)*(-f+d)/2,s[3]=p,s[5]=-p;return}if(s[5]=s[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),s[0]=-p+2*g,s[4]=s[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),s[0]=-p+g*Math.cos(h/3),s[2]=-p+g*Math.cos((h+2*Math.PI)/3),s[4]=-p+g*Math.cos((h+4*Math.PI)/3)},hWt=function(e,r,n,i,s,a,o,l){var u=1*n*n-4*n*s+2*n*o+4*s*s-4*s*o+o*o+i*i-4*i*a+2*i*l+4*a*a-4*a*l+l*l,h=9*n*s-3*n*n-3*n*o-6*s*s+3*s*o+9*i*a-3*i*i-3*i*l-6*a*a+3*a*l,d=3*n*n-6*n*s+n*o-n*e+2*s*s+2*s*e-o*e+3*i*i-6*i*a+i*l-i*r+2*a*a+2*a*r-l*r,f=1*n*s-n*n+n*e-s*e+i*a-i*i+i*r-a*r,p=[];uWt(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,x,b,T,C=0;C=0?Tu?(e-s)*(e-s)+(r-a)*(r-a):h-f},nc=function(e,r,n){for(var i,s,a,o,l,u=0,h=0;h=e&&e>=a||i<=e&&e<=a)l=(e-i)/(a-i)*(o-s)+s,l>r&&u++;else continue;return u%2!==0},x0=function(e,r,n,i,s,a,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=IL(h,-u);m=LL(y)}else m=h;return nc(e,r,m)},fWt=function(e,r,n,i,s,a,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,T=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,T];var C=x[1]*l[0]+e,S=x[1]*l[1]+r;return[b,T,C,S]}else return[b,T]},SF=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Wp=function(e,r,n,i,s,a,o,l,u){var h=e-s,d=n-e,f=o-s,p=r-a,g=i-r,m=l-a,y=f*p-m*h,v=d*p-g*h,x=m*d-f*g;if(x!==0){var b=y/x,T=v/x,C=.001,S=0-C,k=1+C;return S<=b&&b<=k&&S<=T&&T<=k?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?SF(e,n,o)===o?[o,l]:SF(e,n,s)===s?[s,a]:SF(s,o,n)===n?[n,i]:[]:[]},gWt=function(e,r,n,i,s){var a=[],o=i/2,l=s/2,u=r,h=n;a.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=IL(d,-l);p=LL(m)}else p=d}else p=n;for(var y,v,x,b,T=0;T2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=T)},get:function(b){return u[b]}},f=0;f0?I=L.edgesTo(N)[0]:I=N.edgesTo(L)[0];var $=i(I);N=N.id(),k[N]>k[_]+$&&(k[N]=k[_]+$,E.nodes.indexOf(N)<0?E.push(N):E.updateItem(N),S[N]=0,C[N]=[]),k[N]==k[_]+$&&(S[N]=S[N]+S[_],C[N].push(_))}else for(var O=0;O0;){for(var V=T.pop(),B=0;B0&&o.push(n[l]);o.length!==0&&s.push(i.collection(o))}return s},_Wt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:NWt,o=i,l,u,h=0;h=2?hC(e,r,n,0,qfe,DWt):hC(e,r,n,0,Wfe)},squaredEuclidean:function(e,r,n){return hC(e,r,n,0,qfe)},manhattan:function(e,r,n){return hC(e,r,n,0,Wfe)},max:function(e,r,n){return hC(e,r,n,-1/0,OWt)}};C5["squared-euclidean"]=C5.squaredEuclidean;C5.squaredeuclidean=C5.squaredEuclidean;function ZD(t,e,r,n,i,s){var a;return Ts(t)?a=t:a=C5[t]||C5.euclidean,e===0&&Ts(t)?a(i,s):a(e,r,n,i,s)}var PWt=Mo({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),UJ=function(e){return PWt(e)},NL=function(e,r,n,i,s){var a=s!=="kMedoids",o=a?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return ZD(e,i.length,o,l,u,h)},AF=function(e,r,n){for(var i=n.length,s=new Array(i),a=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},FWt=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);s[l].push(e[u])}for(var d=0;d=s.threshold||s.mode==="dendrogram"&&e.length===1)return!1;var g=r[a],m=r[i[a]],y;s.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][x.key]&&(l=n[m.key][x.key])):s.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(s);return i},Zfe=function(e,r,n){for(var i=[],s=0;so&&(a=u,o=r[s*e+u])}a>0&&i.push(a)}for(var h=0;hu&&(l=h,u=d)}n[s]=a[l]}return i=Zfe(e,r,n),i},Qfe=function(e){for(var r=this.cy(),n=this.nodes(),i=ZWt(e),s={},a=0;a=_?(P=_,_=L,N=I):L>P&&(P=L);for(var $=0;$0?1:0;k[A%i.minIterations*o+B]=H,V+=H}if(V>0&&(A>=i.minIterations-1||A==i.maxIterations-1)){for(var G=0,W=0;W1||S>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,x.target().id()]}):a.forEach(function(x){var b=x.id();if(x.isNode()){var T=x.degree(!0);T%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(C){return d[b].push(C.id())})}else f[b]=[x.source().id(),x.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(s){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=a[0].id());var g=function(b){for(var T=b,C=[b],S,k,E;d[T].length;)S=d[T].shift(),k=f[S][0],E=f[S][1],T!=E?(d[E]=d[E].filter(function(A){return A!=S}),T=E):!s&&T!=k&&(d[k]=d[k].filter(function(A){return A!=S}),T=k),C.unshift(S),C.unshift(T);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(a.getElementById(y.shift())),m.unshift(a.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(a.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},M8=function(){var e=this,r={},n=0,i=0,s=[],a=[],o={},l=function(f,p){for(var g=a.length-1,m=[],y=e.spawn();a[g].x!=f||a[g].y!=p;)m.push(a.pop().edge),g--;m.push(a.pop().edge),m.forEach(function(v){var x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var T=b.id(),C=b.connectedEdges().intersection(e);y.merge(b),r[T].cutVertex?y.merge(C.filter(function(S){return S.isLoop()})):y.merge(C)})}),s.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)s.push(e.spawn(e.getElementById(p)));else{var y,v,x,b;m.forEach(function(T){y=T.source().id(),v=T.target().id(),x=y===p?v:y,x!==g&&(b=T.id(),o[b]||(o[b]=!0,a.push({x:p,y:x,edge:T})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:s}},sqt={hopcroftTarjanBiconnected:M8,htbc:M8,htb:M8,hopcroftTarjanBiconnectedComponents:M8},R8=function(){var e=this,r={},n=0,i=[],s=[],a=e.spawn(e),o=function(u){s.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=s.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),a=a.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:a,components:i}},aqt={tarjanStronglyConnected:R8,tsc:R8,tscc:R8,tarjanStronglyConnectedComponents:R8},O_e={};[V6,OGt,PGt,BGt,zGt,HGt,qGt,bWt,$b,Bb,_q,IWt,qWt,XWt,rqt,iqt,sqt,aqt].forEach(function(t){Gr(O_e,t)});/*! +Parent cluster`,i.height),e.setNode(i.id,T),e.parent(x)||(de.trace("Setting parent",x,i.id),e.setParent(x,i.id,T))}if(de.info("(Insert) Node XXX"+x+": "+JSON.stringify(e.node(x))),b!=null&&b.clusterNode){de.info("Cluster identified XBX",x,b.width,e.node(x));const{ranksep:T,nodesep:C}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:T+25,nodesep:C});const S=await MRe(d,b.graph,r,n,e.node(x),s),k=S.elem;Tr(b,k),b.diff=S.diff||0,de.info("New compound node after recursive render XAX",x,"width",b.width,"height",b.height),l3t(k,b)}else e.children(x).length>0?(de.trace("Cluster - the non recursive path XBX",x,b.id,b,b.width,"Graph:",e),de.trace(T5(b.id,e)),hn.set(b.id,{id:T5(b.id,e),node:b})):(de.trace("Node - the non recursive path XAX",x,d,e.node(x),a),await s7(d,e.node(x),{config:s,dir:a}))})),await w(async()=>{const x=e.edges().map(async function(b){const T=e.edge(b.v,b.w,b.name);if(de.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),de.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),de.info("Fix",hn,"ids:",b.v,b.w,"Translating: ",hn.get(b.v),hn.get(b.w)),f&&T.selfLoop){if(T.selfLoop.order!==1)return;const C=T.id;T.id=T.selfLoop.id,await g_(h,T),T.id=C;return}await g_(h,T)});await Promise.all(x)},"processEdges")(),de.info("Graph before layout:",JSON.stringify(o0(e))),de.info("############################################# XXX"),de.info("### Layout ### XXX"),de.info("############################################# XXX"),ERe(e),de.info("Graph after layout:",JSON.stringify(o0(e)));let g=0,{subGraphTitleTotalMargin:m}=l3(s);await Promise.all(Fzt(e).map(async function(x){var T;const b=e.node(x);if(de.info("Position XBX => "+x+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,de.info("A tainted cluster node XBX1",x,b.id,b.width,b.height,b.x,b.y,e.parent(x)),hn.get(b.id).node=b,p_(b);else if(e.children(x).length>0){de.info("A pure cluster node XBX1",x,b.id,b.x,b.y,b.width,b.height,e.parent(x)),b.height+=m,e.node(b.parentId);const C=(b==null?void 0:b.padding)/2||0,S=((T=b==null?void 0:b.labelBBox)==null?void 0:T.height)||0,k=S-C||0;de.debug("OffsetY",k,"labelHeight",S,"halfPadding",C),await oD(l,b),hn.get(b.id).node=b}else{const C=e.node(b.parentId);b.y+=m/2,de.info("A regular node XBX1 - using the padding",b.id,"parent",b.parentId,b.width,b.height,b.x,b.y,"offsetY",b.offsetY,"parent",C,C==null?void 0:C.offsetY,b),p_(b)}}));const y=m/2;return ARe(e,y,{mergeSelfLoops:f}).forEach(function({edge:x,start:b,end:T}){de.info("Edge "+b+" -> "+T+": "+JSON.stringify(x),x),x.points.forEach(E=>E.y+=y);const C=e.node(b),S=e.node(T),k=MZ(u,x,hn,r,C,S,n);e6e(x,k)}),e.nodes().forEach(function(x){const b=e.node(x);de.info(x,b.type,b.diff),b.isGroup&&(g=b.diff)}),de.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),IHt=w(async(t,e)=>{var s,a,o,l,u,h;const r=new qo({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((s=t.config)==null?void 0:s.nodeSpacing)||((o=(a=t.config)==null?void 0:a.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");RZ(n,t.markers,t.type,t.diagramId),ZSe(),JSe(),_ke(),oRe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),de.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),x=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},x.originalEdge=y,x.selfLoop={id:y.id,order:1},b.originalEdge=y,b.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",x.startLabelRight="",x.startLabelLeft="",x.endLabelLeft="",x.endLabelRight="",x.arrowTypeStart="none",x.arrowTypeEnd="none",x.id=f+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,b.toCluster=f),b.id=f+"-cyclic-special-2",b.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,x,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),de.warn("Graph at first:",JSON.stringify(o0(r))),Bzt(r),de.warn("Graph after XAX:",JSON.stringify(o0(r)));const i=Ve();await MRe(n,r,t.type,t.diagramId,void 0,i)},"render");const NHt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:ARe,render:IHt},Symbol.toStringTag,{value:"Module"}));async function RRe(t,e){const r=new qo({multigraph:!0,compound:!0}),n=[...e.edges],i=Ve(),s=t.insert("g").attr("class","root"),a=s.insert("g").attr("class","clusters"),o=s.insert("g").attr("class","edges edgePath"),l=s.insert("g").attr("class","edgeLabels"),u=s.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await s7(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await Rr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>O4r);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:a,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:s},nodeElements:h}}w(RRe,"createGraphWithElements");var yfe=5,C8=1e-5,k8=1e-6;function xL(t){const e=[];for(let r=0;r=1-k8||f<=k8||f>=1-k8?null:{point:{x:t.x+d*i,y:t.y+d*s},tA:d,tB:f}}w(_Re,"segmentIntersection");function QW(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(QW,"isHorizontalSeg");function LRe(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(IRe,"getArcSweepFlag");var DHt=.001;function NRe(t,e){if(t.length<2)return t.map(s=>({...s}));const r=t.map(s=>({...s})),n=e.arrowTypeStart&&Oa[e.arrowTypeStart];if(n){const s=t[0],a=t[1],o=Math.atan2(a.y-s.y,a.x-s.x);r[0].x=s.x+n*Math.cos(o),r[0].y=s.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&Oa[e.arrowTypeEnd];if(i){const s=t.length,a=t[s-2],o=t[s-1],l=Math.atan2(o.y-a.y,o.x-a.x);r[s-1].x=o.x-i*Math.cos(l),r[s-1].y=o.y-i*Math.sin(l)}return r}w(NRe,"applyMarkerOffsets");function DRe(t,e,r,n,i){const s=t.point.x,a=t.point.y,o={x:s-e*t.r,y:a-r*t.r},l={x:s+e*t.r,y:a+r*t.r},u=[`L${Pb(o)}`];return i==="arc"?u.push(`A${sh(t.r)},${sh(t.r)} 0 0 ${n} ${Pb(l)}`):u.push(`M${Pb(l)}`),u}w(DRe,"emitJump");function JW(t,e,r,n){const i=e.x-t.x,s=e.y-t.y,a=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,s),u=Math.hypot(a,o);if(l0){const b=JW(i[u-1],i[u],i[u+1]??i[u],yfe);b&&(m=b.cutLen)}let y=d,v=null;s&&ub.t-T.t);for(const b of x)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bT){const C=T/2;x[b].r=Math.min(x[b].r,C),x[b+1].r=Math.min(x[b+1].r,C)}}for(const b of x)b.r=2?n:null}catch{return null}}w(BRe,"decodeDataPoints");function FRe(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const s=[],a=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;a.set(u.id,d);const p=BRe(d.getAttribute("data-points"))??u.points;s.push({...u,points:p})}const o=LRe(s);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of s){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!$Re(f))continue;const p=a.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!PRe(b))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,x=ORe(u,h,r);if(p.setAttribute("d",x),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),T=Math.max(0,b-y-v),C=`0 ${y} ${T} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}w(FRe,"applyLineJumpsToSvg");async function zRe(t,e){var i,s;for(const a of t.nodes)a.isGroup?await oD(e.clusters,a):p_(a);const r=new Map;for(const a of t.nodes)a!=null&&a.id&&r.set(a.id,a);for(const a of t.edges){const o=a.start?r.get(a.start)??{}:{},l=a.end?r.get(a.end)??{}:{},u=MZ(e.edgePaths,{...a},{},t.type,o,l,t.diagramId);a.label&&await g_(e.rootGroups,a),a.label&&VRe(a,u)}const n=(s=(i=t.config)==null?void 0:i.swimlane)==null?void 0:s.lineHops;if(n!==!1){const a=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));FRe(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:a})}}w(zRe,"adjustLayout");function VRe(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=br(),{subGraphTitleTotalMargin:i}=l3({flowchart:n.flowchart??{}});if(t.label){const s=S6.get(t.id);let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const s=Hs.get(t.id).startLeft;let a=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Hs.get(t.id).startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Hs.get(t.id).endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Hs.get(t.id).endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}}w(VRe,"positionEdgeLabel");var oF="__swimlane_default__",OHt=21,vfe=20;function eq(t){return Math.max(t.padding??vfe,vfe)}w(eq,"topLaneHorizontalPadding");function HRe(t){const{x:e,y:r,width:n,height:i}=t,s=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof s!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(s)||n<=0||i<=0){delete t.groupTitleRect;return}const a=r-i/2,o=Math.min(s,r+i/2),l=Math.min(OHt,Math.max(0,o-a)),u=a+l;if(u<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:a,bottom:u}}w(HRe,"assignTopLaneTitleRect");function GRe(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const s of t.nodes??[])s.isGroup&&!s.parentId&&(s.shape="swimlane",e&&(s.direction=e));const n=r.filter(s=>!s.isGroup&&!s.parentId);if(n.length===0)return;let i=r.find(s=>s.id===oF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:oF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const s of n)s.parentId=oF}w(GRe,"prepareLayoutForSwimlanes");function WRe(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),s=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...s].map(l=>l.id),edges:r,layout:t,nodeById:e}}w(WRe,"toGraphView");function qRe(t,e,r,n){const{layout:i}=t,s=t.nodeById,a=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=s.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*a;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(x=>x.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const x of p){const b=x.x??r.x[x.id],T=x.y??r.y[x.id],C=x.width??0,S=x.height??0;b!=null&&T!=null&&(g=Math.min(g,b-C/2),m=Math.max(m,b+C/2),y=Math.min(y,T-S/2),v=Math.max(v,T+S/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const x=f.padding??20,b=f.parentId?x:2*eq(f),T=x,C=Math.max(0,m-g)+b,S=Math.max(0,v-y)+T,k=(g+m)/2,E=(y+v)/2;f.x=k,f.y=E,f.width=C,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),x=m+2*v,b=(f+p)/2;for(const A of d)A.y=b,A.height=x,A.swimlaneContentTop=f;const T=[...d].sort((A,R)=>{const _=A.x??0,P=R.x??0;return _-P}),C=[],S=[],k=[];for(const A of T){const R=h.get(A.id);if(!R)continue;const _=Math.max(0,R.maxX-R.minX)+2*eq(A),P=(R.minX+R.maxX)/2;C.push(A.id),S.push(P),k.push(_)}const E=C.length;if(E>0){const A=new Map;if(E===1)A.set(C[0],k[0]);else{const R=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:$b(e,r,n,i)}:void 0}w(bJ,"measuredNodeRect");function xJ(t){if(t.isGroup)return;const e=bJ(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(xJ,"nodeBoundsInfoFor");function Nu(t,e,r=Ja){return Math.abs(t.x-e.x)r}w(Is,"isHorizontalSegment");function Ns(t,e,r=Ja){return On(t,e,r)&&Math.abs(t.y-e.y)>r}w(Ns,"isVerticalSegment");function _l(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}w(_l,"overlapLength");function Ad(t,e,r=Ja){return t.horizontal&&e.horizontal&&Bn(t.a,e.a,r)?_l(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&On(t.a,e.a,r)?_l(t.a.y,t.b.y,e.a.y,e.b.y):0}w(Ad,"sameAxisSegmentOverlapLength");function C5(t,e=Ja){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Nu(i,n,e))&&r.push({x:n.x,y:n.y})}return r}w(Yn,"dedupeConsecutivePoints");function wJ(t,e=Ja){if(!t||t.length!==4)return;const[r,n,i,s]=t;return Is(r,n,e)&&Ns(n,i,e)&&Is(i,s,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:s}:Ns(r,n,e)&&Is(n,i,e)&&Ns(i,s,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:s}:void 0}w(wJ,"classifyThreeSegmentRoute");function UD(t,e,r,n=0){const i=Math.min(t.x,e.x),s=Math.max(t.x,e.x),a=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return s>r.left-n&&ir.top-n&&ae.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}w(YRe,"rectContainsRect");function wL(t,e){return t.lefte.left&&t.tope.top}w(wL,"rectsOverlap");function tq(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(tq,"inflateRect");function $b(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w($b,"rectFromCenterSize");function gc(t){var e;return(e=bJ(t))==null?void 0:e.rect}w(gc,"rectOfNodeBounds");function F1(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}w(F1,"portForRectSide");function CJ(t,e,r,n,i,s=Ja){const a=e==="left"||e==="right",o=n==="left"||n==="right";if(a&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Bn(t,r,s))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Bn(t,r,s))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!a&&!o){if(e===n){if(On(t,r,s))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(On(t,r,s))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(a&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}w(CJ,"buildOrthogonalPortPath");function kJ(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}w(kJ,"buildSameSideTrackPath");function YD(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=xJ(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(YD,"collectRealNodeBounds");function rm(t){const e=[],r=[];for(const n of t){const i=xJ(n);if(!i)continue;const s={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(s):e.push(s)}return{realNodeRects:e,labelNodeRects:r}}w(rm,"collectNodeRectEntries");function jRe(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,s=n.y??0,a=n.width??0,o=n.height??0;r.push({nodeId:n.id,...$b(i,s,a,o)})}return r}w(jRe,"collectLayoutNodeRects");function SJ(t,e,r=Ja){const n=t.start,i=t.end;if(!n||!i)return;const s=e.get(n),a=e.get(i);if(!(!s||!a))return{srcId:n,dstId:i,srcInfo:s,dstInfo:a,collinearX:Math.abs(s.cx-a.cx)g||fv)return!1;const x=Math.abs(m-h.a.x)i:s&&o&&Bn(t,r,i)?_l(t.x,e.x,r.x,n.x)>i:!1}w(XRe,"sameAxisSegmentsOverlap");function TL(t,e,r,n,{epsilon:i=Ja,skipDegenerateOther:s=!1}={}){for(const a of r){if(a===n||a.isLayoutOnly)continue;const o=a.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+Ja&&t=2?e[e.length-2]:void 0,l=(a?On(a,i):!1)?{x:i.x,y:s.y}:{x:s.x,y:i.y};e.push(l)}e.push(s)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!Nu(i,n))&&r.push(n)}return r}w(CL,"orthogonalizePolyline");function Pd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=ZRe(e);if(e=n.points,!n.changed)break}return e}w(Pd,"simplifyPolyline");var Zr=.001,$Ht=.5,bfe=4;function AJ(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const s=i-n;if(s<0||s>=t.length)return t;const a=QRe(t[i],t[s],e);return r?[a,...t.slice(i)]:[...t.slice(0,i+1),a]}w(nq,"clipEndpoint");function JRe(t,e){for(const r of t){const n=AJ(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=nq(i,n.srcRect,!0)),n.dstRect&&(i=nq(i,n.dstRect,!1)),i=Pd(CL(i)),i=MJ(i,n.srcRect,n.dstRect),n.edge.points=Pd(CL(i))}}w(JRe,"clipEdgeEndpointsToNodeBoundaries");function iq(t,e,r,n=!1){if(Bn(t,e,Zr)){if(e.yr.bottom+Zr)return e;if(n){if(t.xr.right+Zr)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(On(t,e,Zr)){if(e.xr.right+Zr)return e;if(n){if(t.yr.bottom+Zr)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}w(iq,"snapEndpointToBoundary");function kL(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}w(e9e,"intersectRanges");function aq(t,e){return e==="left"||e==="right"?SL(t.top,t.bottom):SL(t.left,t.right)}w(aq,"clearanceRangeForSide");function EL(t,e,r){const n=t.y>=r.top-Zr&&t.y<=r.bottom+Zr,i=t.x>=r.left-Zr&&t.x<=r.right+Zr;if(Bn(t,e,Zr)&&n){if(Math.abs(t.x-r.left)0?e9e(s):void 0}w(t9e,"straightClearanceRange");function oq(t,e,r,n,i){const s=t9e(t,e,r,n,i);if(!s)return;const a=i?t.y:t.x,o=Math.min(s.hi,Math.max(s.lo,a));if(!(Math.abs(o-a)({...o}));for(let o=e;o>=0&&o=r.left-Zr&&Math.max(t.x,e.x)<=r.right+Zr,i=Math.min(t.y,e.y)>=r.top-Zr&&Math.max(t.y,e.y)<=r.bottom+Zr;if(Math.abs(t.y-r.top)n.bottom+Zr;case"left":return Bn(e,r,Zr)&&r.xn.right+Zr}}w(uq,"leavesOutward");function hq(t,e,r){if(t.length<3)return t;if(r){const s=cq(t[0],t[1],e);return s&&uq(s,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=cq(t[n-1],t[n],e);return i&&uq(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(hq,"collapseOwnBorderStub");function i9e(t,e,r){let n=t;if(e){const s=kL(n,0,1);if(s){const a=iq(s,n[0],e);a!==n[0]&&(n=[a,...n.slice(1)])}n=hq(n,e,!0)}if(r){const s=n.length-1,a=kL(n,s,-1);if(a){const o=iq(a,n[s],r,!0);o!==n[s]&&(n=[...n.slice(0,s),o])}n=hq(n,r,!1)}const i=MJ(n,e,r);return i!==n||n.length===2?i:(e&&(n=lq(n,e,!0)),r&&(n=lq(n,r,!1)),n)}w(i9e,"snapAndCollapseEndpoints");function dq(t,e){for(const r of t){const n=AJ(r,e,2);if(!n)continue;const i=Yn(n.points,Zr),s=i9e(i,n.srcRect,n.dstRect);if(s.length<3){n.edge.points=s;continue}const a=[s[0],{...s[0]},...s.slice(1,-1),s[s.length-1],{...s[s.length-1]}];n.edge.points=a}}w(dq,"prepareEdgeEndpointsForRenderer");function RJ(t){return new Map(t.map(e=>[e.id,e]))}w(RJ,"buildNodeMap");function s9e(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}w(s9e,"resolveTopLevelGroupId");function fq(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}w(fq,"groupDepth");function _J(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const s of t){const a=s.x,o=s.y;if(typeof a!="number"||typeof o!="number")continue;const l=s.width??0,u=s.height??0;e=Math.min(e,a-l/2),r=Math.max(r,a+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}w(_J,"boundsForChildren");function a9e(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}w(a9e,"applyGroupBounds");function o9e(t){const e=RJ(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>fq(i,e)-fq(n,e));for(const n of r){const i=t.filter(a=>a.parentId===n.id),s=_J(i);s&&a9e(n,s)}}w(o9e,"recomputeNestedGroupBounds");function AL(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let s=1/0,a=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(s=Math.min(s,u),a=Math.max(a,u))}if(!Number.isFinite(s)||!Number.isFinite(a))return!1;const o=w(l=>s+a-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}w(AL,"mirrorAxis");function l9e(t){return(t.nodes??[]).some(r=>!r.isGroup)?AL(t,"y"):!0}w(l9e,"applyBtDirectionTransform");function c9e(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(N=>!N.isGroup);let s=1/0,a=1/0;for(const N of i){const L=N.x??0,I=N.y??0;L0?Math.max(1,h/d):1;for(const N of i){const L=N.x??0,$=((N.y??0)-a)*f+o,O=L-s;N.x=$,N.y=O}for(const N of n)if(N.points)for(const L of N.points){const I=L.x,O=(L.y-a)*f+o,D=I-s;L.x=O,L.y=D}o9e(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&AL(t,"x"),!0;const g=RJ(r),m=new Map;for(const N of r){if(N.isGroup)continue;const L=s9e(N,g);if(!L)continue;const I=m.get(L)??[];I.push(N),m.set(L,I)}let y=0;for(const N of p){const L=N.padding??0;L>y&&(y=L)}const v=[];let x=1/0,b=-1/0;for(const N of p){const L=m.get(N.id)??[],I=_J(L);I&&(x=Math.min(x,I.minX),b=Math.max(b,I.maxX),v.push({lane:N,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(x===1/0||b===-1/0)return!0;const T=Math.max(0,b-x),C=Math.max(y,10),S=T+2*C,k=o+S,R=(x+b)/2-S/2-o,_=R+k/2,P=Math.max(y,o);v.sort((N,L)=>N.centerY-L.centerY);for(let N=0;Nf.cy?v.bottom:v.top,P=f.cx+x;if(P<=v.left+Gu||P>=v.right-Gu)continue;b={x:P,y:_},T={x:P,y:o.y},C={x:o.x,y:o.y}}else{const _=p.cx>f.cx?v.right:v.left,P=f.cy+x;if(P<=v.top+Gu||P>=v.bottom-Gu)continue;b={x:_,y:P},T={x:o.x,y:P},C={x:o.x,y:o.y}}const S=Nu(b,T,Gu),k=Nu(T,C,Gu);if(S&&k||!S&&Xs(b,T,n,[h],1)||!k&&Xs(T,C,n,[d],1))continue;const E=!S&&TL(b,T,t,i,{epsilon:Gu,skipDegenerateOther:!0}),A=!k&&TL(T,C,t,i,{epsilon:Gu,skipDegenerateOther:!0});if(!(E||A)){S?y=[T,C]:k?y=[b,T]:y=[b,T,C];break}}y&&(i.points=y)}}w(u9e,"portSwapToLShape");function h9e(t,e){const{realNodeRects:s,labelNodeRects:a}=rm(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Yn(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,x=f.y-p.y;if(Math.hypot(v,x)<.001)continue;const T=Is(f,d,.001),C=Ns(f,d,.001),S=Is(p,f,.001),k=Ns(p,f,.001);if(!(T&&k||C&&S))continue;const E=o.end,A=o.start,R=E?e.get(E):void 0;if(!R)continue;const _=R.x??0,P=R.y??0,N=gc(R);if(!N)continue;let L,I;if(k){const B=x<0;L={x:_,y:p.y},I={x:_,y:B?N.bottom:N.top}}else{const B=v>0;L={x:p.x,y:P},I={x:B?N.right:N.left,y:P}}if(Xs(L,I,s,E?[E]:[],-2)||Xs(L,I,a,[],-2))continue;if(A){const B=e.get(A),H=B?gc(B):void 0;if(H&&TJ(L,H,2))continue}const $=w((B,H)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${H.x.toFixed(3)},${H.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let B=0;B{for(const G of t){if(G===o||G.isLayoutOnly)continue;const W=G.points;if(!(!W||W.length<2))for(let K=0;K=0){const B=u[h-3],H=[A,E].filter(G=>!!G);if(Xs(B,L,s,H,-2)||D(B,L))continue}const z=[...u.slice(0,h-2),L,I];o.points=z;const V=o.labelNodeId;if(V){const B=e.get(V);if(B){const H=B.width??0,G=B.height??0;if(H>0&&G>0){let W,K,q=-1;for(let oe=0;oe=H+2||me&&re>=G+2)&&re>q&&(q=re,W=(Q.x+Z.x)/2,K=(Q.y+Z.y)/2)}W!==void 0&&K!==void 0&&(B.x=W,B.y=K)}}}}}w(h9e,"collapseShortTerminalStub");var yr=.001,Xa=8,yn=C5,lF=w((t,e)=>On(t,e,yr)||Bn(t,e,yr),"orthogonallyAligned");function d9e(t,e){const i=w((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,x=g.y-y;let b=(p.width??0)/2,T=(p.height??0)/2;return Math.abs(x)*b>Math.abs(v)*T?(x<0&&(T=-T),{x:m+(x===0?0:T*v/x),y:y+T}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*x/v)})},"rectIntersect"),s=w((p,g)=>{const m=Yn(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,x=v?gc(v):void 0;if(!v||!y||!x)return;const b=g?m[0]:m[m.length-1],T=g?m[1]:m[m.length-2],C=i(v,b);let S=b;if(lF(T,C)&&(S=T),On(C,S,yr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,S.y),max:Math.max(C.y,S.y),boundary:C,railEnd:S,rect:x};if(Bn(C,S,yr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,S.x),max:Math.max(C.x,S.x),boundary:C,railEnd:S,rect:x}},"terminalLaneFor"),a=w((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&On(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Bn(p.boundary,g.boundary,1),"sameTerminalFace"),l=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:a(p,g)>=Xa&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=w((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=a(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=w((p,g)=>{const m=Yn(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!w(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Bn(y,p.boundary,yr)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?On(y,p.boundary,yr)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&Nu(m[1],p.railEnd,yr),k=m.slice(S?2:1),E=k[0];return E&&!lF(E,v)?void 0:[y,v,...k]}const b=m.length>1&&Nu(m[m.length-2],p.railEnd,yr),T=m.slice(0,b?-2:-1),C=T[T.length-1];if(!(C&&!lF(C,v)))return[...T,v,y]},"shiftedCandidate"),d=w(p=>{const g=p.edge,m=Yn(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,x=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!x||!b)return!1;const T=x.x??0,C=x.y??0,S=b.x??0,k=b.y??0,[E,A]=m;return Bn(E,A,yr)&&Math.abs(C-k)<1&&Math.abs(T-S)>1||On(E,A,yr)&&Math.abs(T-S)<1&&Math.abs(C-k)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[s(y,!0),s(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const E=d(S),A=d(k);return E!==A?Number(E)-Number(A):+!k.atStart-+!S.atStart});for(const S of C){for(const k of f){const E=h(S,k);if(!E)continue;const A=s({...S.edge,points:E},S.atStart);if(!(!A||g.some(R=>R.edge!==S.edge&&(l(A,R)||T&&u(A,R))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}w(d9e,"separateSharedRenderedTerminalLanes");function f9e(t,e){const{realNodeRects:n,labelNodeRects:i}=rm(e.values()),s=w((o,l)=>{const u=o.start,h=o.end,d=yn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Xs(p.a,p.b,n,f,-2)||Xs(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of yn(Yn(g)))if(Ad(m,y,.5)>=Xa||j0(m.a,m.b,y.a,y.b,yr))return!1}}return!0},"candidateIsSafe"),a=w((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=Is(u,h)&&Ns(h,d)&&Is(d,f)&&Ns(f,p)&&On(u,f,yr)&&On(u,p,yr)&&On(h,d,yr)&&(h.x-u.x)*(f.x-d.x)<0,m=Ns(u,h)&&Is(h,d)&&Ns(d,f)&&Is(f,p)&&Bn(u,f,yr)&&Bn(u,p,yr)&&Bn(h,d,yr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Yn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ns(u,h)&&Is(h,d)&&Ns(d,f)&&Is(f,p)&&Ns(p,y)&&On(u,p,yr)&&On(u,y,yr)&&On(d,f,yr)&&(d.x-h.x)*(p.x-f.x)<0,x=Is(u,h)&&Ns(h,d)&&Is(d,f)&&Ns(f,p)&&Is(p,y)&&Bn(u,p,yr)&&Bn(u,y,yr)&&Bn(d,f,yr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!x))return Yn([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Yn(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=a(h,d);if(!(!f||!s(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}w(f9e,"collapseRedundantRectangularDoglegs");function pq(t,e){const{realNodeRects:s,labelNodeRects:a}=rm(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=w((g,m,y)=>Yn(g===m?y??[]:g.points??[]),"pointsFor"),u=w((g,m)=>{let y=0;for(let v=0;v{const m=yn(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return s.filter(v=>{if(y.includes(v.id))return!1;const x=v.rect;return m.horizontal?_l(m.a.x,m.b.x,x.left,x.right)>=Xa&&m.a.y>=x.top-2&&m.a.y<=x.bottom+2:_l(m.a.y,m.b.y,x.top,x.bottom)>=Xa&&m.a.x>=x.left-2&&m.a.x<=x.right+2})},"blockingRectsFor"),f=w((g,m,y)=>{const v=g.map(b=>({...b}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const x=Pd(Yn(v));return yn(x).length===x.length-1?x:void 0},"candidateByMovingRail"),p=w((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),x=yn(m);if(x.length!==m.length-1)return!1;for(const b of x)if(Xs(b.a,b.b,s,v,-2)||Xs(b.a,b.b,a,[],-2))return!1;for(const b of o)if(b!==g){for(const T of x)for(const C of yn(l(b)))if(Ad(T,C,.5)>=Xa)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const x=l(v),b=h(x);if(!b)continue;const T=d(v,b.segment);if(T.length===0)continue;const C=b.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of C){const k=f(x,b.segment,S);if(!(!k||!p(v,k,m))){v.points=k,y=!0;break}}if(y)break}if(!y)return}}w(pq,"liftObstacleHuggingSameSideRails");function gq(t,e){const n=w(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=w(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+yr||h>=u.bottom-yr?!1:_l(l.a.x,l.b.x,u.left,u.right)>=Xa},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(i).filter(l=>!!l);if(a.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Yn(l.points??[]);for(const h of yn(u))for(const d of a)s(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=yr))for(const l of a){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}w(gq,"liftTopLaneTitleBandsAboveRails");function mq(t,e){const n=w(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=w(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+yr||d>=h.right-yr?!1:_l(u.a.y,u.b.y,h.top,h.bottom)>=Xa},"verticalSegmentIntersectsTitle"),a=w((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+yr||d>=h.bottom-yr?!1:_l(u.a.x,u.b.x,h.left,h.right)>=Xa},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Yn(u.points??[]);for(const d of yn(h))for(const f of o)if(s(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(a(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=yr))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}w(mq,"shiftLeftLaneTitleBandsLeftOfRails");function p9e(t,e){const{realNodeRects:n}=rm(e.values()),i=t.filter(g=>!g.isLayoutOnly),s=w((g,m=new Map)=>Yn(m.get(g)??g.points??[]),"replacementPointsFor"),a=w((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+Lc(s(y,g)),0),"totalBends"),l=w(g=>{const m=s(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!Is(y,v,yr)&&!Ns(y,v,yr)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=w((g,m)=>{const y=s(g);if(y.length<3)return;const v=y[0],x=y[1];let b;if(Is(v,x,yr))b={x:x.x,y:m.tailStart.y};else if(Ns(v,x,yr))b={x:m.tailStart.x,y:x.y};else return;const T=Pd(Yn([v,x,b,m.tailStart,m.terminal]));return yn(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),h=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of yn(m))if(Xs(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=w((g,m,y)=>{for(const v of i)if(v!==g){for(const x of yn(m))for(const b of yn(s(v,y)))if(Ad(x,b,.5)>=Xa)return!0}return!1},"pathHasSharedTrack"),f=w((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=w(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||s(m).length<4)continue;const x=g.get(y)??[];x.push(m),g.set(y,x)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=a();if(m===0)return;const y=o();let v,x=m,b=y;for(const T of p().values())for(let C=0;C=m||L>x||L===x&&I>=b||(v=N,x=L,b=I)}if(!v)return;for(const[T,C]of v)T.points=C}}w(p9e,"swapDestinationTerminalTailsToReduceCrossings");function g9e(t,e){const{realNodeRects:s,labelNodeRects:a}=rm(e.values()),o=t.filter(T=>!T.isLayoutOnly),l=w((T,C=new Map)=>Yn(C.get(T)??T.points??[]),"replacementPointsFor"),u=w((T=new Map)=>{let C=0;for(let S=0;So.reduce((C,S)=>C+Lc(l(S,T)),0),"totalBends"),d=w(T=>{const C=T.start,S=T.end,k=C?e.get(C):void 0,E=S?e.get(S):void 0,A=k?gc(k):void 0,R=E?gc(E):void 0;return A&&R?{src:A,dst:R}:void 0},"endpointRectsFor"),f=w((T,C,S)=>{if(S.index<=0||S.index+1>=C.length-1)return;const k=d(T);if(k){if(S.vertical){const E=S.a.x,A=Math.min(k.src.left,k.dst.left),R=Math.max(k.src.right,k.dst.right),_=ER+yr?"right":void 0;return _?{edge:T,points:C,segmentIndex:S.index,axis:"vertical",side:_,coord:E,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const E=S.a.y,A=Math.min(k.src.top,k.dst.top),R=Math.max(k.src.bottom,k.dst.bottom),_=ER+yr?"bottom":void 0;return _?{edge:T,points:C,segmentIndex:S.index,axis:"horizontal",side:_,coord:E,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=w(()=>{const T=[];for(const C of o){const S=l(C);for(const k of yn(S)){const E=f(C,S,k);E&&T.push(E)}}return T},"collectExternalRails"),g=w((T,C)=>T.edge!==C.edge&&T.axis===C.axis&&T.side===C.side&&_l(T.min,T.max,C.min,C.max)>=Xa,"railsInteract"),m=w(T=>{const C=[],S=new Set;for(const k of T){if(S.has(k))continue;const E=[k],A=[];for(S.add(k);E.length>0;){const R=E.pop();A.push(R);for(const _ of T)!S.has(_)&&g(R,_)&&(S.add(_),E.push(_))}A.length>1&&C.push(A)}return C},"connectedComponents"),y=w(T=>{const C=[];for(const S of T)C.some(k=>Math.abs(k-S.coord){const C=T.map(E=>E.coord),S=y(T),k=[];if(T.length<=6){const E=new Array(S.length).fill(!1),A=[],R=w(()=>{if(A.length===T.length){A.some((_,P)=>Math.abs(_-C[P])>=yr)&&k.push([...A]);return}for(const[_,P]of S.entries())E[_]||(E[_]=!0,A.push(P),R(),A.pop(),E[_]=!1)},"visit");return R(),k}for(let E=0;E{const S=new Map;for(const[E,A]of T.entries()){const R=C[E],_=S.get(A.edge)??A.points.map(P=>({x:P.x,y:P.y}));A.axis==="vertical"?(_[A.segmentIndex].x=R,_[A.segmentIndex+1].x=R):(_[A.segmentIndex].y=R,_[A.segmentIndex+1].y=R),S.set(A.edge,_)}const k=new Map;for(const[E,A]of S){const R=Pd(Yn(A));if(yn(R).length!==R.length-1)return;k.set(E,R)}return k},"replacementsForAssignment"),b=w(T=>{for(const[C,S]of T){const k=[C.start,C.end].filter(E=>!!E);for(const E of yn(S))if(Xs(E.a,E.b,s,k,-2)||Xs(E.a,E.b,a,[],-2))return!1}for(let C=0;C=Xa)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const C=u();if(C===0)return;let S,k=C,E=h(),A=Number.POSITIVE_INFINITY;for(const R of m(p()))for(const _ of v(R)){const P=x(R,_);if(!P||!b(P))continue;const N=u(P);if(N>=C)continue;const L=h(P),I=R.reduce(($,O,D)=>$+Math.abs(_[D]-O.coord),0);N>k||N===k&&(L>E||L===E&&I>=A)||(S=P,k=N,E=L,A=I)}if(!S)return;for(const[R,_]of S)R.points=_}}w(g9e,"reassignCrossingExternalRailChannels");function m9e(t,e){const{realNodeRects:n,labelNodeRects:i}=rm(e.values()),s=t.filter(p=>!p.isLayoutOnly),a=w((p,g,m)=>Yn(p===g?m??[]:p.points??[]),"pointsFor"),o=w(p=>yn(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=w((p,g)=>{let m=0;for(let y=0;y{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&_l(p.a.x,p.b.x,g.left,g.right)>=Xa}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&_l(p.a.y,p.b.y,g.top,g.bottom)>=Xa}return!1},"segmentRunsAlongRectBorder"),h=w(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),x=v?gc(v):void 0;x&&m.push(x)}return m},"endpointRectsFor"),d=w((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],x=p[g+3],b=Is(m,y,yr)&&Ns(y,v,yr)&&Is(v,x,yr),T=Ns(m,y,yr)&&Is(y,v,yr)&&Ns(v,x,yr);if(!b&&!T)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(x.x-v.x):Math.sign(y.y-m.y)!==Math.sign(x.y-v.y)))return[];const S=On(m,x,yr)||Bn(m,x,yr)?[]:[{x:m.x,y:x.y},{x:x.x,y:m.y}],k=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(A=>[...p.slice(0,g+1),A,...p.slice(g+3)]),E=new Set;return k.map(A=>Pd(Yn(A))).filter(A=>{if(yn(A).length!==A.length-1||!A.some(_=>Nu(_,x,yr)))return!1;const R=A.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return E.has(R)?!1:(E.add(R),!0)})},"shortcutCandidatesAt"),f=w((p,g,m)=>{const y=[p.start,p.end].filter(x=>!!x),v=h(p);for(const x of yn(g))if(Xs(x.a,x.b,n,y,-2)||Xs(x.a,x.b,i,[],-2)||v.some(b=>u(x,b)))return!1;for(const x of s)if(x!==p){for(const b of yn(g))for(const T of yn(a(x)))if(Ad(b,T,.5)>=Xa)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const T of s){const C=a(T),S=Lc(C,yr),k=o(C);for(let E=0;E<=C.length-4;E++)for(const A of d(C,E)){const R=Lc(A,yr),_=o(A);if(!(Rv||N===v&&(R>x||R===x&&_>=b)||(m=T,y=A,v=N,x=R,b=_)}}if(!m||!y)return;m.points=y}}w(m9e,"shortcutRedundantOrthogonalJogs");function y9e(t,e){const a=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const he=ce.x??0,Te=ce.y??0,ge=gc(ce);ge&&a.push({id:String(ce.id??""),cx:he,cy:Te,rect:ge})}if(a.length===0)return;const o=new Map(a.map(ce=>[ce.id,ce])),l=a.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...a.map(ce=>ce.rect.top))-20,bottom:Math.max(...a.map(ce=>ce.rect.bottom))+20,left:Math.min(...a.map(ce=>ce.rect.left))-20,right:Math.max(...a.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,he)=>[ce,he])),p=w(ce=>{const he=ce==="left"||ce==="top"?-1:1,Te=[];for(let ge=0;ge<=2;ge++)Te.push(h[ce]+he*20*ge);return Te},"outwardTracksForSide"),g=w((ce,he=new Map)=>Yn(he.get(ce)??ce.points??[]),"replacementPointsFor"),m=w((ce,he)=>{let Te=0;for(const ge of ce)for(const He of he)j0(ge.a,ge.b,He.a,He.b,yr)&&Te++;return Te},"crossingCountBetweenSegments"),y=w((ce,he)=>m(yn(ce),yn(he)),"crossingCountBetweenPaths"),v=w((ce=new Map)=>{let he=0;const Te=[],ge=new Set,He=[],we=w(Me=>{ge.has(Me)||(ge.add(Me),He.push(Me))},"addEdge");for(let Me=0;Me0&&(he+=ne,Te.push({first:je,second:Ce,count:ne}),we(je),we(Ce))}}return He.sort((Me,je)=>(f.get(Me)??0)-(f.get(je)??0)),{count:he,pairs:Te,edgeSet:ge,edges:He}},"crossingSnapshot"),x=w((ce,he)=>{const Te=new Set(he.keys());if(Te.size===0)return ce.count;let ge=0;for(const we of ce.pairs)(Te.has(we.first)||Te.has(we.second))&&(ge+=we.count);let He=0;for(let we=0;we{const he=new Map;for(const He of ce.pairs){const we=he.get(He.first)??new Set;we.add(He.second),he.set(He.first,we);const Me=he.get(He.second)??new Set;Me.add(He.first),he.set(He.second,Me)}const Te=[],ge=new Set;for(const He of ce.edges){if(ge.has(He))continue;const we=[He],Me=[];for(ge.add(He);we.length>0;){const je=we.pop();Me.push(je);for(const le of he.get(je)??[])ge.has(le)||(ge.add(le),we.push(le))}Me.sort((je,le)=>(f.get(je)??0)-(f.get(le)??0)),Me.length>1&&Te.push(Me)}return Te},"crossingComponents"),T=w(ce=>[ce.start,ce.end].filter(he=>!!he),"endpointIdsFor"),C=w(ce=>{const he=[];for(const Te of b(ce)){const ge=new Set(Te),He=new Set(Te.flatMap(Me=>T(Me))),we=[...Te];for(const Me of d)ge.has(Me)||T(Me).some(je=>He.has(je))&&we.push(Me);we.sort((Me,je)=>(f.get(Me)??0)-(f.get(je)??0)),he.push(we)}return he},"pairSearchGroups"),S=w((ce,he,Te)=>x(ce,new Map([[he,Te]])),"crossingCountWithSingleReplacement"),k=w(ce=>{const he=new Map;for(const Te of ce.pairs)he.set(Te.first,(he.get(Te.first)??0)+Te.count),he.set(Te.second,(he.get(Te.second)??0)+Te.count);return he},"currentCrossingsByEdge"),E=w(ce=>ce.slice(1).reduce((he,Te,ge)=>{const He=ce[ge];return he+Math.abs(Te.x-He.x)+Math.abs(Te.y-He.y)},0),"pathLength"),A=w((ce=new Map)=>d.reduce((he,Te)=>he+Lc(g(Te,ce)),0),"totalBends"),R=w((ce=new Map)=>d.reduce((he,Te)=>he+E(g(Te,ce)),0),"totalLength"),_=w((ce,he,Te=new Map)=>{const ge=yn(he);for(const He of d)if(He!==ce){for(const we of ge)for(const Me of yn(g(He,Te)))if(Ad(we,Me,.5)>=Xa)return!0}return!1},"pathHasSegmentConflict"),P=w((ce,he)=>{const Te=[ce.start,ce.end].filter(ge=>!!ge);for(const ge of yn(he))if(Xs(ge.a,ge.b,l,Te,-2))return!0;return!1},"pathHitsNode"),N=w((ce,he)=>{const Te=Pd(Yn(he));yn(Te).length===Te.length-1&&ce.push(Te)},"pushOrthogonalCandidate"),L=w(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=w((ce,he,Te)=>{switch(he){case"left":return Math.min(ce.x,Te.x)-20;case"right":return Math.max(ce.x,Te.x)+20;case"top":return Math.min(ce.y,Te.y)-20;case"bottom":return Math.max(ce.y,Te.y)+20}},"localTrackForSameSide"),$=w((ce,he,Te,ge)=>{const He=Te==="left"||Te==="top"?-1:1,we=[I(he,Te,ge),h[Te]];for(const Me of we)for(let je=0;je<=2;je++)N(ce,kJ(he,Te,ge,Me+He*20*je))},"addSameSideCandidates"),O=w((ce,he,Te,ge,He)=>{for(const we of p(Te))for(const Me of p(He))N(ce,[he,{x:we,y:he.y},{x:we,y:Me},{x:ge.x,y:Me},ge])},"addHorizontalToVerticalCandidates"),D=w((ce,he,Te,ge,He)=>{for(const we of p(Te))for(const Me of p(He))N(ce,[he,{x:he.x,y:we},{x:Me,y:we},{x:Me,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=w((ce,he,Te,ge,He)=>{const we=[...p("top"),...p("bottom")];for(const Me of p(Te))for(const je of p(He))for(const le of we)N(ce,[he,{x:Me,y:he.y},{x:Me,y:le},{x:je,y:le},{x:je,y:ge.y},ge])},"addHorizontalPairCandidates"),z=w((ce,he,Te,ge,He)=>{const we=[...p("left"),...p("right")];for(const Me of p(Te))for(const je of p(He))for(const le of we)N(ce,[he,{x:he.x,y:Me},{x:le,y:Me},{x:le,y:je},{x:ge.x,y:je},ge])},"addVerticalPairCandidates"),V=w(ce=>{const he=new Set;return ce.map(Te=>Yn(Te)).filter(Te=>{const ge=Te.map(He=>`${He.x.toFixed(3)},${He.y.toFixed(3)}`).join("|");return he.has(ge)||Te.length<2?!1:(he.add(ge),!0)})},"dedupeCandidatePaths"),B=w((ce,he,Te,ge)=>{const He=[],we=CJ(ce,he,Te,ge,20,yr);we&&N(He,we),he===ge&&$(He,ce,he,Te);const Me=L(he),je=L(ge);return Me&&!je?O(He,ce,he,Te,ge):!Me&&je?D(He,ce,he,Te,ge):Me?F(He,ce,he,Te,ge):z(He,ce,he,Te,ge),V(He)},"buildCandidatesForSides"),H=w((ce,he,Te,ge)=>{const He=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Me of u){const je=F1(ge,Me),le=Me==="top"||Me==="bottom"?p(Me):we;for(const pe of He){N(ce,[he,Te,{x:pe,y:Te.y},{x:pe,y:je.y},je]);for(const Ce of le)N(ce,[he,Te,{x:pe,y:Te.y},{x:pe,y:Ce},{x:je.x,y:Ce},je])}}},"addVerticalDepartureOuterTrackCandidates"),G=w((ce,he,Te,ge)=>{const He=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Me of u){const je=F1(ge,Me),le=Me==="left"||Me==="right"?p(Me):He;for(const pe of we){N(ce,[he,Te,{x:Te.x,y:pe},{x:je.x,y:pe},je]);for(const Ce of le)N(ce,[he,Te,{x:Te.x,y:pe},{x:Ce,y:pe},{x:Ce,y:je.y},je])}}},"addHorizontalDepartureOuterTrackCandidates"),W=w(ce=>{const he=ce.start,Te=ce.end,ge=Te?o.get(Te):void 0;if(!he||!ge)return[];const He=Yn(ce.points??[]);if(He.length<4)return[];const we=He[0],Me=He[1],je=[];return Ns(we,Me,yr)?H(je,we,Me,ge):Is(we,Me,yr)&&G(je,we,Me,ge),je},"terminalPreservingOuterTrackCandidates"),K=w(ce=>{const he=ce.start,Te=ce.end,ge=he?o.get(he):void 0,He=Te?o.get(Te):void 0;if(!ge||!He)return[];const we=[];for(const Me of u){const je=F1(ge,Me);for(const le of u)we.push(...B(je,Me,F1(He,le),le))}return we.push(...W(ce)),we},"candidatePathsFor"),q=w(()=>new Map(d.map(ce=>[ce,yn(g(ce))])),"currentSegmentsByEdge"),oe=w((ce,he,Te)=>{const ge=new Set;for(const He of d){if(He===ce)continue;const we=Te.get(He)??yn(g(He));he.some(Me=>we.some(je=>Ad(Me,je,.5)>=Xa))&&ge.add(He)}return ge},"sharedTrackConflictsFor"),Q=w((ce,he,Te,ge)=>{const He=new Set;return K(ce).map(Me=>Pd(Yn(Me))).filter(Me=>{if(P(ce,Me))return!1;const je=Me.map(le=>`${le.x.toFixed(3)},${le.y.toFixed(3)}`).join("|");return He.has(je)||Me.length<2?!1:(He.add(je),!0)}).map(Me=>{const je=yn(Me);let le=0;for(const pe of d)pe!==ce&&(le+=m(je,Te.get(pe)??yn(g(pe))));return{candidate:Me,candidateSegments:je,crossings:he.count-(ge.get(ce)??0)+le,bends:Lc(Me,yr),totalBends:Lc(Me),length:E(Me)}}).filter(({crossings:Me})=>Me<=he.count).sort((Me,je)=>Me.crossings-je.crossings||Me.bends-je.bends||Me.length-je.length).slice(0,48).map(Me=>({path:Me.candidate,segments:Me.candidateSegments,sharedTrackConflicts:oe(ce,Me.candidateSegments,Te),totalBends:Me.totalBends,length:Me.length}))},"pairCandidatesFor"),Z=w((ce,he,Te,ge,He,we)=>{let Me=0;for(const le of ce.pairs)(le.first===he||le.second===he||le.first===ge||le.second===ge)&&(Me+=le.count);let je=m(Te.segments,He.segments);for(const le of d){if(le===he||le===ge)continue;const pe=we.get(le)??yn(g(le));je+=m(Te.segments,pe)+m(He.segments,pe)}return ce.count-Me+je},"pairCrossingCount"),re=w((ce,he)=>{for(const Te of ce.sharedTrackConflicts)if(Te!==he)return!1;return!0},"conflictsOnlyWith"),ie=w((ce,he)=>ce.segments.some(Te=>he.segments.some(ge=>Ad(Te,ge,.5)>=Xa)),"candidatesShareTrack"),me=w((ce,he,Te,ge)=>re(he,Te.edge)&&re(ge,ce.edge)&&!ie(he,ge),"pairCandidatesAreCompatible"),te=w((ce,he,Te,ge,He)=>{const we=Z(ce.current,he.edge,Te,ge.edge,He,ce.baseSegments);if(!(we>=ce.current.count))return{replacements:new Map([[he.edge,Te.path],[ge.edge,He.path]]),crossings:we,bends:ce.currentBends-(ce.baseBendsByEdge.get(he.edge)??0)-(ce.baseBendsByEdge.get(ge.edge)??0)+Te.totalBends+He.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(he.edge)??0)-(ce.baseLengthByEdge.get(ge.edge)??0)+Te.length+He.length}},"scorePairReplacement"),_e=w((ce,he)=>ce.crossings{let He=ge;for(const we of he.candidates)for(const Me of Te.candidates){if(!me(he,we,Te,Me))continue;const je=te(ce,he,we,Te,Me);je&&_e(je,He)&&(He=je)}return He},"bestScoreForOptionPair"),Fe=w(ce=>{const he=A(),Te=R(),ge=q(),He=k(ce),we=new Map(d.map(ne=>[ne,Lc(g(ne))])),Me=new Map(d.map(ne=>[ne,E(g(ne))])),je=new Map,le=C(ce);for(const ne of le)for(const j of ne){if(je.has(j))continue;const J=Q(j,ce,ge,He);J.length>0&&je.set(j,{edge:j,candidates:J})}let pe={replacements:new Map,crossings:ce.count,bends:he,length:Te};const Ce={current:ce,currentBends:he,currentLength:Te,baseBendsByEdge:we,baseLengthByEdge:Me,baseSegments:ge};for(const ne of le){const j=new Set(ne.filter(ue=>ce.edgeSet.has(ue))),J=ne.map(ue=>je.get(ue)).filter(ue=>!!ue);for(let ue=0;ue0?pe.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const he=v(),Te=he.count;if(Te===0)return;let ge,He,we=Te,Me=Number.POSITIVE_INFINITY;for(const le of he.edges){const pe=Lc(g(le),yr);for(const Ce of K(le)){const ne=P(le,Ce),j=!ne&&_(le,Ce),J=S(he,le,Ce),ue=Lc(Ce,yr);ne||j||!(Jwe||J===we&&ue>=Me||(ge=le,He=Ce,we=J,Me=ue)}}if(ge&&He){ge.points=He;continue}const je=Fe(he);if(!je)return;for(const[le,pe]of je)le.points=pe}}w(y9e,"resolveRenderedOrthogonalCrossings");var gp=.001,zHt=8;function v9e(t,e){const{nodeInfoById:r,realNodeRects:n}=YD(e),i=["top","bottom","left","right"],s=20,a={top:Math.min(...n.map(m=>m.rect.top))-s,bottom:Math.max(...n.map(m=>m.rect.bottom))+s,left:Math.min(...n.map(m=>m.rect.left))-s,right:Math.max(...n.map(m=>m.rect.right))+s},o=w((m,y,v,x)=>{const b=[],T=CJ(m,y,v,x,s,gp);return T&&b.push(T),y===x&&b.push(kJ(m,y,v,a[y])),b},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let x=0;const b=C5(m,gp),T=y.start,C=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const k=S.start,E=S.end;if(!v&&T&&C&&(k===T||k===C||E===T||E===C))continue;const A=S.points;if(!(!A||A.length<2))for(const R of b)for(const _ of C5(A,gp)){if(EJ(R.a,R.b,_.a,_.b,gp,gp)){x++;continue}Ad(R,_,gp)>=zHt&&x++}}return x},"pathConflictCount"),h=4,d=w((m,y)=>{const v=Math.abs(m.y-y.rect.top),x=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),T=Math.abs(m.x-y.rect.right);let C="top",S=v;return x{const x=f.get(m)??[];x.push({side:y,edgeId:v}),f.set(m,x)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",x=m.start,b=m.end;if(x){const T=r.get(x);T&&p(x,d(y[0],T),v)}if(b){const T=r.get(b);T&&p(b,d(y[y.length-1],T),v)}}const g=w((m,y,v)=>{var x;return((x=f.get(m))==null?void 0:x.some(b=>b.edgeId!==v&&b.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=Lc(y,gp);if(v0){const D=u($,m,!0);if(D>R||D===R&&O>=_)continue;R=D,_=O,A=$;continue}u($,m)>E||O<_&&(_=O,A=$)}}}if(A){m.points=A;const P=f.get(x);P&&f.set(x,P.filter(L=>L.edgeId!==S));const N=f.get(b);N&&f.set(b,N.filter(L=>L.edgeId!==S)),p(x,d(A[0],T),S),p(b,d(A[A.length-1],C),S)}}}w(v9e,"simplifyDetouredEdges");var Zl=.001,xfe=10,E8=7;function yq(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],s=t[r+n];if(!i||!s)return;const a=s.x-i.x,o=s.y-i.y;if(!(Math.abs(a)+Math.abs(o)s&&wL(t,b9e(s)))}w(vq,"labelOverlapsOwnMarker");function KM(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y{const y=tq(m,s);for(const{nodeId:v,rect:x}of n)if(v!==g&&wL(y,x))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=tq(m,s);for(const v of r)if(v.edgeId!==g&&UD(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=w((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=w(g=>{for(const{id:m,rect:y}of i)if(YRe(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&wL(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const x=y.width??0,b=y.height??0;if(x<=0||b<=0)continue;const T=[];for(let V=0;V=Zl&&W>=Zl||T.push({idx:V,length:G+W,orientation:G>=Zl?"horizontal":"vertical",midX:(B.x+H.x)/2,midY:(B.y+H.y)/2})}if(T.length===0)continue;const C=T.length>=3?T.filter(V=>V.idx>0&&V.idx0?C:T,k=x>=b?"horizontal":"vertical",E=w(V=>[...V].sort((B,H)=>{const G=B.orientation===k,W=H.orientation===k;if(G!==W)return G?-1:1;const K=B.length>=(B.orientation==="horizontal"?x:b)+2,q=H.length>=(H.orientation==="horizontal"?x:b)+2;return K!==q?K?-1:1:H.length-B.length}),"rankSegments"),A=T[0],R=T[T.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=w((V,B)=>{const H=v[V.idx],G=v[V.idx+1];return{midX:H.x+(G.x-H.x)*B,midY:H.y+(G.y-H.y)*B}},"anchorAtT"),N=w((V,B,H)=>Math.min(H,Math.max(B,V)),"clamp"),L=w((V,B)=>V.midX>=B.left-Zl&&V.midX<=B.right+Zl&&V.midY>=B.top-Zl&&V.midY<=B.bottom+Zl,"pointInsideRectInclusive"),I=w(V=>{const B=$b(V.midX,V.midY,x,b),H=f(B);if(H)return{laneId:H,anchor:V,rect:B};const G=i.find(({rect:re})=>L(V,re));if(!G)return;const W=G.rect.left+x/2+a,K=G.rect.right-x/2-a,q=G.rect.top+b/2+a,oe=G.rect.bottom-b/2-a;if(W>K||q>oe)return;const Q={midX:N(V.midX,W,K),midY:N(V.midY,q,oe)},Z=$b(Q.midX,Q.midY,x,b);return L(V,Z)?{laneId:G.id,anchor:Q,rect:Z}:void 0},"placementForAnchor"),$=w((V,B,H)=>V.orientation==="horizontal"?Math.abs(B.midX-H.x):Math.abs(B.midY-H.y),"distanceAlongSegment"),O=w((V,B)=>{const G=(V.orientation==="horizontal"?x/2:b/2)+o;if(V===A){const W=v[V.idx];if($(V,B,W)+Zl{const B=E(V);for(const H of B)for(const G of _){const W=P(H,G);if(!O(H,W))continue;const K=I(W);if(K&&!vq(K.rect,v)&&!p(m,K.rect)&&!h(m,g.id,K.rect))return{laneId:K.laneId,anchor:K.anchor}}},"tryPool"),F=w((V,B,H=!1)=>{const G=E(V);for(const W of G){const K={midX:W.midX,midY:W.midY};if(B&&!O(W,K))continue;const q=I(K);if(q&&!vq(q.rect,v)&&!p(m,q.rect)&&!l(m,q.rect)&&(H||!u(g.id,q.rect)))return{laneId:q.laneId,anchor:q.anchor}}},"findLaneContainingFallback"),z=D(S)??(S.lengthH.labelId===m);B>=0?d[B]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}w(KM,"anchorLabelsToPolyline");var cF=1e-6,VHt=8,wfe=VHt/2,HHt=3;function bq(t,e){return t{const h=bq(o,l);let d=0;const f=w(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(a.labelNodeId);for(const p of t){if(p===a||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||bq(g,m)===h&&f(p.labelNodeId)}return d>0?d+HHt:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const o=a.points;if(!wJ(o,cF))continue;const l=SJ(a,r,cF);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Xs(m,y,n,[u,h],1))continue;const x=s(a,u,h,p?"x":"y"),b=x>wfe?x:wfe,T=[0,b,-b];for(const C of T){const S={...m},k={...y};if(p){if(S.x+=C,k.x+=C,S.x<=d.rect.left||S.x>=d.rect.right||k.x<=f.rect.left||k.x>=f.rect.right)continue}else if(S.y+=C,k.y+=C,S.y<=d.rect.top||S.y>=d.rect.bottom||k.y<=f.rect.top||k.y>=f.rect.bottom)continue;if(!Xs(S,k,n,[u,h],1)&&!TL(S,k,t,a,{epsilon:cF})){a.points=[S,k];break}}}}w(x9e,"straightenCollinearSiblingDetours");function xq(t,e){const{realNodeRects:l,labelNodeRects:u}=rm(e.values()),h=w((C,S)=>C5(S,.001).map(k=>({...k,edge:C,interior:k.index>=1&&k.index<=S.length-3})),"segmentsFor"),d=w(()=>{const C=[];for(const S of t){if(S.isLayoutOnly)continue;const k=S.points;!k||k.length<2||C.push(...h(S,Yn(k)))}return C},"allSegments"),f=w((C,S)=>C.horizontal&&S.horizontal?_l(C.a.x,C.b.x,S.a.x,S.b.x)>=8&&Math.abs(C.a.y-S.a.y)<7:C.vertical&&S.vertical?_l(C.a.y,C.b.y,S.a.y,S.b.y)>=8&&Math.abs(C.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=w((C,S)=>{const k=C.start,E=C.end,A=h(C,S);if(A.length!==S.length-1)return!1;const R=[k,E].filter(P=>!!P),_=C.labelNodeId?[C.labelNodeId]:[];for(const P of A)if(Xs(P.a,P.b,l,R,-2)||Xs(P.a,P.b,u,_,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const N=P.points;if(!(!N||N.length<2)){for(const L of A)for(const I of h(P,Yn(N)))if(f(L,I)||j0(L.a,L.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=w((C,S)=>{const k=Yn(C.edge.points??[]);if(k.length<4||C.index>=k.length-1)return;const E=k.map(A=>({...A}));if(C.horizontal)E[C.index].y+=S,E[C.index+1].y+=S;else if(C.vertical)E[C.index].x+=S,E[C.index+1].x+=S;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=w((C,S)=>({x:C.x??(S.left+S.right)/2,y:C.y??(S.top+S.bottom)/2}),"nodeCenter"),y=w(C=>{const S=C.edge,k=Yn(S.points??[]);if(k.length!==4||C.index!==1)return;const E=S.start?e.get(S.start):void 0,A=S.end?e.get(S.end):void 0,R=E?gc(E):void 0,_=A?gc(A):void 0,P=k.slice(C.index+2);if(!(!E||!A||!R||!_||P.length===0))return{sourceCenter:m(E,R),targetCenter:m(A,_),sourceRect:R,tail:P}},"sourceDetourContextFor"),v=w((C,S,k,E,A,R)=>{const _=E.y>=k.y,P=_?A.bottom:A.top,N=P+(_?20:-20);if(_&&C.b.y<=N+.001||!_&&C.b.y>=N-.001)return;const L=C.a.x+S;return Yn([{x:k.x,y:P},{x:k.x,y:N},{x:L,y:N},{x:L,y:C.b.y},...R],.001)},"verticalSourceDetour"),x=w((C,S,k,E,A,R)=>{const _=E.x>=k.x,P=_?A.right:A.left,N=P+(_?20:-20);if(_&&C.b.x<=N+.001||!_&&C.b.x>=N-.001)return;const L=C.a.y+S;return Yn([{x:P,y:k.y},{x:N,y:k.y},{x:N,y:L},{x:C.b.x,y:L},...R],.001)},"horizontalSourceDetour"),b=w((C,S)=>{const k=y(C);if(k){if(C.vertical)return v(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail);if(C.horizontal)return x(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const S=d();let k=!1;for(let E=0;EN.interior);for(const N of P){for(const L of T){const I=g(N,L);if(I&&p(N.edge,I)){N.edge.points=I,k=!0;break}const $=b(N,L);if($&&p(N.edge,$)){N.edge.points=$,k=!0;break}}if(k)break}}if(!k)return}}w(xq,"nudgeSharedInteriorSubpaths");function w9e(t,e,r,n){const i=e.x-t.x,s=e.y-t.y,a=n.x-r.x,o=n.y-r.y,l=i*o-s*a;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*a)/l,f=(u*s-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}w(w9e,"segmentsIntersect");function T9e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=jRe(e),s=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;de.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)de.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}w(T9e,"validateSwimlanesLayout");function C9e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!c9e(t,e)||e==="BT"&&i.length>0&&!l9e(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Pd(CL(l)))}v9e(n,r),x9e(n,r),u9e(n,r);const s=new Map;for(const o of r)s.set(String(o.id),o);KM(n,s),JRe(n,s),h9e(n,s),xq(n,s),d9e(n,s),f9e(n,s),pq(n,s),p9e(n,s);const a=w(()=>{y9e(n,s),g9e(n,s),m9e(n,s),KM(n,s),dq(n,s),pq(n,s),KM(n,s),dq(n,s)},"finalizeRenderedEdges");a(),xq(n,s),a(),gq(n,s),mq(n,s),gq(n,s),mq(n,s)}w(C9e,"postProcessSwimlaneLayout");function nm(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const s of t.edges){if(!e.has(s.src)||!e.has(s.dst))continue;const a=`${s.id}:${s.src}->${s.dst}`;r.has(a)||(r.add(a),n.push(s))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}w(nm,"normalizeGraph");function LJ(t,e){return t.edges.filter(r=>r.dst===e)}w(LJ,"incoming");function k9e(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}w(k9e,"buildSuccessorMap");function IJ(t){const e=k9e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(IJ,"buildSortedSuccessorMap");function NJ(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}w(NJ,"buildInDegreeMap");function DJ(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(DJ,"sortedZeroInDegreeNodes");function jD(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}w(jD,"buildPredecessorSuccessorMaps");function OJ(t,e,r,n){var a,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((a=t.nodeById.get(l))!=null&&a.isGroup)||(i=Math.max(i,r[l]??0));const s=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||s[Math.max(0,r[l]??0)].push(l);return s}w(OJ,"buildLayersFromRanks");function g7(t){const e=NJ(t),r=DJ(e),n=[],i=IJ(t);for(;r.length;){const s=r.shift();n.push(s);for(const a of i.get(s)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const s=n+i>>1;let a=r(n,s)+r(s,i),o=n,l=s,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],s=w(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?s(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),a=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of a)n[h]===0&&s(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}w(S9e,"removeCycles_DFS");function E9e(t){const e=new Map,r=w(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const s=i.parentId;if(!s)return e.set(n,null),null;const o=r(s)??s;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}w(E9e,"buildTopLaneMap");function X0(t){const e=E9e(t);return r=>e.get(r)??null}w(X0,"createTopLaneResolver");function XD(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(XD,"buildTopLaneOrder");function $J(t,e){const r=XD(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,s=[];for(const a of e)!n.has(a)||i.has(a)||(i.add(a),s.push(a));for(const a of r)i.has(a)||s.push(a);return s}w($J,"resolveTopLaneOrder");var GHt={EPSILON:1e-6},ML={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Tfe={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function A9e(t,e){const r=nm(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:s}=jD(r);for(const C of s.values())C.sort((S,k)=>S.localeCompare(k));const a=g7(r)??[...r.nodes].sort((C,S)=>C.localeCompare(S)),o=new Map;for(const[C,S]of a.entries())o.set(S,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of a){const S=(s.get(C)??[]).filter(k=>l.has(k));if(S.length>0){const k=M9e(C,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,k),u.get(k).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,S)=>{const k=o.get(C)??0,E=o.get(S)??0;return k===E?C.localeCompare(S):k-E}),f=R9e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=_9e(p),m=L9e(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const S of C.nodes){const k=y.get(S);k?k.push(C.id):y.set(S,[C.id])}const v=[],x=[],b=new Set,T=w(C=>{if(!b.has(C)){b.add(C),v.push(C);for(const S of u.get(C)??[])T(S);x.push(C)}},"walk");for(const C of d)T(C);for(const C of a)T(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:x,topologicalOrder:a}}w(A9e,"buildDrivingTree");function M9e(t,e,r){const n=r.laneOf(t);return[...e].sort((s,a)=>{var m,y;const o=r.laneOf(s),l=r.laneOf(a),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[s],f=(y=r.rankHint)==null?void 0:y[a];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(s)??0,g=r.topoIndex.get(a)??0;return p!==g?p-g:s.localeCompare(a)})[0]}w(M9e,"chooseParent");function R9e(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}w(R9e,"buildAdjacency");function _9e(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const s=i.pop();if(!e.has(s)){e.set(s,r);for(const a of t.get(s)??[])e.has(a)||i.push(a)}}r++}return e}w(_9e,"assignComponents");function L9e(t){const e=new Map,r=new Map,n=[],i=[];let s=0;const a=w((o,l)=>{e.set(o,++s),r.set(o,s);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??s,e.get(u)??s))):(n.push([o,u]),a(u,o),r.set(o,Math.min(r.get(o)??s,r.get(u)??s)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(I9e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||a(o,null);return i}w(L9e,"computeBlocks");function I9e(t,e,r,n){const i=[],s=new Set;for(;r.length>0;){const a=r.pop();if(i.push(a),s.add(a[0]),s.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:n,edges:i,nodes:[...s]}}w(I9e,"popBlock");function N9e(t,e,r){const n=[...t.nodes],i=new Map;for(const[x,b]of n.entries())i.set(b,x);const s=n.length,a=new Array(s).fill(-1),o=new Array(s).fill(0),l=[],u=new Set;for(const x of n){const b=r.parent.get(x)??null,T=i.get(x);T!=null&&b==null&&(a[T]=-1,o[T]=0,u.has(x)||(u.add(x),l.push(x)))}for(;l.length>0;){const x=l.shift(),b=i.get(x);if(b==null)continue;const T=r.children.get(x)??[];for(const C of T){if(u.has(C))continue;const S=i.get(C);S!=null&&(a[S]=b,o[S]=o[b]+1,u.add(C),l.push(C))}}for(const x of n){if(u.has(x))continue;const b=i.get(x);b!=null&&(a[b]=-1,o[b]=0,u.add(x))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,s)))+1),d=Array.from({length:h},()=>new Array(s).fill(-1));for(let x=0;x{if(x===-1||b===-1)return-1;o[x]>C&1&&(x=d[C][x],x===-1))return-1;if(x===b)return x;for(let C=h-1;C>=0;C--){const S=d[C][x],k=d[C][b];S===-1||k===-1||S!==k&&(x=S,b=k)}return d[0][x]},"lcaIndex"),p=Array.from({length:s},()=>new Map);for(const x of t.edges){let b=x.src,T=x.dst,C=e[b],S=e[T];if(C==null||S==null||(C>S&&([b,T]=[T,b],[C,S]=[S,C]),C==null||S==null||C===S))continue;const k=i.get(b),E=i.get(T);if(k==null||E==null)continue;const A=f(k,E);if(A===-1)continue;const R=p[A];for(let _=C;_{if(b.size!==0)for(const[T,C]of b)x.set(T,(x.get(T)??0)+C)},"mergeInto"),y=new Set,v=w(x=>{const b=i.get(x);y.add(x);const T=b==null?void 0:p[b],C=T?new Map(T):new Map,S=r.children.get(x)??[];for(const k of S){const E=v(k),A=e[x];if(A!=null){let R=g.get(x);R||(R=new Map,g.set(x,R));let _=E.get(A)??0;const P=e[k];P!=null&&P>A&&(_+=1),R.set(k,_)}m(C,E)}return C},"dfs");for(const x of r.roots)y.has(x)||v(x);for(const x of n)y.has(x)||v(x);return g}w(N9e,"computeSubtreeCrossCounts");function D9e(t,e,r){const n=new Map,i=w(s=>{let a=r[s]??0;const o=[...e.get(s)??[]];o.sort(BJ(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(a=Math.min(a,u))}n.set(s,a)},"annotate");for(const s of t)i(s);return n}w(D9e,"annotateMinimumLayers");function BJ(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(BJ,"compareByRankThenId");function O9e(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const s=Array.from({length:i+1},()=>[]),a=new Set,o=w(l=>{if(a.has(l))return;a.add(l);const u=r[l]??0;s[u]||(s[u]=[]),s[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!a.has(l)){const u=r[l]??0;s[u]||(s[u]=[]),s[u].push(l),a.add(l)}return s}w(O9e,"emitNodesInTreeOrder");function P9e(t){const e=[];for(const r of t){const n=new Set,i=[];for(const s of r)n.has(s)||(n.add(s),i.push(s));e.push(i)}return e}w(P9e,"deduplicateLayers");function $9e(t,e,r,n){return i=>{const s=t.get(i)??[];if(s.length===0)return[];const a=e[i]??0,o=[],l=[],u=r.get(i);for(const h of s){const d=n.get(h)??a;d>a?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??a,m=n.get(d)??a;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}w($9e,"createChildOrderer");function RL(t,e,r){const n=A9e(t,{rankHint:e,laneOf:r}),{children:i,roots:s}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const a=N9e(t,e,n),o=[...s].sort(BJ(e)),l=D9e(o,i,e),u=$9e(i,e,a,l);let h=O9e(o,t.nodes,e,u);return h=P9e(h),h}w(RL,"buildMultitreeLayerOrder");function B9e(t,e,r){const n=new Set(t),i=new Set(e),s=k5(e),a=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&a.push(s.get(o.dst));return PJ(a)}w(B9e,"countCrossingsBetweenAdjacent");function wq(t,e,r){const n=[];for(const s of e){const a=r[s.src],o=r[s.dst];if(a==null||o==null||a===o)continue;let l=s.src,u=s.dst,h=a,d=o;a>o&&(l=s.dst,u=s.src,h=o,d=a);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=RL(t,r,i),y=wq(m,t.edges,r);y(e[i]??0)-(e[s]??0)||i.localeCompare(s));for(const i of n){const s=r(i);if(!s)continue;const a=t.edges.filter(m=>m.src===i);if(a.length===0)continue;let o=!1,l=0;for(const m of a){const y=r(m.dst);y==null||y===s?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===s?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}w(z9e,"adjustCrossLaneSources");function V9e(t,e){const r=nm(t),n=g7(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,s=X0(r);let a=Object.create(null);for(const l of n){const u=LJ(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=s(d.src),p=s(l);return!f||!p?!0:f===p}):u;if(h.length===0)a[l]=0;else if(i&&h.length===1){const d=h[0].src,f=s(d),p=s(l);f!==p?a[l]=a[d]??0:a[l]=(a[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(a[f.src]??0)+1);a[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(a=F9e(r,a)),e!=null&&e.ignoreCrossLaneEdges&&z9e(r,a),{layers:RL(r,a,s),rankOf:a,dummy:new Set}}w(V9e,"assignLayers_LongestPath");function H9e(t,e){const r=nm(t),i={...V9e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},s=X0(r),{preds:a,succs:o}=jD(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=s(g.src),y=s(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=g7(r)??[...r.nodes],u=[...l].reverse(),h=w((g,m)=>{let y=0;for(const b of a.get(g)??[])y=Math.max(y,(i[b]??0)+1);let v=Number.POSITIVE_INFINITY;const x=o.get(g)??[];return x.length>0&&(v=Math.min(...x.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=ML.GRAVITY_ITERATIONS,f=w(g=>{let m=!1;for(const y of g){const v=a.get(y)??[],x=o.get(y)??[];if(v.length===0&&x.length===0)continue;const b=v.length>0?v.reduce((k,E)=>k+(i[E]??0)+1,0)/v.length:i[y]??0,T=x.length>0?x.reduce((k,E)=>k+(i[E]??0)-1,0)/x.length:i[y]??0,C=Math.round((b+T)/2),S=h(y,C);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:OJ(r,l,i),rankOf:i,dummy:new Set}}w(H9e,"assignLayers_Gravity");function G9e(t){const e=NJ(t),r=IJ(t);let n=DJ(e);const i=[];for(;n.length>0;){const s=[];for(const a of n){i.push(a);for(const o of r.get(a)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&s.push(o)}n=s.sort((a,o)=>a.localeCompare(o))}return i.length===t.nodes.length?i:null}w(G9e,"topoSortByGenerationIfAcyclic");function W9e(t,e){const r=nm(t),n=(e==null?void 0:e.direction)==="LR"?G9e(r)??[...r.nodes].sort():g7(r)??[...r.nodes].sort(),i=X0(r),s=w(h=>i(h)??h,"laneOf"),a=Object.create(null),o=new Map,l=w((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?s(h)===s(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=LJ(r,h);let p=0;if(f.length>0)for(const v of f){const x=v.src,b=a[x]??0;p=Math.max(p,b+l(x,h))}const g=s(h),m=o.get(g)??0,y=Math.max(p,m);a[h]=y,o.set(g,y+1)}return{layers:OJ(r,n,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}w(W9e,"assignLayers_LaneAwareCompact");function q9e(t,e){const r=nm(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),s=new Set(t.dummy?[...t.dummy]:[]);let a=0;const o=new Map(r.nodeById),l=w(p=>{const g=`placeholder-${a++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),s.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let x=g+1,b=0;x!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:s},graphWithDummies:f}}w(q9e,"makeProperLayering");function Tq(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}w(Tq,"median");function Cq(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(Cq,"barycenter");function U9e(t,e,r,n){const i=new Map;for(const s of t)i.set(s,[]);for(const s of r)n==="down"?e.has(s.src)&&i.has(s.dst)&&i.get(s.dst).push(e.get(s.src)):e.has(s.dst)&&i.has(s.src)&&i.get(s.src).push(e.get(s.dst));return i}w(U9e,"neighborPositionsFor");function Y9e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(Y9e,"currentOrderTieBreak");function kq(t,e,r){const n=new Set(t),i=new Set(e),s=k5(t),a=k5(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:s.get(u.src),v:a.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return PJ(l)}w(kq,"countCrossingsBetweenAdjacent");function ZM(t,e,r){return[...t].sort((n,i)=>{const s=Tq(e.get(n)??[]),a=Tq(e.get(i)??[]);return s===a?Y9e(n,i,r):isFinite(s)?isFinite(a)?s-a:-1:1})}w(ZM,"sortByHeuristic");function Sq(t,e,r,n,i,s){const a=k5(t),o=k5(e),l=U9e(e,a,r,n);if(!i||!s||s.length===0)return ZM(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of s){const p=u.get(f);if(!p||p.length===0)continue;const g=ZM(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=ZM(d,l,o);for(const p of f){const g=Cq(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const x=Cq(l.get(v)??[]);if(ga.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=w(m=>{let y=kq(t,m,u);return h&&n&&(y+=kq(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(s);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,s=X0(e),a=$J(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=Sq(n[l+1],n[l],i,"up",s,a),n[l]=Eq(n[l+1],n[l],i,n[l-1],s)}return{layers:n}}w(j9e,"orderLayers");function X9e(t,e,r){const n=(r==null?void 0:r.layerGap)??Tfe.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??Tfe.DEFAULT_NODE_GAP,s=(r==null?void 0:r.laneGap)??i*2,a=(r==null?void 0:r.direction)??"TB",o=a==="LR"||a==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=w(R=>e.nodeById.get(R),"getNode"),f=w(R=>{var _;return((_=d(R))==null?void 0:_.width)??0},"getWidth"),p=w(R=>{var _;return((_=d(R))==null?void 0:_.height)??0},"getHeight"),g=X0(e),m=$J(e,r==null?void 0:r.laneOrder),y=l.map(R=>R.reduce((_,P)=>Math.max(_,p(P)),0)),v=[];if(o)for(let R=0;R+1Math.max(D,f(F)),0),P=l[R+1].reduce((D,F)=>Math.max(D,f(F)),0),N=y[R],L=y[R+1],I=N/2+L/2,$=(_+P)/2,O=Math.max(0,$-I-n);v.push(O)}const x=new Set;for(const R of l)for(const _ of R)x.add(g(_));const b=x.has(null),T=m.filter(R=>x.has(R)),C=[...b?[null]:[],...T],S=Object.create(null);for(const R of T)S[R]=0;b&&(S.null=0);for(const R of l){const _=Object.create(null),P=[];for(const N of R){const L=g(N);L===null?P.push(N):(_[L]||(_[L]=[])).push(N)}for(const[N,L]of Object.entries(_)){const I=L.reduce(($,O)=>$+f(O),0)+i*Math.max(0,L.length-1);S[N]=Math.max(S[N]??0,I)}if(b&&P.length){const N=P.reduce((L,I)=>L+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,N)}}const k=new Map;{const R=C.map(N=>(N===null?S.null:S[N])??0);let P=-(R.reduce((N,L)=>N+L,0)+s*Math.max(0,C.length-1))/2;for(let N=0;Nf(V)),F=D.reduce((V,B)=>V+B,0)+i*($.length-1);let z=O-F/2;for(const[V,B]of $.entries()){const H=D[V];u[B]=z+H/2,h[B]=E+P/2,z+=H+i}}}const L=v[R]??0;E+=P+n+L}const A=new Map;for(const R of e.edges){const _=R.ref.id;A.has(_)||A.set(_,[]),A.get(_).push(R)}for(const[,R]of A){if(R.length===0)continue;const _=R[0].ref,P=_.start,N=_.end;if(P==null||N==null)continue;const L=Math.round(((u[P]??0)+(u[N]??0))/2),I=new Set;for(const $ of R)I.add($.src),I.add($.dst);for(const $ of I){if($===P||$===N)continue;const O=e.nodeById.get($);O!=null&&O.isDummy&&(u[$]=L)}}return{x:u,y:h}}w(X9e,"assignCoordinates");var K9e=8;function Z9e(t){let e=2166136261;for(let r=0;r>>0}w(Z9e,"hashString");function Q9e(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}w(Q9e,"mulberry32");function J9e(t,e){const r=[...t],n=Q9e(e);for(let i=r.length-1;i>0;i--){const s=Math.floor(n()*(i+1));[r[i],r[s]]=[r[s],r[i]]}return r}w(J9e,"deterministicShuffle");function e_e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(e_e,"sourceDistance");function Aq(t,e){const r=new Map;for(const[i,s]of t.entries())r.set(s,i);let n=0;for(const{a:i,b:s,weight:a}of e){const o=r.get(i),l=r.get(s);o==null||l==null||(n+=a*Math.abs(o-l))}return n}w(Aq,"laneArrangementCost");function t_e(t){const e=XD(t);if(e.length<2)return[];const r=new Map(e.map((s,a)=>[s,a])),n=X0(t),i=new Map;for(const s of t.layout.edges??[]){if(s.isLayoutOnly)continue;const a=typeof s.start=="string"?s.start:void 0,o=typeof s.end=="string"?s.end:void 0;if(!a||!o||!t.nodeById.has(a)||!t.nodeById.has(o))continue;const l=n(a),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}w(t_e,"buildWeightedLaneEdges");function Mq(t,e,r){const n=[...t];let i=Aq(n,e),s=!0,a=0;const o=Math.max(1,n.length);for(;s&&ai.a===s.a?i.b.localeCompare(s.b):i.a.localeCompare(s.a)).map(({a:i,b:s,weight:a})=>`${i}:${s}:${a}`).join("|");return Z9e(`${t.join("|")}#${n}#${r}`)}w(n_e,"seedForRestart");function i_e(t,e={}){const r=XD(t);if(r.length<2)return r;const n=t_e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let s=Mq(r,n,i);const a=Math.max(0,e.restarts??K9e);for(let o=0;oCn&&l*3>=o?a>0?"bottom":"top":o>Cn?s>0?"right":"left":r}w(Rq,"chooseOrthogonalSide");function _q(t,e){return Math.abs(t.to-e.from)le.isGroup&&!le.parentId);for(const le of u){const pe={id:le.id},Ce=w(ne=>{a.set(ne.id,pe),r.filter(j=>j.parentId===ne.id).forEach(Ce)},"assignLane");Ce(le)}const h=r.filter(le=>!le.isGroup&&!le.isEdgeLabel).map(le=>{const pe=le.width??10,Ce=le.height??10,ne=le.x??0,j=le.y??0,J=WHt;return{nodeId:le.id,minX:ne-pe/2-J,maxX:ne+pe/2+J,minY:j-Ce/2-J,maxY:j+Ce/2+J,visualXHalfExtent:l?Ce/2+J:pe/2+J}}),d=w((le,pe,Ce,ne)=>{let j=o.find(J=>J.orientation===le&&Math.abs(J.coord-pe)<1);return j||(j={id:`pipe-${le}-${pe.toFixed(0)}`,orientation:le,coord:pe,spanMin:Ce,spanMax:ne,tracks:[]},o.push(j)),j.spanMin=Math.min(j.spanMin,Ce),j.spanMax=Math.max(j.spanMax,ne),j},"getOrAddPipe"),f=w((le,pe)=>{const Ce=le.width??10,ne=le.height??10,j=le.x??0,J=le.y??0;switch(pe){case"top":return{x:j,y:J-ne/2};case"bottom":return{x:j,y:J+ne/2};case"left":return{x:j-Ce/2,y:J};case"right":return{x:j+Ce/2,y:J}}},"portForSide"),p=w((le,pe,Ce)=>f(le,Rq(le,pe,Ce?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,x=w((le,pe,Ce)=>{if(g.length===0)return 0;const ne=Math.abs(pe.y-Ce.y)fe||ee.from-Cn<=ue&&ee.to+Cn>=ue&&(J+=v)}else if(j){const ue=pe.x,X=Math.min(pe.y,Ce.y)-Cn,fe=Math.max(pe.y,Ce.y)+Cn;if(fe<=X)return 0;for(const ee of g)ee.edgeIndex===le||ee.orientation!=="horizontal"||ee.pipe.coordfe||ee.from-Cn<=ue&&ee.to+Cn>=ue&&(J+=v)}return J},"crossingPenalty"),b=i.map((le,pe)=>{if(!le.start||!le.end)return{idx:pe,crossLane:0,dx:0,dy:0};const Ce=s.get(le.start),ne=s.get(le.end),j=a.get(le.start),J=a.get(le.end),ue=j&&J&&j.id!==J.id?1:0,X=Ce&&ne?Math.abs((ne.x??0)-(Ce.x??0)):0,fe=Ce&&ne?Math.abs((ne.y??0)-(Ce.y??0)):0;return{idx:pe,crossLane:ue,dx:X,dy:fe}}).sort((le,pe)=>{if(le.crossLane!==pe.crossLane)return pe.crossLane-le.crossLane;const Ce=le.dx+le.dy,ne=pe.dx+pe.dy;return Math.abs(Ce-ne)>1?Ce-ne:le.idx-pe.idx}).map(le=>le.idx),T=w((le,pe,Ce,ne)=>{const j=Math.min(le.x,pe.x),J=Math.max(le.x,pe.x),ue=Math.min(le.y,pe.y),X=Math.max(le.y,pe.y);return!!h.find(ee=>Ce&&ee.nodeId===Ce||ne&&ee.nodeId===ne?!1:Math.abs(le.x-pe.x)>Cn?ee.minYle.y&&ee.maxX>j&&ee.minXle.x&&ee.maxY>ue&&ee.minYRq(le,pe,"bottom"),"determineSide"),E=new Map;for(const[le,pe]of i.entries()){if(!pe.start||!pe.end||pe.start===pe.end||pe.points&&pe.points.length>0)continue;const Ce=s.get(pe.start),ne=s.get(pe.end);if(!Ce||!ne)continue;const j=(ne.x??0)-(Ce.x??0),J=(ne.y??0)-(Ce.y??0);E.set(le,{edgeIdx:le,srcId:pe.start,dstId:pe.end,srcSide:k(Ce,{x:ne.x??0,y:ne.y??0}),dstSide:k(ne,{x:Ce.x??0,y:Ce.y??0}),absDx:Math.abs(j),absDy:Math.abs(J),dxSign:Math.sign(j),dySign:Math.sign(J)})}const A=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.absDx===0?1/0:le.absDy/le.absDx:le.absDy===0?1/0:le.absDx/le.absDy,"preferenceStrength"),R=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.dxSign>=0?"right":"left":le.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const le of E.values()){const pe=`${le.srcId}:${le.srcSide}`;_.has(pe)||_.set(pe,[]),_.get(pe).push(le)}const P=new Map,N=w((le,pe)=>`${le}:${pe}`,"loadKey");for(const le of E.values())P.set(N(le.srcId,le.srcSide),(P.get(N(le.srcId,le.srcSide))??0)+1),P.set(N(le.dstId,le.dstSide),(P.get(N(le.dstId,le.dstSide))??0)+1);for(const le of _.values())if(!(le.length<2)){le.sort((pe,Ce)=>{const ne=A(pe),j=A(Ce);return Math.abs(ne-j)>1e-9?j-ne:pe.edgeIdx-Ce.edgeIdx});for(let pe=1;pe=j||(P.set(N(Ce.srcId,Ce.srcSide),j-1),P.set(N(Ce.srcId,ne),J+1),Ce.srcSide=ne)}}const L=w(le=>{const pe=le==null?void 0:le.shape;return pe==="question"||pe==="diamond"},"isDiamondNode"),I=new Map;for(const le of E.values())I.has(le.dstId)||I.set(le.dstId,new Set),I.get(le.dstId).add(le.dstSide);for(const le of E.values()){if(!L(s.get(le.srcId)))continue;const pe=I.get(le.srcId);if(!(pe!=null&&pe.has(le.srcSide)))continue;const Ce=R(le);if(pe.has(Ce)||(P.get(N(le.srcId,Ce))??0)>0)continue;const ne=P.get(N(le.srcId,le.srcSide))??0;P.set(N(le.srcId,le.srcSide),Math.max(0,ne-1)),P.set(N(le.srcId,Ce),1),le.srcSide=Ce}for(const le of E.values()){const{edgeIdx:pe,srcId:Ce,dstId:ne,srcSide:j,dstSide:J}=le,ue=s.get(Ce),X=s.get(ne),fe=`${Ce}:${j}:src`,ee=j==="top"||j==="bottom"?X.x??0:X.y??0;C.has(fe)||C.set(fe,[]),C.get(fe).push({edgeIdx:pe,oppositeCoord:ee});const Ae=`${ne}:${J}:dst`,Re=J==="top"||J==="bottom"?ue.x??0:ue.y??0;C.has(Ae)||C.set(Ae,[]),C.get(Ae).push({edgeIdx:pe,oppositeCoord:Re})}const $=new Map,O=8;for(const[le,pe]of C){if(pe.length<2)continue;pe.sort((Ke,ze)=>Ke.oppositeCoord-ze.oppositeCoord);const Ce=le.split(":"),ne=Ce.slice(0,-2).join(":"),j=Ce[Ce.length-2],J=Ce[Ce.length-1],ue=s.get(ne);if(!ue)continue;const fe=j==="left"||j==="right"?ue.height??10:ue.width??10,ee=ue.shape,Re=ee==="question"||ee==="diamond"?fe*.3:fe,Ne=Math.min(20,Math.max(O,Re/(pe.length+1))),De=-(Ne*(pe.length-1))/2;for(const[Ke,ze]of pe.entries()){const st=De+Ke*Ne,Oe=`${ze.edgeIdx}:${J}`;$.set(Oe,st)}}const D=w(le=>{var pe;return!!((pe=i[le])!=null&&pe.labelNodeId)},"edgeHasLabelNode"),F=w((le,pe)=>le?(C.get(`${le}:${pe}:src`)??[]).some(({edgeIdx:Ce})=>D(Ce))||(C.get(`${le}:${pe}:dst`)??[]).some(({edgeIdx:Ce})=>D(Ce)):!1,"faceHasLabelNode"),z=w((le,pe,Ce)=>pe==="top"||pe==="bottom"?{x:le.x+Ce,y:le.y}:{x:le.x,y:le.y+Ce},"applyPortOffset"),V=w((le,pe,Ce)=>{const ne=E.get(le),j={x:Ce.x??0,y:Ce.y??0},J={x:pe.x??0,y:pe.y??0},ue=(ne==null?void 0:ne.srcSide)??k(pe,j),X=(ne==null?void 0:ne.dstSide)??k(Ce,J);let fe=ne?f(pe,ne.srcSide):p(pe,j,!0),ee=ne?f(Ce,ne.dstSide):p(Ce,J,!1);const Ae=$.get(`${le}:src`),Re=$.get(`${le}:dst`);return Ae!==void 0&&(fe=z(fe,ue,Ae)),Re!==void 0&&(ee=z(ee,X,Re)),{pSrcPort:fe,pDstPort:ee,srcSide:ue,dstSide:X}},"portsForEdge");for(const le of b){const pe=i[le];if(m[le]=[],!pe.start||!pe.end||pe.points&&pe.points.length>0||pe.start===pe.end)continue;const Ce=s.get(pe.start),ne=s.get(pe.end);if(!Ce||!ne)continue;const{pSrcPort:j,pDstPort:J,srcSide:ue,dstSide:X}=V(le,Ce,ne),fe={...j},ee={...J},Ae=ue==="top"||ue==="bottom",Re=X==="top"||X==="bottom";if(Ae){const ht=j.y>(Ce.y??0);fe.y=ht?j.y+iu:j.y-iu}else{const ht=j.x>(Ce.x??0);fe.x=ht?j.x+iu:j.x-iu}if(Re){const ht=J.y>(ne.y??0);ee.y=ht?J.y+iu:J.y-iu}else{const ht=J.x>(ne.x??0);ee.x=ht?J.x+iu:J.x-iu}const Xe=w((ht,vt)=>{for(const Kt of h)if(!vt.includes(Kt.nodeId)&&ht.x>Kt.minX&&ht.xKt.minY&&ht.y{if(cn){const Pt=ht.y>(vt.y??0);return{x:(Kt.x??0)>=ht.x?Br.maxX+Dm:Br.minX-Dm,y:Pt?Br.maxY+jv:Br.minY-jv,leavesPositiveSide:Pt}}const kt=ht.x>(vt.x??0),bt=(Kt.y??0)>=ht.y;return{x:kt?Br.maxX+Dm:Br.minX-Dm,y:bt?Br.maxY+jv:Br.minY-jv,leavesPositiveSide:kt}},"obstacleDetour");let qe=[];const De=[pe.start,pe.end],Ke=Xe(fe,De);if(Ke.inside&&Ke.obstacle){const ht=Ke.obstacle;if(Ae){const vt=Ne(j,Ce,ne,ht,!0);fe.x=vt.x,fe.y=vt.y;const Kt=vt.leavesPositiveSide?Math.min(ht.minY-2,j.y+iu):Math.max(ht.maxY+2,j.y-iu);qe=[{x:j.x,y:Kt},{x:vt.x,y:Kt},{x:vt.x,y:vt.y}]}else{const vt=Ne(j,Ce,ne,ht,!1),Kt=vt.leavesPositiveSide?Math.min(ht.minX-2,j.x+iu):Math.max(ht.maxX+2,j.x-iu);fe.x=vt.x,fe.y=vt.y,qe=[{x:Kt,y:j.y},{x:Kt,y:vt.y},{x:vt.x,y:vt.y}]}}let ze=[];const st=Xe(ee,De);if(st.inside&&st.obstacle){const ht=st.obstacle;if(Re){const vt=Ne(J,ne,Ce,ht,!0);ee.x=vt.x,ee.y=vt.y,ze=[{x:vt.x,y:vt.y},{x:J.x,y:vt.y}]}else{const vt=Ne(J,ne,Ce,ht,!1);ee.x=vt.x,ee.y=vt.y,ze=[{x:vt.x,y:vt.y},{x:vt.x,y:J.y}]}}if(qe.length===0&&ze.length===0){const ht=Dm,vt=Math.abs(fe.x-ee.x)1||kt>1,Pt=S.get(pe.start??"")??0,pt=S.get(pe.end??"")??0,ar=cn>1&&F(pe.start,ue)||kt>1&&F(pe.end,X),Ie=cn<=1||Pt<=2,ai=kt<=1||pt<=2;if((vt||Kt)&&!Br&&(!bt||bt&&!ar&&Ie&&ai)&&!T(j,J,pe.start,pe.end)){pe.points=[{...j},{...fe},{...ee},{...J}],y.add(le);const En=Kt?"horizontal":"vertical",gs=Kt?j.y:j.x,mn=Kt?Math.min(j.x,J.x):Math.min(j.y,J.y),mi=Kt?Math.max(j.x,J.x):Math.max(j.y,J.y),An={id:`fast-path-${En}-${gs.toFixed(0)}-${le}`,orientation:En,coord:gs,spanMin:mn,spanMax:mi,tracks:[]};g.push({edgeIndex:le,segmentIndex:0,orientation:En,pipe:An,trackIndex:0,from:mn,to:mi});continue}}const Oe=d("vertical",fe.x,fe.y,fe.y);fe.x=Oe.coord;const mt=d("vertical",ee.x,ee.y,ee.y);ee.x=mt.coord;let Le=Math.min(fe.x,ee.x)-50,St=Math.max(fe.x,ee.x)+50,At=Math.min(fe.y,ee.y)-50,lt=Math.max(fe.y,ee.y)+50;for(const ht of h){const vt=Math.min(fe.x,ee.x),Kt=Math.max(fe.x,ee.x),Br=Math.min(fe.y,ee.y),cn=Math.max(fe.y,ee.y);ht.minXvt&&ht.minYBr&&(Le=Math.min(Le,ht.minX-A8),St=Math.max(St,ht.maxX+A8),At=Math.min(At,ht.minY-A8),lt=Math.max(lt,ht.maxY+A8))}for(const ht of h){if(ht.maxXSt||ht.maxYlt)continue;const vt=Dm;d("horizontal",ht.minY-vt,Le,St),d("horizontal",ht.maxY+vt,Le,St);const Kt=jv;d("vertical",ht.minX-Kt,At,lt),d("vertical",ht.maxX+Kt,At,lt)}d("horizontal",fe.y,Le,St),d("horizontal",ee.y,Le,St);const zt=o.filter(ht=>ht.orientation==="horizontal"&&ht.coord>=At&&ht.coord<=lt),It=o.filter(ht=>ht.orientation==="vertical"&&ht.coord>=Le&&ht.coord<=St),ft=w((ht,vt)=>`${ht.toFixed(1)},${vt.toFixed(1)}`,"getKey"),xe=ft(fe.x,fe.y),Nt=ft(ee.x,ee.y),Tt=new Map,yt=new Map,Rt=new Map,Or=new Set,Ee=[];Tt.set(xe,0),Rt.set(xe,"n"),Ee.push({key:xe,f:Math.hypot(ee.x-fe.x,ee.y-fe.y),pt:fe}),Or.add(xe);let it=[];const gt=w((ht,vt)=>T(ht,vt,pe.start,pe.end),"checkSegmentBlocked"),xt={x:ee.x,y:fe.y},nr=gt(fe,xt),$r=gt(xt,ee),kr=nr||$r,Ur={x:fe.x,y:ee.y},Er=gt(fe,Ur),nn=gt(Ur,ee);if(kr?Er||nn||(Math.abs(fe.x-ee.x)0;){Ee.sort((pt,ar)=>pt.f-ar.f);const ht=Ee.shift();if(Or.delete(ht.key),ht.key===Nt){let pt=Nt,ar=ee;for(it=[ar];yt.has(pt);){const Ie=yt.get(pt);it.unshift(Ie),ar=Ie,pt=ft(Ie.x,Ie.y)}break}const vt=ht.pt.x,Kt=ht.pt.y,Br=It.sort((pt,ar)=>pt.coord-ar.coord),cn=Br.findIndex(pt=>Math.abs(pt.coord-vt)<1),kt=zt.sort((pt,ar)=>pt.coord-ar.coord),bt=kt.findIndex(pt=>Math.abs(pt.coord-Kt)<1),Pt=[];cn>0&&Pt.push({x:Br[cn-1].coord,y:Kt}),cn>=0&&cn0&&Pt.push({x:vt,y:kt[bt-1].coord}),bt>=0&&btJs.nodeId===pe.start||Js.nodeId===pe.end?!1:ar!==Ie?Js.minYKt&&Js.maxX>ar&&Js.minXvt&&Js.maxY>ai&&Js.minY10&&Fh<-5||Lo<-10&&Fh>5)&&(mi=Math.abs(Fh)*100),(An>10&&Vu<-5||An<-10&&Vu>5)&&(mi+=Math.abs(Vu)*50);let ym=0;const vm=Rt.get(ht.key)??"n",bm=Math.abs(Vu)>Cn?"h":"v";vm!=="n"&&vm!==bm&&(ym=50);const ga=gs+mn+mi+ym,ql=(Tt.get(ht.key)??1/0)+ga,ao=Math.abs(ee.x-pt.x)+Math.abs(ee.y-pt.y);if(ql<(Tt.get(En)??1/0))if(yt.set(En,ht.pt),Tt.set(En,ql),Rt.set(En,bm),!Or.has(En))Ee.push({key:En,f:ql+ao,pt}),Or.add(En);else{const Js=Ee.findIndex(Cc=>Cc.key===En);Js!==-1&&(Ee[Js].f=ql+ao)}}}if(it.length===0&&(it=[fe,{x:fe.x,y:ee.y},ee]),it.length>4){const ht=it[0],vt=it[it.length-1];let Kt=Math.min(ht.x,vt.x),Br=Math.max(ht.x,vt.x),cn=Math.min(ht.y,vt.y),kt=Math.max(ht.y,vt.y);for(const ai of it)Kt=Math.min(Kt,ai.x),Br=Math.max(Br,ai.x),cn=Math.min(cn,ai.y),kt=Math.max(kt,ai.y);const bt=Br>Math.max(ht.x,vt.x),Pt=Ktmn.minXBe&&mn.minYun);if(gs.length>0){let mn=Math.max(ht.x,vt.x);for(const mi of gs){const An=(mi.minX+mi.maxX)/2;if(mi.visualXHalfExtent===void 0||isNaN(mi.visualXHalfExtent))continue;const Lo=An+mi.visualXHalfExtent+ai;mn=Math.max(mn,Lo)}isNaN(mn)||(Br=mn)}}if(Pt){const Be=h.filter(un=>un.minXMath.min(ht.y,vt.y));if(Be.length>0){let un=Math.min(ht.x,vt.x);for(const En of Be){const mn=(En.minX+En.maxX)/2-En.visualXHalfExtent-ai;un=Math.min(un,mn)}Kt=un}}}const pt=w(ai=>{const Be=vt.y>ht.y,un=h.filter(mn=>{const mi=Math.min(ht.x,vt.x)mn.minX,An=Math.min(ht.y,vt.y)mn.minY;return mi&&An});let En=un;if(l&&un.length>0){const mn=un.filter(mi=>mi.minXai);mn.length>0&&(En=mn)}if(En.length===0)return vt.y;const gs=Dm;if(Be){const mi=Math.max(...En.map(An=>An.maxY))+gs;if(miAn.minY))-gs;if(mi>vt.y+Cn)return mi}return vt.y},"findBestReturnY"),ar=w(ai=>{const Be=pt(ai),un={x:ai,y:ht.y},En={x:ai,y:Be},gs={x:vt.x,y:Be},mn=gt(ht,un),mi=gt(un,En),An=gt(En,gs),Lo=Be!==vt.y?gt(gs,vt):!1;return!mn&&!mi&&!An&&!Lo?Math.abs(Be-vt.y)=3){const ht=Yr[Yr.length-1],vt=Yr[Yr.length-2],Kt=Yr[Yr.length-3],Br=Math.abs(Kt.y-vt.y)Math.abs(ht.x-Kt.x)&&Yr.splice(-2,1)}else if(cn){const kt=Math.sign(vt.y-Kt.y),bt=Math.sign(ht.y-Kt.y);kt!==0&&kt===bt&&Math.abs(vt.y-Kt.y)>Math.abs(ht.y-Kt.y)&&Yr.splice(-2,1)}}const wn=[Yr[0]];for(let ht=1;htvt.x,kt=Br.x>Kt.x;if(cn!==kt){wn.push(Kt);continue}continue}if(Math.abs(vt.x-Kt.x)vt.y,kt=Br.y>Kt.y;if(cn!==kt){wn.push(Kt);continue}continue}wn.push(Kt)}wn.push(Yr[Yr.length-1]);for(let ht=0;htle.from{const j=!ne.segments.some(ue=>(ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex)&&B(ue,le)),J=!Ce.segments.some(ue=>(ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex)&&B(ue,pe));return j&&J?(le.trackIndex=ne.index,pe.trackIndex=Ce.index,Ce.segments=[...Ce.segments.filter(ue=>ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex),{edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,from:pe.from,to:pe.to}],ne.segments=[...ne.segments.filter(ue=>ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],!0):!1},"trySwapSegmentsAcrossTracks"),G=w(le=>{const pe=le.tracks.length;return le.tracks[pe]={index:pe,coord:le.coord,segments:[]},pe},"createNewTrack"),W=w((le,pe)=>{const Ce=le.pipe.tracks[le.trackIndex];Ce.segments=Ce.segments.filter(j=>j.edgeIndex!==le.edgeIndex||j.segmentIndex!==le.segmentIndex),le.trackIndex=pe,le.pipe.tracks[pe].segments.push({edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to})},"moveSegmentToTrack"),K=w((le,pe)=>{const Ce=m[le.edgeIndex];for(const ne of Ce){const j=g[ne];j.pipe===le.pipe&&W(j,pe)}},"moveSegmentChainToTrack"),q=w(le=>{const pe=m[le.edgeIndex],Ce=pe.indexOf(g.indexOf(le)),ne=[];return Ce>0&&ne.push(g[pe[Ce-1]]),Ce{if(le.orientation===pe.orientation)return!1;const Ce=le.orientation==="horizontal"?le:pe,ne=le.orientation==="horizontal"?pe:le;return ne.pipe.coord>Ce.from&&ne.pipe.coordne.from&&Ce.pipe.coord{for(const Ce of le.tracks)if(!Ce.segments.some(j=>(j.edgeIndex!==pe.edgeIndex||j.segmentIndex!==pe.segmentIndex)&&B(j,pe)))return Ce.index;return-1},"findAvailableTrack"),Z=w((le,pe)=>{if(le.trackIndex===pe.trackIndex)return B(le,pe);const Ce=q(le),ne=q(pe);return Ce.some(j=>ne.some(J=>oe(j,J)))},"segmentsConflict"),re=w((le,pe,Ce)=>{if(H(le,pe,le.pipe.tracks[le.trackIndex],pe.pipe.tracks[pe.trackIndex]))return;const ne=Q(le.pipe,pe);Ce(pe,ne!==-1?ne:G(le.pipe))},"resolveTrackConflict"),ie=w(le=>{let pe=0;for(let Ce=0;Ce{if(me.has(le))return me.get(le);const pe=m[le];if(pe.length===0){const X={dest:0,deviation:0,base:0,delta:0};return me.set(le,X),X}const ne=g[pe[0]].pipe.coord;let j=ne;for(let X=1;XMath.abs(Ae-ne)?ee:Ae;break}}const J=Math.abs(j-ne),ue={dest:j,deviation:J,base:ne,delta:j-ne};return me.set(le,ue),ue},"getDestInfo"),_e=w(()=>{let le=0;const pe=new Map;for(const[ne,j]of i.entries())m[ne].length!==0&&j.start&&(pe.has(j.start)||pe.set(j.start,[]),pe.get(j.start).push(ne));const Ce=w(ne=>{const j=i[ne];if(!j.start||!j.end)return 0;const J=s.get(j.start),ue=s.get(j.end);if(!J||!ue)return 0;const X=(ue.x??0)-(J.x??0),fe=(ue.y??0)-(J.y??0);return Math.abs(X)+Math.abs(fe)},"getEdgeDistance");for(const ne of pe.values()){ne.sort((J,ue)=>{const X=te(J),fe=te(ue);if(Math.abs(X.deviation-fe.deviation)>1)return X.deviation-fe.deviation;if(Math.abs(X.dest-fe.dest)>1)return X.dest-fe.dest;const ee=Ce(J),Ae=Ce(ue);if(Math.abs(ee-Ae)>1)return Ae-ee;const Re=m[J].length,Xe=m[ue].length;if(Re!==Xe)return Re-Xe;if(Re===1){const Ne=m[J][0],qe=m[ue][0];if(g[Ne]&&g[qe]){const De=g[Ne],Ke=g[qe],ze=Math.abs(De.to-De.from),st=Math.abs(Ke.to-Ke.from);if(Math.abs(ze-st)>1)return ze-st}}return 0});const j=ne.map(J=>g[m[J][0]]);le+=ie(j)}return le},"fixSourceHandleCrossings"),$e=w(()=>{let le=0;const pe=new Map;for(const[Ce,ne]of i.entries())m[Ce].length!==0&&ne.end&&(pe.has(ne.end)||pe.set(ne.end,[]),pe.get(ne.end).push(Ce));for(const Ce of pe.values()){Ce.sort((j,J)=>{const ue=w(ee=>{const Ae=m[ee];if(Ae.length<2)return 0;const Re=g[Ae[Ae.length-2]];return Math.abs(Re.to-Re.from)},"getDist"),X=ue(j),fe=ue(J);return Math.abs(X-fe)>.1?X-fe:j-J});const ne=Ce.map(j=>g[m[j][m[j].length-1]]);le+=ie(ne)}return le},"fixTargetHandleCrossings"),Fe=w(()=>{let le=0;for(const pe of o){const Ce=[];for(const ne of pe.tracks)for(const j of ne.segments){const J=m[j.edgeIndex].find(ue=>g[ue].segmentIndex===j.segmentIndex);J!==void 0&&Ce.push(g[J])}Ce.sort((ne,j)=>ne.edgeIndex-j.edgeIndex||ne.segmentIndex-j.segmentIndex);for(let ne=0;ne{ne.segments.forEach(j=>{pe.push({edgeIndex:j.edgeIndex,segmentIndex:j.segmentIndex,trackIndex:ne.index,from:j.from,to:j.to})})}),pe.sort((ne,j)=>ne.from-j.from);const Ce=[];if(pe.length>0){let ne=[pe[0]],j=pe[0].to;for(let J=1;Jj.add(Ne.trackIndex));const J=new Map;ne.forEach(Ne=>{const qe=te(Ne.edgeIndex);J.set(Ne.trackIndex,(J.get(Ne.trackIndex)??0)+qe.delta)});const ue=[...j].filter(Ne=>(J.get(Ne)??0)<-1),X=[...j].filter(Ne=>(J.get(Ne)??0)>1),fe=[...j].filter(Ne=>Math.abs(J.get(Ne)??0)<=1);ue.sort((Ne,qe)=>(J.get(qe)??0)-(J.get(Ne)??0)),X.sort((Ne,qe)=>(J.get(Ne)??0)-(J.get(qe)??0));const ee=w((Ne,qe)=>{ne.filter(De=>De.trackIndex===Ne).forEach(De=>{const Ke=y.has(De.edgeIndex)?le.coord:qe;Te.set(`${De.edgeIndex}-${De.segmentIndex}`,Ke)})},"assignCoord");let Ae=0;for(const Ne of ue)Ae++,ee(Ne,le.coord-Ae*uF);if(fe.length===0&&j.size>0){const Ne=[...j].sort((Ke,ze)=>Math.abs(J.get(Ke)??0)-Math.abs(J.get(ze)??0))[0],qe=ue.indexOf(Ne);qe!==-1&&ue.splice(qe,1);const De=X.indexOf(Ne);De!==-1&&X.splice(De,1),fe.push(Ne)}let Re=0;for(const Ne of fe){if(Re===0)ee(Ne,le.coord);else{const qe=Re%2===1?1:-1,De=Math.ceil(Re/2);ee(Ne,le.coord+qe*De*uF*.5)}Re++}let Xe=0;for(const Ne of X)Xe++,ee(Ne,le.coord+Xe*uF)}}for(const[le,pe]of i.entries()){const Ce=m[le]??[];if(Ce.length===0)continue;const ne=[],j=s.get(pe.start),J=s.get(pe.end),{pSrcPort:ue,pDstPort:X}=V(le,j,J),fe=Ce.map(Re=>{const Xe=g[Re],Ne=Te.get(`${Xe.edgeIndex}-${Xe.segmentIndex}`)??Xe.pipe.coord;return{orient:Xe.orientation,coord:Ne,from:Xe.from,to:Xe.to}});ne.push(ue);for(let Re=0;ReCn&&ne.push(Xm(Xe,qe)),ze&&Ke.orient===Xe.orient)if(Math.abs(Xe.coord-Ke.coord)>Cn){const st=Xe.orient==="vertical"?(qe+Ke.from)/2:_q(Xe,Ke);ne.push(Xm(Xe,st),Xm(Ke,st))}else(Re===0||Re===fe.length-2)&&ne.push(Xm(Xe,_q(Xe,Ke)));else if(ze)ne.push(Xm(Xe,Ke.coord));else{const st=Math.abs(Xe.from-qe)Cn||Math.abs(ee.y-X.y)>Cn)&&ne.push(X);const Ae=[];ne.length>0&&Ae.push(ne[0]);for(let Re=1;ReCn||Math.abs(Xe.y-Ne.y)>Cn)&&Ae.push(Xe)}pe.points=Ae}for(const le of i){const pe=le.__originalEdge;pe&&le.points&&(pe.points=le.points)}t.edges=(t.edges??[]).filter(le=>!le.isLayoutOnly);const ge=w((le,pe)=>{const Ce=pe.x??0,ne=pe.y??0,j=pe.width??0,J=pe.height??0;if(j<=0||J<=0)return le;const ue=Ce-j/2,X=Ce+j/2,fe=ne-J/2,ee=ne+J/2;if(le.xX||le.yee)return le;const Ae=le.x-ue,Re=X-le.x,Xe=le.y-fe,Ne=ee-le.y,qe=Math.min(Ae,Re,Xe,Ne);return qe===Ae?{x:ue,y:le.y}:qe===Re?{x:X,y:le.y}:qe===Xe?{x:le.x,y:fe}:{x:le.x,y:ee}},"nodeBoundaryClamp");for(const le of t.edges){const pe=le.points;if(!pe||pe.length<2)continue;const Ce=le.start,ne=le.end,j=Ce?s.get(Ce):void 0,J=ne?s.get(ne):void 0;j&&(pe[0]=ge(pe[0],j)),J&&(pe[pe.length-1]=ge(pe[pe.length-1],J))}return t}w(a_e,"routeEdgesOrthogonal");function o_e(t){return t.direction??"TB"}w(o_e,"getSwimlaneDirection");function l_e(t){var h,d,f,p,g;const e=WRe(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,s=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,a=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=o_e(t),{ordered:l,coordinates:u}=s_e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:s,automaticLaneOrdering:a,direction:o});qRe(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;a_e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return C9e(t,o),T9e(t),o}w(l_e,"runSwimlaneLayoutCore");async function c_e(t,e){const r=e.select("g");RZ(r,t.markers,t.type,t.diagramId),ZSe(),JSe(),_ke(),oRe(),GRe(t);const n=URe(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await RRe(r,t);l_e(t),await zRe(t,i)}w(c_e,"render");const qHt=Object.freeze(Object.defineProperty({__proto__:null,render:c_e},Symbol.toStringTag,{value:"Module"}));function Lq(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}function u_e(t,e,r){return(e=h_e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function XHt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function KHt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],l=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function ZHt(){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 QHt(){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 ra(t,e){return UHt(t)||KHt(t,e)||FJ(t,e)||ZHt()}function _L(t){return YHt(t)||XHt(t)||FJ(t)||QHt()}function JHt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function h_e(t){var e=JHt(t,"string");return typeof e=="symbol"?e:e+""}function La(t){"@babel/helpers - typeof";return La=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},La(t)}function FJ(t,e){if(t){if(typeof t=="string")return Lq(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lq(t,e):void 0}}var xa=typeof window>"u"?null:window,Cfe=xa?xa.navigator:null;xa&&xa.document;var eGt=La(""),d_e=La({}),tGt=La(function(){}),rGt=typeof HTMLElement>"u"?"undefined":La(HTMLElement),m7=function(e){return e&&e.instanceString&&Ts(e.instanceString)?e.instanceString():null},Dr=function(e){return e!=null&&La(e)==eGt},Ts=function(e){return e!=null&&La(e)===tGt},Ei=function(e){return!Vc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},jn=function(e){return e!=null&&La(e)===d_e&&!Ei(e)&&e.constructor===Object},nGt=function(e){return e!=null&&La(e)===d_e},Zt=function(e){return e!=null&&La(e)===La(1)&&!isNaN(e)},f_e=function(e){return Zt(e)&&Math.floor(e)===e},LL=function(e){if(rGt!=="undefined")return e!=null&&e instanceof HTMLElement},Vc=function(e){return y7(e)||p_e(e)},y7=function(e){return m7(e)==="collection"&&e._private.single},p_e=function(e){return m7(e)==="collection"&&!e._private.single},zJ=function(e){return m7(e)==="core"},g_e=function(e){return m7(e)==="stylesheet"},iGt=function(e){return m7(e)==="event"},Mg=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},sGt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},aGt=function(e){return jn(e)&&Zt(e.x1)&&Zt(e.x2)&&Zt(e.y1)&&Zt(e.y2)},oGt=function(e){return nGt(e)&&Ts(e.then)},lGt=function(){return Cfe&&Cfe.userAgent.match(/msie|trident|edge/i)},S5=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var s=[],a=0;ar?1:0},gGt=function(e,r){return-1*y_e(e,r)},Gr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+hGt+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,s=parseFloat(d[3]),s<0||s>100)||(s=s/100,a=d[4],a!==void 0&&(a=parseFloat(a),a<0||a>1)))return;if(i===0)o=l=u=Math.round(s*255);else{var f=s<.5?s*(1+i):s+i-s*i,p=2*s-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,a]}return r},vGt=function(e){var r,n=new RegExp("^"+cGt+"$").exec(e);if(n){r=[];for(var i=[],s=1;s<=3;s++){var a=n[s];if(a[a.length-1]==="%"&&(i[s]=!0),a=parseFloat(a),i[s]&&(a=a/100*255),a<0||a>255)return;r.push(Math.floor(a))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},bGt=function(e){return xGt[e.toLowerCase()]},v_e=function(e){return(Ei(e)?e:null)||bGt(e)||mGt(e)||vGt(e)||yGt(e)},xGt={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},b_e=function(e){for(var r=e.map,n=e.keys,i=n.length,s=0;s=l||L<0||x&&I>=f}function E(){var N=e();if(k(N))return A(N);g=setTimeout(E,S(N))}function A(N){return g=void 0,b&&h?T(N):(h=d=void 0,p)}function R(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function _(){return g===void 0?p:A(e())}function P(){var N=e(),L=k(N);if(h=arguments,d=this,m=N,L){if(g===void 0)return C(m);if(x)return clearTimeout(g),g=setTimeout(E,l),T(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=R,P.flush=_,P}return kF=a,kF}var _Gt=RGt(),w7=v7(_Gt),SF=xa?xa.performance:null,T_e=SF&&SF.now?function(){return SF.now()}:function(){return Date.now()},LGt=(function(){if(xa){if(xa.requestAnimationFrame)return function(t){xa.requestAnimationFrame(t)};if(xa.mozRequestAnimationFrame)return function(t){xa.mozRequestAnimationFrame(t)};if(xa.webkitRequestAnimationFrame)return function(t){xa.webkitRequestAnimationFrame(t)};if(xa.msRequestAnimationFrame)return function(t){xa.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(T_e())},1e3/60)}})(),IL=function(e){return LGt(e)},k0=T_e,d1=9261,C_e=65599,A2=5381,k_e=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d1,n=r,i;i=e.next(),!i.done;)n=n*C_e+i.value|0;return n},H6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d1;return r*C_e+e|0},G6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:A2;return(r<<5)+r+e|0},IGt=function(e,r){return e*2097152+r},mp=function(e){return e[0]*2097152+e[1]},R8=function(e,r){return[H6(e[0],r[0]),G6(e[1],r[1])]},Ffe=function(e,r){var n={value:0,done:!1},i=0,s=e.length,a={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},qJ=function(e){e.splice(0,e.length)},HGt=function(e,r){for(var n=0;n"u"?"undefined":La(Set))!==WGt?Set:qGt,QD=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!zJ(e)){as("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){as("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var s=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new T3,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(s.position.x==null&&(s.position.x=0),s.position.y==null&&(s.position.y=0),r.renderedPosition){var a=r.renderedPosition,o=e.pan(),l=e.zoom();s.position={x:(a.x-o.x)/l,y:(a.y-o.y)/l}}var u=[];Ei(r.classes)?u=r.classes:Dr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,T,C){var S;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(T==null&&(T=v.length);bR;0<=R?A++:A--)E.push(A);return E}).apply(this).reverse(),k=[],T=0,C=S.length;T_;0<=_?++E:--E)P.push(a(v,b));return P},m=function(v,x,b,T){var C,S,k;for(T==null&&(T=n),C=v[b];b>x;){if(k=b-1>>1,S=v[k],T(C,S)<0){v[b]=S,b=k;continue}break}return v[b]=C},y=function(v,x,b){var T,C,S,k,E;for(b==null&&(b=n),C=v.length,E=x,S=v[x],T=2*x+1;T0;){var S=x.pop(),k=y(S),E=S.id();if(f[E]=k,k!==1/0)for(var A=S.neighborhood().intersect(g),R=0;R0)for(D.unshift(O);d[z];){var V=d[z];D.unshift(V.edge),D.unshift(V.node),F=V.node,z=F.id()}return o.spawn(D)}}}},QGt={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,s=n.length,a=new Array(s),o=n,l=function(T){for(var C=0;C0;){if(C(),k++,T===h){for(var E=[],A=s,R=h,_=v[R];E.unshift(A),_!=null&&E.unshift(_),A=y[R],A!=null;)R=A.id(),_=v[R];return{found:!0,distance:d[T],path:this.spawn(E),steps:k}}p[T]=!0;for(var P=b._private.edges,N=0;N_&&(g[R]=_,x[R]=A,b[R]=C),!s){var P=A*h+E;!s&&g[P]>_&&(g[P]=_,x[P]=E,b[P]=C)}}}for(var N=0;N1&&arguments[1]!==void 0?arguments[1]:a,Te=b(ce),ge=[],He=Te;;){if(He==null)return r.spawn();var we=x(He),Me=we.edge,je=we.pred;if(ge.unshift(He[0]),He.same(he)&&ge.length>0)break;Me!=null&&ge.unshift(Me),He=je}return l.spawn(ge)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var s=Math.floor(Math.random()*r.length);r=aWt(s,e,r),n--}return r},oWt={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(D){return D.isLoop()});var s=n.length,a=i.length,o=Math.ceil(Math.pow(Math.log(s)/Math.LN2,2)),l=Math.floor(s/sWt);if(s<2){as("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,s=0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];a?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}s&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},L_e=function(e,r){return r===0?e:L_e(r,e%r)},fWt=function(e){for(var r=e[0],n=0;n0&&(r=L_e(r,e[n]));else return 0;return r},pWt=function(e){return Math.PI*e/180},_8=function(e,r){return Math.atan2(r,e)-Math.PI/2},UJ=Math.log2||function(t){return Math.log(t)/Math.log(2)},YJ=function(e){return e>0?1:e<0?-1:0},Iy=function(e,r){return Math.sqrt(Km(e,r))},Km=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},gWt=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},yWt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},vWt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},bWt=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},I_e=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},JM=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},eR=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,s,a;if(r.length===1)n=i=s=a=r[0];else if(r.length===2)n=s=r[0],a=i=r[1];else if(r.length===4){var o=ra(r,4);n=o[0],i=o[1],s=o[2],a=o[3]}return e.x1-=a,e.x2+=i,e.y1-=n,e.y2+=s,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},qfe=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},jJ=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Yp=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},Ufe=function(e,r){return Yp(e,r.x,r.y)},N_e=function(e,r){return Yp(e,r.x1,r.y1)&&Yp(e,r.x2,r.y2)},xWt=(MF=Math.hypot)!==null&&MF!==void 0?MF:function(t,e){return Math.sqrt(t*t+e*e)};function wWt(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,A){return{x:E.x+A.x,y:E.y+A.y}},n=function(E,A){return{x:E.x-A.x,y:E.y-A.y}},i=function(E,A){return{x:E.x*A,y:E.y*A}},s=function(E,A){return E.x*A.y-E.y*A.x},a=function(E){var A=xWt(E.x,E.y);return A===0?{x:0,y:0}:{x:E.x/A,y:E.y/A}},o=function(E){for(var A=0,R=0;R7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?_g(s,a):l,h=s/2,d=a/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,x=y;if(g=jp(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,T=i-d+u-o,C=b,S=i+d-u+o;if(g=jp(e,r,n,i,b,T,C,S,!1),g.length>0)return g}if(f){var k=n-h+u-o,E=i+d+o,A=n+h-u+o,R=E;if(g=jp(e,r,n,i,k,E,A,R,!1),g.length>0)return g}if(p){var _=n-h-o,P=i-d+u-o,N=_,L=i+d-u+o;if(g=jp(e,r,n,i,_,P,N,L,!1),g.length>0)return g}var I;{var $=n-h+u,O=i-d+u;if(I=hk(e,r,n,i,$,O,u+o),I.length>0&&I[0]<=$&&I[1]<=O)return[I[0],I[1]]}{var D=n+h-u,F=i-d+u;if(I=hk(e,r,n,i,D,F,u+o),I.length>0&&I[0]>=D&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,V=i+d-u;if(I=hk(e,r,n,i,z,V,u+o),I.length>0&&I[0]>=z&&I[1]>=V)return[I[0],I[1]]}{var B=n-h+u,H=i+d-u;if(I=hk(e,r,n,i,B,H,u+o),I.length>0&&I[0]<=B&&I[1]>=H)return[I[0],I[1]]}return[]},CWt=function(e,r,n,i,s,a,o){var l=o,u=Math.min(n,s),h=Math.max(n,s),d=Math.min(i,a),f=Math.max(i,a);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},kWt=function(e,r,n,i,s,a,o,l,u){var h={x1:Math.min(n,o,s)-u,x2:Math.max(n,o,s)+u,y1:Math.min(i,l,a)-u,y2:Math.max(i,l,a)+u};return!(eh.x2||rh.y2)},SWt=function(e,r,n,i){n-=i;var s=r*r-4*e*n;if(s<0)return[];var a=Math.sqrt(s),o=2*e,l=(-r+a)/o,u=(-r-a)/o;return[l,u]},EWt=function(e,r,n,i,s){var a=1e-5;e===0&&(e=a),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,s[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),s[0]=-p+d+f,p+=(d+f)/2,s[4]=s[2]=-p,p=Math.sqrt(3)*(-f+d)/2,s[3]=p,s[5]=-p;return}if(s[5]=s[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),s[0]=-p+2*g,s[4]=s[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),s[0]=-p+g*Math.cos(h/3),s[2]=-p+g*Math.cos((h+2*Math.PI)/3),s[4]=-p+g*Math.cos((h+4*Math.PI)/3)},AWt=function(e,r,n,i,s,a,o,l){var u=1*n*n-4*n*s+2*n*o+4*s*s-4*s*o+o*o+i*i-4*i*a+2*i*l+4*a*a-4*a*l+l*l,h=9*n*s-3*n*n-3*n*o-6*s*s+3*s*o+9*i*a-3*i*i-3*i*l-6*a*a+3*a*l,d=3*n*n-6*n*s+n*o-n*e+2*s*s+2*s*e-o*e+3*i*i-6*i*a+i*l-i*r+2*a*a+2*a*r-l*r,f=1*n*s-n*n+n*e-s*e+i*a-i*i+i*r-a*r,p=[];EWt(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,x,b,T,C=0;C=0?Tu?(e-s)*(e-s)+(r-a)*(r-a):h-f},ac=function(e,r,n){for(var i,s,a,o,l,u=0,h=0;h=e&&e>=a||i<=e&&e<=a)l=(e-i)/(a-i)*(o-s)+s,l>r&&u++;else continue;return u%2!==0},S0=function(e,r,n,i,s,a,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var y=OL(h,-u);m=DL(y)}else m=h;return ac(e,r,m)},RWt=function(e,r,n,i,s,a,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,T=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,T];var C=x[1]*l[0]+e,S=x[1]*l[1]+r;return[b,T,C,S]}else return[b,T]},RF=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},jp=function(e,r,n,i,s,a,o,l,u){var h=e-s,d=n-e,f=o-s,p=r-a,g=i-r,m=l-a,y=f*p-m*h,v=d*p-g*h,x=m*d-f*g;if(x!==0){var b=y/x,T=v/x,C=.001,S=0-C,k=1+C;return S<=b&&b<=k&&S<=T&&T<=k?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?RF(e,n,o)===o?[o,l]:RF(e,n,s)===s?[s,a]:RF(s,o,n)===n?[n,i]:[]:[]},LWt=function(e,r,n,i,s){var a=[],o=i/2,l=s/2,u=r,h=n;a.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=OL(d,-l);p=DL(m)}else p=d}else p=n;for(var y,v,x,b,T=0;T2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=T)},get:function(b){return u[b]}},f=0;f0?I=L.edgesTo(N)[0]:I=N.edgesTo(L)[0];var $=i(I);N=N.id(),k[N]>k[_]+$&&(k[N]=k[_]+$,E.nodes.indexOf(N)<0?E.push(N):E.updateItem(N),S[N]=0,C[N]=[]),k[N]==k[_]+$&&(S[N]=S[N]+S[_],C[N].push(_))}else for(var O=0;O0;){for(var V=T.pop(),B=0;B0&&o.push(n[l]);o.length!==0&&s.push(i.collection(o))}return s},UWt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:XWt,o=i,l,u,h=0;h=2?pC(e,r,n,0,Zfe,KWt):pC(e,r,n,0,Kfe)},squaredEuclidean:function(e,r,n){return pC(e,r,n,0,Zfe)},manhattan:function(e,r,n){return pC(e,r,n,0,Kfe)},max:function(e,r,n){return pC(e,r,n,-1/0,ZWt)}};E5["squared-euclidean"]=E5.squaredEuclidean;E5.squaredeuclidean=E5.squaredEuclidean;function eO(t,e,r,n,i,s){var a;return Ts(t)?a=t:a=E5[t]||E5.euclidean,e===0&&Ts(t)?a(i,s):a(e,r,n,i,s)}var QWt=Mo({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),KJ=function(e){return QWt(e)},PL=function(e,r,n,i,s){var a=s!=="kMedoids",o=a?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return eO(e,i.length,o,l,u,h)},LF=function(e,r,n){for(var i=n.length,s=new Array(i),a=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},tqt=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);s[l].push(e[u])}for(var d=0;d=s.threshold||s.mode==="dendrogram"&&e.length===1)return!1;var g=r[a],m=r[i[a]],y;s.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;vn[m.key][x.key]&&(l=n[m.key][x.key])):s.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(s);return i},n0e=function(e,r,n){for(var i=[],s=0;so&&(a=u,o=r[s*e+u])}a>0&&i.push(a)}for(var h=0;hu&&(l=h,u=d)}n[s]=a[l]}return i=n0e(e,r,n),i},i0e=function(e){for(var r=this.cy(),n=this.nodes(),i=fqt(e),s={},a=0;a=_?(P=_,_=L,N=I):L>P&&(P=L);for(var $=0;$0?1:0;k[A%i.minIterations*o+B]=H,V+=H}if(V>0&&(A>=i.minIterations-1||A==i.maxIterations-1)){for(var G=0,W=0;W1||S>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,x.target().id()]}):a.forEach(function(x){var b=x.id();if(x.isNode()){var T=x.degree(!0);T%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(C){return d[b].push(C.id())})}else f[b]=[x.source().id(),x.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(s){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=a[0].id());var g=function(b){for(var T=b,C=[b],S,k,E;d[T].length;)S=d[T].shift(),k=f[S][0],E=f[S][1],T!=E?(d[E]=d[E].filter(function(A){return A!=S}),T=E):!s&&T!=k&&(d[k]=d[k].filter(function(A){return A!=S}),T=k),C.unshift(S),C.unshift(T);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(a.getElementById(y.shift())),m.unshift(a.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(a.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},I8=function(){var e=this,r={},n=0,i=0,s=[],a=[],o={},l=function(f,p){for(var g=a.length-1,m=[],y=e.spawn();a[g].x!=f||a[g].y!=p;)m.push(a.pop().edge),g--;m.push(a.pop().edge),m.forEach(function(v){var x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var T=b.id(),C=b.connectedEdges().intersection(e);y.merge(b),r[T].cutVertex?y.merge(C.filter(function(S){return S.isLoop()})):y.merge(C)})}),s.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)s.push(e.spawn(e.getElementById(p)));else{var y,v,x,b;m.forEach(function(T){y=T.source().id(),v=T.target().id(),x=y===p?v:y,x!==g&&(b=T.id(),o[b]||(o[b]=!0,a.push({x:p,y:x,edge:T})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:s}},wqt={hopcroftTarjanBiconnected:I8,htbc:I8,htb:I8,hopcroftTarjanBiconnectedComponents:I8},N8=function(){var e=this,r={},n=0,i=[],s=[],a=e.spawn(e),o=function(u){s.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=s.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),a=a.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:a,components:i}},Tqt={tarjanStronglyConnected:N8,tsc:N8,tscc:N8,tarjanStronglyConnectedComponents:N8},V_e={};[W6,ZGt,QGt,eWt,rWt,iWt,oWt,OWt,Fb,zb,Dq,jWt,oqt,hqt,vqt,xqt,wqt,Tqt].forEach(function(t){Gr(V_e,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var P_e=0,$_e=1,B_e=2,Sh=function(e){if(!(this instanceof Sh))return new Sh(e);this.id="Thenable/1.0.7",this.state=P_e,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Sh.prototype={fulfill:function(e){return Jfe(this,$_e,"fulfillValue",e)},reject:function(e){return Jfe(this,B_e,"rejectReason",e)},then:function(e,r){var n=this,i=new Sh;return n.onFulfilled.push(t0e(e,i,"fulfill")),n.onRejected.push(t0e(r,i,"reject")),F_e(n),i.proxy}};var Jfe=function(e,r,n,i){return e.state===P_e&&(e.state=r,e[n]=i,F_e(e)),e},F_e=function(e){e.state===$_e?e0e(e,"onFulfilled",e.fulfillValue):e.state===B_e&&e0e(e,"onRejected",e.rejectReason)},e0e=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var s=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var a=0;a-1}return XF=e,XF}var KF,k0e;function Sqt(){if(k0e)return KF;k0e=1;var t=eO();function e(r,n){var i=this.__data__,s=t(i,r);return s<0?(++this.size,i.push([r,n])):i[s][1]=n,this}return KF=e,KF}var ZF,S0e;function Eqt(){if(S0e)return ZF;S0e=1;var t=wqt(),e=Tqt(),r=Cqt(),n=kqt(),i=Sqt();function s(a){var o=-1,l=a==null?0:a.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ei(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,s=[],a=0,o=n.length;a0&&this.spawn(s).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};ZM.className=ZM.classNames=ZM.classes;var qn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Ea,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};qn.variable="(?:[\\w-.]|(?:\\\\"+qn.metaChar+"))+";qn.className="(?:[\\w-]|(?:\\\\"+qn.metaChar+"))+";qn.value=qn.string+"|"+qn.number;qn.id=qn.variable;(function(){var t,e,r;for(t=qn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(qn.comparatorOp+="|\\!"+e)})();var xi=function(){return{checks:[]}},pr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Dq=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return JHt(t.selector,e.selector)}),nUt=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return pi("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return pi("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&pi("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},cUt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Dr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case pr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case pr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case pr.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case pr.DATA_EXIST:{var b=h.field;return"["+b+"]"}case pr.META_COMPARE:{var T=h.operator,C=h.field;return"[["+C+n(e(T))+r(p)+"]]"}case pr.STATE:return p;case pr.ID:return"#"+p;case pr.CLASS:return"."+p;case pr.PARENT:case pr.CHILD:return s(h.parent,d)+n(">")+s(h.child,d);case pr.ANCESTOR:case pr.DESCENDANT:return s(h.ancestor,d)+" "+s(h.descendant,d);case pr.COMPOUND_SPLIT:{var S=s(h.left,d),k=s(h.subject,d),E=s(h.right,d);return S+(S.length>0?" ":"")+k+E}case pr.TRUE:return""}},s=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},a="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(s||o||h)&&(l=!s&&!a?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),s.add(h.id()),o&&n(i,s,h)}return t}function Y_e(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return KJ(this,t,e,Y_e)};function j_e(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}k5.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return KJ(this,t,e,j_e)};function yUt(t,e,r){j_e(t,e,r),Y_e(t,e,r)}k5.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return KJ(this,t,e,yUt)};k5.ancestors=k5.parents;var W6,X_e;W6=X_e={data:hi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:hi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:hi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:hi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:hi.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};W6.attr=W6.data;W6.removeAttr=W6.removeData;var vUt=X_e,rO={};function Sz(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],s=i._private.edges,a=0;ae}),minIndegree:jv("indegree",function(t,e){return te}),minOutdegree:jv("outdegree",function(t,e){return te})});Gr(rO,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):s!==void 0&&u.position({x:s.x+p.x,y:s.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var x=v?m.position():{x:0,y:0};return s={x:g.x-x.x,y:g.y-x.y},e===void 0?s:s[e]}else if(!a)return;return this}};mh.modelPosition=mh.point=mh.position;mh.modelPositions=mh.points=mh.positions;mh.renderedPoint=mh.renderedPosition;mh.relativePoint=mh.relativePosition;var bUt=K_e,S5=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},E5=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},xUt=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},Fb,nm;Fb=nm={};nm.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),s=e.x1*n+i.x,a=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:s,x2:a,y1:o,y2:l,w:a-s,h:l-o}};nm.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};nm.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(a){if(!a.isParent())return;var o=a._private,l=a.children(),u=a.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:a.pstyle("min-width").pfValue,left:a.pstyle("min-width-bias-left"),right:a.pstyle("min-width-bias-right")},height:{val:a.pstyle("min-height").pfValue,top:a.pstyle("min-height-bias-top"),bottom:a.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:a.pstyle("width").pfValue,h:a.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(A,R,_){var P=0,N=0,L=R+_;return A>0&&L>0&&(P=R/L*A,N=_/L*A),{biasDiff:P,biasComplementDiff:N}}function g(A,R,_,P){if(_.units==="%")switch(P){case"width":return A>0?_.pfValue*A:0;case"height":return R>0?_.pfValue*R:0;case"average":return A>0&&R>0?_.pfValue*(A+R)/2:0;case"min":return A>0&&R>0?A>R?_.pfValue*R:_.pfValue*A:0;case"max":return A>0&&R>0?A>R?_.pfValue*A:_.pfValue*R:0;default:return 0}else return _.units==="px"?_.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),T=b.biasDiff,C=b.biasComplementDiff,S=p(h.height.val-d.h,v,x),k=S.biasDiff,E=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,a.pstyle("padding"),a.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-T+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+E)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?s:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Tp=function(e,r){return r==null?e:Xu(e,r.x1,r.y1,r.x2,r.y2)},dC=function(e,r,n){return ul(e,r,n)},_8=function(e,r,n){if(!r.cy().headless()){var i=r._private,s=i.rstyle,a=s.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=s.srcX,u=s.srcY):n==="target"?(l=s.tgtX,u=s.tgtY):(l=s.midX,u=s.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-a,d.y1=u-a,d.x2=l+a,d.y2=u+a,d.w=d.x2-d.x1,d.h=d.y2-d.y1,XM(d,1),Xu(e,d.x1,d.y1,d.x2,d.y2)}}},Ez=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var s=r._private,a=s.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=dC(a,"labelWidth",n),d=dC(a,"labelHeight",n),f=dC(a,"labelX",n),p=dC(a,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,T=b/2,C=r.pstyle("text-background-padding").pfValue,S=2,k=d,E=h,A=E/2,R=k/2,_,P,N,L;if(y)_=f-A,P=f+A,N=p-R,L=p+R;else{switch(S5(l.value)){case"left":_=f-E,P=f;break;case"center":_=f-A,P=f+A;break;case"right":_=f,P=f+E;break}switch(E5(u.value)){case"top":N=p-k,L=p;break;case"center":N=p-R,L=p+R;break;case"bottom":N=p,L=p+k;break}}var I=g-Math.max(x,T)-C-S,$=g+Math.max(x,T)+C+S,O=m-Math.max(x,T)-C-S,D=m+Math.max(x,T)+C+S;_+=I,P+=$,N+=O,L+=D;var F=n||"main",z=s.labelBounds,V=z[F]=z[F]||{};V.x1=_,V.y1=N,V.x2=P,V.y2=L,V.w=P-_,V.h=L-N,V.leftPad=I,V.rightPad=$,V.topPad=O,V.botPad=D;var B=y&&v.strValue==="autorotate",H=v.pfValue!=null&&v.pfValue!==0;if(B||H){var G=B?dC(s.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(G),K=Math.sin(G),q=(_+P)/2,oe=(N+L)/2;if(!y){switch(S5(l.value)){case"left":q=P;break;case"right":q=_;break}switch(E5(u.value)){case"top":oe=L;break;case"bottom":oe=N;break}}var Q=function(Fe,ce){return Fe=Fe-q,ce=ce-oe,{x:Fe*W-ce*K+q,y:Fe*K+ce*W+oe}},Z=Q(_,N),re=Q(_,L),ie=Q(P,N),me=Q(P,L);_=Math.min(Z.x,re.x,ie.x,me.x),P=Math.max(Z.x,re.x,ie.x,me.x),N=Math.min(Z.y,re.y,ie.y,me.y),L=Math.max(Z.y,re.y,ie.y,me.y)}var te=F+"Rot",_e=z[te]=z[te]||{};_e.x1=_,_e.y1=N,_e.x2=P,_e.y2=L,_e.w=P-_,_e.h=L-N,Xu(e,_,N,P,L),Xu(s.labelBounds.all,_,N,P,L)}return e}},epe=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,s=r.pstyle("outline-offset").value,a=i+s;Q_e(e,r,n,a,"outside",a/2)}},Q_e=function(e,r,n,i,s,a){if(!(n===0||i<=0||s==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){s==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);Tp(e,m)}else a!=null&&a>0&&KM(e,[a,a,a,a])}}},wUt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,s=r.pstyle("border-position").value;Q_e(e,r,n,i,s)}},TUt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),s=n.headless(),a=Rl(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],x=function($e){return $e.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var T=0,C=0;i&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(C=e.pstyle("overlay-padding").value));var S=0,k=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(k=e.pstyle("underlay-padding").value));var E=Math.max(C,k),A=0,R=0;if(i&&(A=e.pstyle("width").pfValue,R=A/2),l&&r.includeNodes){var _=e.position();g=_.x,m=_.y;var P=e.outerWidth(),N=P/2,L=e.outerHeight(),I=L/2;h=g-N,d=g+N,f=m-I,p=m+I,Xu(a,h,f,d,p),i&&epe(a,e),i&&r.includeOutlines&&!s&&epe(a,e),i&&wUt(a,e)}else if(u&&r.includeEdges)if(i&&!s){var $=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=R,d+=R,f-=R,p+=R,Xu(a,h,f,d,p),$==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var D=h;h=d,d=D}if(f>p){var F=f;f=p,p=F}Xu(a,h-R,f-R,d+R,p+R)}}else if($==="bezier"||$==="unbundled-bezier"||Hp($,"segments")||Hp($,"taxi")){var z;switch($){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=y.linePts;break}if(z!=null)for(var V=0;Vd){var q=h;h=d,d=q}if(f>p){var oe=f;f=p,p=oe}h-=R,d+=R,f-=R,p+=R,Xu(a,h,f,d,p)}if(i&&r.includeEdges&&u&&(_8(a,e,"mid-source"),_8(a,e,"mid-target"),_8(a,e,"source"),_8(a,e,"target")),i){var Q=e.pstyle("ghost").value==="yes";if(Q){var Z=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;Xu(a,a.x1+Z,a.y1+re,a.x2+Z,a.y2+re)}}var ie=o.bodyBounds=o.bodyBounds||{};Ffe(ie,a),KM(ie,v),XM(ie,1),i&&(h=a.x1,d=a.x2,f=a.y1,p=a.y2,Xu(a,h-E,f-E,d+E,p+E));var me=o.overlayBounds=o.overlayBounds||{};Ffe(me,a),KM(me,v),XM(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?rWt(te.all):te.all=Rl(),i&&r.includeLabels&&(r.includeMainLabels&&Ez(a,e,null),u&&(r.includeSourceLabels&&Ez(a,e,"source"),r.includeTargetLabels&&Ez(a,e,"target")))}return a.x1=hu(a.x1),a.y1=hu(a.y1),a.x2=hu(a.x2),a.y2=hu(a.y2),a.w=hu(a.x2-a.x1),a.h=hu(a.y2-a.y1),a.w>0&&a.h>0&&b&&(KM(a,v),XM(a,1)),a},J_e=function(e){var r=0,n=function(a){return(a?1:0)<0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var a=0;a-1}return JF=e,JF}var ez,_0e;function Vqt(){if(_0e)return ez;_0e=1;var t=nO();function e(r,n){var i=this.__data__,s=t(i,r);return s<0?(++this.size,i.push([r,n])):i[s][1]=n,this}return ez=e,ez}var tz,L0e;function Hqt(){if(L0e)return tz;L0e=1;var t=$qt(),e=Bqt(),r=Fqt(),n=zqt(),i=Vqt();function s(a){var o=-1,l=a==null?0:a.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ei(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,s=[],a=0,o=n.length;a0&&this.spawn(s).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};tR.className=tR.classNames=tR.classes;var qn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Ea,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};qn.variable="(?:[\\w-.]|(?:\\\\"+qn.metaChar+"))+";qn.className="(?:[\\w-]|(?:\\\\"+qn.metaChar+"))+";qn.value=qn.string+"|"+qn.number;qn.id=qn.variable;(function(){var t,e,r;for(t=qn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(qn.comparatorOp+="|\\!"+e)})();var xi=function(){return{checks:[]}},pr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Bq=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return gGt(t.selector,e.selector)}),bUt=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return gi("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return gi("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&gi("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},SUt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Dr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case pr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case pr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case pr.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case pr.DATA_EXIST:{var b=h.field;return"["+b+"]"}case pr.META_COMPARE:{var T=h.operator,C=h.field;return"[["+C+n(e(T))+r(p)+"]]"}case pr.STATE:return p;case pr.ID:return"#"+p;case pr.CLASS:return"."+p;case pr.PARENT:case pr.CHILD:return s(h.parent,d)+n(">")+s(h.child,d);case pr.ANCESTOR:case pr.DESCENDANT:return s(h.ancestor,d)+" "+s(h.descendant,d);case pr.COMPOUND_SPLIT:{var S=s(h.left,d),k=s(h.subject,d),E=s(h.right,d);return S+(S.length>0?" ":"")+k+E}case pr.TRUE:return""}},s=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},a="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(s||o||h)&&(l=!s&&!a?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),s.add(h.id()),o&&n(i,s,h)}return t}function J_e(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return eee(this,t,e,J_e)};function eLe(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}A5.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eee(this,t,e,eLe)};function NUt(t,e,r){eLe(t,e,r),J_e(t,e,r)}A5.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eee(this,t,e,NUt)};A5.ancestors=A5.parents;var Y6,tLe;Y6=tLe={data:di.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:di.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:di.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:di.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:di.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:di.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Y6.attr=Y6.data;Y6.removeAttr=Y6.removeData;var DUt=tLe,sO={};function Rz(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],s=i._private.edges,a=0;ae}),minIndegree:Kv("indegree",function(t,e){return te}),minOutdegree:Kv("outdegree",function(t,e){return te})});Gr(sO,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):s!==void 0&&u.position({x:s.x+p.x,y:s.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var x=v?m.position():{x:0,y:0};return s={x:g.x-x.x,y:g.y-x.y},e===void 0?s:s[e]}else if(!a)return;return this}};bh.modelPosition=bh.point=bh.position;bh.modelPositions=bh.points=bh.positions;bh.renderedPoint=bh.renderedPosition;bh.relativePoint=bh.relativePosition;var OUt=rLe,M5=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},R5=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},PUt=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},Vb,am;Vb=am={};am.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),s=e.x1*n+i.x,a=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:s,x2:a,y1:o,y2:l,w:a-s,h:l-o}};am.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};am.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(a){if(!a.isParent())return;var o=a._private,l=a.children(),u=a.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:a.pstyle("min-width").pfValue,left:a.pstyle("min-width-bias-left"),right:a.pstyle("min-width-bias-right")},height:{val:a.pstyle("min-height").pfValue,top:a.pstyle("min-height-bias-top"),bottom:a.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:a.pstyle("width").pfValue,h:a.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(A,R,_){var P=0,N=0,L=R+_;return A>0&&L>0&&(P=R/L*A,N=_/L*A),{biasDiff:P,biasComplementDiff:N}}function g(A,R,_,P){if(_.units==="%")switch(P){case"width":return A>0?_.pfValue*A:0;case"height":return R>0?_.pfValue*R:0;case"average":return A>0&&R>0?_.pfValue*(A+R)/2:0;case"min":return A>0&&R>0?A>R?_.pfValue*R:_.pfValue*A:0;case"max":return A>0&&R>0?A>R?_.pfValue*A:_.pfValue*R:0;default:return 0}else return _.units==="px"?_.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),T=b.biasDiff,C=b.biasComplementDiff,S=p(h.height.val-d.h,v,x),k=S.biasDiff,E=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,a.pstyle("padding"),a.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-T+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+E)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?s:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Ep=function(e,r){return r==null?e:Qu(e,r.x1,r.y1,r.x2,r.y2)},gC=function(e,r,n){return dl(e,r,n)},D8=function(e,r,n){if(!r.cy().headless()){var i=r._private,s=i.rstyle,a=s.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=s.srcX,u=s.srcY):n==="target"?(l=s.tgtX,u=s.tgtY):(l=s.midX,u=s.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-a,d.y1=u-a,d.x2=l+a,d.y2=u+a,d.w=d.x2-d.x1,d.h=d.y2-d.y1,JM(d,1),Qu(e,d.x1,d.y1,d.x2,d.y2)}}},_z=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var s=r._private,a=s.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=gC(a,"labelWidth",n),d=gC(a,"labelHeight",n),f=gC(a,"labelX",n),p=gC(a,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,T=b/2,C=r.pstyle("text-background-padding").pfValue,S=2,k=d,E=h,A=E/2,R=k/2,_,P,N,L;if(y)_=f-A,P=f+A,N=p-R,L=p+R;else{switch(M5(l.value)){case"left":_=f-E,P=f;break;case"center":_=f-A,P=f+A;break;case"right":_=f,P=f+E;break}switch(R5(u.value)){case"top":N=p-k,L=p;break;case"center":N=p-R,L=p+R;break;case"bottom":N=p,L=p+k;break}}var I=g-Math.max(x,T)-C-S,$=g+Math.max(x,T)+C+S,O=m-Math.max(x,T)-C-S,D=m+Math.max(x,T)+C+S;_+=I,P+=$,N+=O,L+=D;var F=n||"main",z=s.labelBounds,V=z[F]=z[F]||{};V.x1=_,V.y1=N,V.x2=P,V.y2=L,V.w=P-_,V.h=L-N,V.leftPad=I,V.rightPad=$,V.topPad=O,V.botPad=D;var B=y&&v.strValue==="autorotate",H=v.pfValue!=null&&v.pfValue!==0;if(B||H){var G=B?gC(s.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(G),K=Math.sin(G),q=(_+P)/2,oe=(N+L)/2;if(!y){switch(M5(l.value)){case"left":q=P;break;case"right":q=_;break}switch(R5(u.value)){case"top":oe=L;break;case"bottom":oe=N;break}}var Q=function(Fe,ce){return Fe=Fe-q,ce=ce-oe,{x:Fe*W-ce*K+q,y:Fe*K+ce*W+oe}},Z=Q(_,N),re=Q(_,L),ie=Q(P,N),me=Q(P,L);_=Math.min(Z.x,re.x,ie.x,me.x),P=Math.max(Z.x,re.x,ie.x,me.x),N=Math.min(Z.y,re.y,ie.y,me.y),L=Math.max(Z.y,re.y,ie.y,me.y)}var te=F+"Rot",_e=z[te]=z[te]||{};_e.x1=_,_e.y1=N,_e.x2=P,_e.y2=L,_e.w=P-_,_e.h=L-N,Qu(e,_,N,P,L),Qu(s.labelBounds.all,_,N,P,L)}return e}},ape=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,s=r.pstyle("outline-offset").value,a=i+s;iLe(e,r,n,a,"outside",a/2)}},iLe=function(e,r,n,i,s,a){if(!(n===0||i<=0||s==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){s==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);Ep(e,m)}else a!=null&&a>0&&eR(e,[a,a,a,a])}}},$Ut=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,s=r.pstyle("border-position").value;iLe(e,r,n,i,s)}},BUt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),s=n.headless(),a=Ll(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],x=function($e){return $e.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var T=0,C=0;i&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(C=e.pstyle("overlay-padding").value));var S=0,k=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(k=e.pstyle("underlay-padding").value));var E=Math.max(C,k),A=0,R=0;if(i&&(A=e.pstyle("width").pfValue,R=A/2),l&&r.includeNodes){var _=e.position();g=_.x,m=_.y;var P=e.outerWidth(),N=P/2,L=e.outerHeight(),I=L/2;h=g-N,d=g+N,f=m-I,p=m+I,Qu(a,h,f,d,p),i&&ape(a,e),i&&r.includeOutlines&&!s&&ape(a,e),i&&$Ut(a,e)}else if(u&&r.includeEdges)if(i&&!s){var $=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=R,d+=R,f-=R,p+=R,Qu(a,h,f,d,p),$==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var D=h;h=d,d=D}if(f>p){var F=f;f=p,p=F}Qu(a,h-R,f-R,d+R,p+R)}}else if($==="bezier"||$==="unbundled-bezier"||Up($,"segments")||Up($,"taxi")){var z;switch($){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=y.linePts;break}if(z!=null)for(var V=0;Vd){var q=h;h=d,d=q}if(f>p){var oe=f;f=p,p=oe}h-=R,d+=R,f-=R,p+=R,Qu(a,h,f,d,p)}if(i&&r.includeEdges&&u&&(D8(a,e,"mid-source"),D8(a,e,"mid-target"),D8(a,e,"source"),D8(a,e,"target")),i){var Q=e.pstyle("ghost").value==="yes";if(Q){var Z=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;Qu(a,a.x1+Z,a.y1+re,a.x2+Z,a.y2+re)}}var ie=o.bodyBounds=o.bodyBounds||{};qfe(ie,a),eR(ie,v),JM(ie,1),i&&(h=a.x1,d=a.x2,f=a.y1,p=a.y2,Qu(a,h-E,f-E,d+E,p+E));var me=o.overlayBounds=o.overlayBounds||{};qfe(me,a),eR(me,v),JM(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?vWt(te.all):te.all=Ll(),i&&r.includeLabels&&(r.includeMainLabels&&_z(a,e,null),u&&(r.includeSourceLabels&&_z(a,e,"source"),r.includeTargetLabels&&_z(a,e,"target")))}return a.x1=pu(a.x1),a.y1=pu(a.y1),a.x2=pu(a.x2),a.y2=pu(a.y2),a.w=pu(a.x2-a.x1),a.h=pu(a.y2-a.y1),a.w>0&&a.h>0&&b&&(eR(a,v),JM(a,1)),a},sLe=function(e){var r=0,n=function(a){return(a?1:0)<0&&arguments[0]!==void 0?arguments[0]:$Ut,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)a(o);return this};_g.removeAllListeners=function(){return this.removeListener("*")};_g.emit=_g.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Ei(e)||(e=[e]),BUt(this,function(s,a){r!=null&&(n=[{event:a.event,type:a.type,namespace:a.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===a.type&&(!h.namespace||h.namespace===a.namespace||h.namespace===PUt)&&s.eventMatches(s.context,h,a)){var d=[a];e!=null&&EGt(d,e),s.beforeEmit(s.context,h,a),h.conf&&h.conf.one&&(s.listeners=s.listeners.filter(function(g){return g!==h}));var f=s.callbackContext(s.context,h,a),p=h.callback.apply(f,d);s.afterEmit(s.context,h,a),p===!1&&(a.stopPropagation(),a.preventDefault())}},l=0;l1&&!a){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,s.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,s=i.get(n);if(!s)return this;var a=s.index;return this.unmergeAt(a),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Dr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,s=0;sn&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,s=this,a=0;a=0&&s"u"?"undefined":La(Symbol))!=e&&La(Symbol.iterator)!=e;r&&(DL[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},s=0,a=this.length;return i_e({next:function(){return s1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var s=n._private.style[e];return s??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,s=n.style();if(jn(e)){var a=e;s.applyBypass(this,a,i),this.emitAndNotify("style")}else if(Dr(e))if(r===void 0){var o=this[0];return o?s.getStylePropertyValue(o,e):void 0}else s.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?s.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),s=this;if(e===void 0)for(var a=0;a0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Uo.neighbourhood=Uo.neighborhood;Uo.closedNeighbourhood=Uo.closedNeighborhood;Uo.openNeighbourhood=Uo.openNeighborhood;Gr(Uo,{source:vu(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:vu(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:hpe({attr:"source"}),targets:hpe({attr:"target"})});function hpe(t){return function(r){for(var n=[],i=0;i0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Uo.componentsOf=Uo.components;var So=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){as("A collection must have a reference to the core");return}var s=new Vf,a=!1;if(!r)r=[];else if(r.length>0&&jn(r[0])&&!p7(r[0])){a=!0;for(var o=[],l=new b3,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,s=[],a=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new So(n,o),z=0;z0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},s=r._private.cy;function a(L){for(var I=L._private.edges,$=0;$0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var P=0;P0?P=L:_=L;while(Math.abs(N)>a&&++I=s?x(R,I):$===0?I:T(R,_,_+u)}var S=!1;function k(){S=!0,(t!==e||r!==n)&&b()}var E=function(_){return S||k(),t===e&&r===n?_:_===0?0:_===1?1:y(C(_),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return A},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var XUt=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,s){var a={x:n.x+s.dx*i,v:n.v+s.dv*i,tension:n.tension,friction:n.friction};return{dx:a.v,dv:t(a)}}function r(n,i){var s={dx:n.v,dv:t(n)},a=e(n,i*.5,s),o=e(n,i*.5,a),l=e(n,i,o),u=1/6*(s.dx+2*(a.dx+o.dx)+l.dx),h=1/6*(s.dv+2*(a.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,s,a){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,s=parseFloat(s)||20,a=a||null,o.tension=i,o.friction=s,f=a!==null,f?(u=n(i,s),p=u/a*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),Li=function(e,r,n,i){var s=jUt(e,r,n,i);return function(a,o,l){return a+(o-a)*s(l)}},JM={linear:function(e,r,n){return e+(r-e)*n},ease:Li(.25,.1,.25,1),"ease-in":Li(.42,0,1,1),"ease-out":Li(0,0,.58,1),"ease-in-out":Li(.42,0,.58,1),"ease-in-sine":Li(.47,0,.745,.715),"ease-out-sine":Li(.39,.575,.565,1),"ease-in-out-sine":Li(.445,.05,.55,.95),"ease-in-quad":Li(.55,.085,.68,.53),"ease-out-quad":Li(.25,.46,.45,.94),"ease-in-out-quad":Li(.455,.03,.515,.955),"ease-in-cubic":Li(.55,.055,.675,.19),"ease-out-cubic":Li(.215,.61,.355,1),"ease-in-out-cubic":Li(.645,.045,.355,1),"ease-in-quart":Li(.895,.03,.685,.22),"ease-out-quart":Li(.165,.84,.44,1),"ease-in-out-quart":Li(.77,0,.175,1),"ease-in-quint":Li(.755,.05,.855,.06),"ease-out-quint":Li(.23,1,.32,1),"ease-in-out-quint":Li(.86,0,.07,1),"ease-in-expo":Li(.95,.05,.795,.035),"ease-out-expo":Li(.19,1,.22,1),"ease-in-out-expo":Li(1,0,0,1),"ease-in-circ":Li(.6,.04,.98,.335),"ease-out-circ":Li(.075,.82,.165,1),"ease-in-out-circ":Li(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return JM.linear;var i=XUt(e,r,n);return function(s,a,o){return s+(a-s)*i(o)}},"cubic-bezier":Li};function ppe(t,e,r,n,i){if(n===1||e===r)return r;var s=i(e,r,n);return t==null||((t.roundValue||t.color)&&(s=Math.round(s)),t.min!==void 0&&(s=Math.max(s,t.min)),t.max!==void 0&&(s=Math.min(s,t.max))),s}function gpe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Xv(t,e,r,n,i){var s=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var a=gpe(t,i),o=gpe(e,i);if(Zt(a)&&Zt(o))return ppe(s,a,o,r,n);if(Ei(a)&&Ei(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(a.duration),a.easingImpl=JM[p].apply(null,g)):a.easingImpl=JM[p]}var m=a.easingImpl,y;if(a.duration===0?y=1:y=(r-l)/a.duration,a.applying&&(y=a.progress),y<0?y=0:y>1&&(y=1),a.delay==null){var v=a.startPosition,x=a.position;if(x&&i&&!t.locked()){var b={};pC(v.x,x.x)&&(b.x=Xv(v.x,x.x,y,m)),pC(v.y,x.y)&&(b.y=Xv(v.y,x.y,y,m)),t.position(b)}var T=a.startPan,C=a.pan,S=s.pan,k=C!=null&&n;k&&(pC(T.x,C.x)&&(S.x=Xv(T.x,C.x,y,m)),pC(T.y,C.y)&&(S.y=Xv(T.y,C.y,y,m)),t.emit("pan"));var E=a.startZoom,A=a.zoom,R=A!=null&&n;R&&(pC(E,A)&&(s.zoom=H6(s.minZoom,Xv(E,A,y,m),s.maxZoom)),t.emit("zoom")),(k||R)&&t.emit("viewport");var _=a.style;if(_&&_.length>0&&i){for(var P=0;P<_.length;P++){var N=_[P],L=N.name,I=N,$=a.startStyle[L],O=h.properties[$.name],D=Xv($,I,y,m,O);h.overrideBypass(t,L,D)}t.emit("style")}}return a.progress=y,y}function pC(t,e){return t==null||e==null?!1:Zt(t)&&Zt(e)?!0:!!(t&&e)}function ZUt(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function mpe(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var y=g.shift();y&&p.push(y)}for(var v=function(S){for(var k=S.length-1;k>=0;k--){var E=S[k];E()}S.splice(0,S.length)},x=p.length-1;x>=0;x--){var b=p[x],T=b._private;if(T.stopped){p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||ZUt(h,b,t),KUt(h,b,t,d),T.applying&&(T.applying=!1),v(T.frames),T.step!=null&&T.step(t),b.completed()&&(p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var s=!1,a=0;a0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var QUt={animate:hi.animate(),animation:hi.animation(),animated:hi.animated(),clearQueue:hi.clearQueue(),delay:hi.delay(),delayAnimation:hi.delayAnimation(),stop:hi.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&RL(function(s){mpe(s,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(s,a){mpe(a,e)},n.beforeRenderPriorities.animations):r()}},JUt={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&p7(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},N8=function(e){return Dr(e)?new Mg(e):e},uLe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new nO(JUt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,N8(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,N8(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,N8(r),n),this},once:function(e,r,n){return this.emitter().one(e,N8(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};hi.eventAliasesOn(uLe);var Pq={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};Pq.jpeg=Pq.jpg;var eR={layout:function(e){var r=this;if(e==null){as("Layout options must be specified to make a layout");return}if(e.name==null){as("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){as("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var s;Dr(e.eles)?s=r.$(e.eles):s=e.eles!=null?e.eles:r.$();var a=new i(Gr({},e,{cy:r,eles:s}));return a}};eR.createLayout=eR.makeLayout=eR.layout;var eYt={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var s=this.renderer();this.destroyed()||!s||s.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};$q.invalidateDimensions=$q.resize;var tR={collection:function(e,r){return Dr(e)?this.$(e):Bc(e)?e.collection():Ei(e)?(r||(r={}),new So(this,e,r.unique,r.removed)):new So(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};tR.elements=tR.filter=tR.$;var to={},aS="t",rYt="f";to.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),s=0;s0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(T=1),o.color){var S=n.valueMin[0],k=n.valueMax[0],E=n.valueMin[1],A=n.valueMax[1],R=n.valueMin[2],_=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],L=[Math.round(S+(k-S)*T),Math.round(E+(A-E)*T),Math.round(R+(_-R)*T),Math.round(P+(N-P)*T)];s={bypass:n.bypass,name:n.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*T;s=this.parse(n.name,I,n.bypass,f)}else return!1;if(!s)return m(),!1;s.mapping=n,n=s;break}case a.data:{for(var $=n.field.split("."),O=d.data,D=0;D<$.length&&O;D++){var F=$[D];O=O[F]}if(O!=null&&(s=this.parse(n.name,O,n.bypass,f)),!s)return m(),!1;s.mapping=n,n=s;break}case a.fn:{var z=n.value,V=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=V,V==null)return pi("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(s=this.parse(n.name,V,n.bypass,f),!s)return pi("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;s.mapping=gd(n),n=s;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};to.cleanElements=function(t,e){for(var r=0;r0&&s>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(a).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:s,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};to.checkTrigger=function(t,e,r,n,i,s){var a=this.properties[e],o=i(a);t.removed()||o!=null&&o(r,n,t)&&s(a)};to.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(s){return s.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};to.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};to.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};to.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};to.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var w7={};w7.applyBypass=function(t,e,r,n){var i=this,s=[],a=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){s.length>a.length?s=s.substr(a.length):s=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){pi("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new Mg(d);if(f.invalid){pi("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;s=p;for(var m=[];;){var y=s.match(/^\s*$/);if(y)break;var v=s.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){pi("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}a=v[0];var x=v[1],b=v[2],T=e.properties[x];if(!T){pi("Skipping property: Invalid property name in: "+a),l();continue}var C=r.parse(x,b);if(!C){pi("Skipping property: Invalid property definition in: "+a),l();continue}m.push({name:x,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return pi("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,x=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(x)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Ei(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var T=[],C=[],S=[],k="",E=!1,A=0;A0?" ":"")+R.strValue}return u.validate&&!u.validate(T,C)?null:u.singleEnum&&E?T.length===1&&Dr(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:S,strValue:k,bypass:r,units:C}}var _=function(){for(var Q=0;Qu.max||u.strictMax&&e===u.max))return null;var $={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?$.pfValue=e:$.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&($.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&($.pfValue=P==="rad"?e:QGt(e)),P==="%"&&($.pfValue=e/100),$}else if(u.propList){var O=[],D=""+e;if(D!=="none"){for(var F=D.split(/\s*,\s*|\s+/),z=0;z0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((a-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,s,a,o=!1;if(r.zoomingEnabled||(o=!0),Zt(e)?a=e:jn(e)&&(a=e.level,e.position!=null?s=KD(e.position,i,n):e.renderedPosition!=null&&(s=e.renderedPosition),s!=null&&!r.panningEnabled&&(o=!0)),a=a>r.maxZoom?r.maxZoom:a,a=ar.maxZoom||!r.zoomingEnabled?a=!0:(r.zoom=l,s.push("zoom"))}if(i&&(!a||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Zt(u.x)&&(r.pan.x=u.x,o=!1),Zt(u.y)&&(r.pan.y=u.y,o=!1),o||s.push("pan")}return s.length>0&&(s.push("viewport"),this.emit(s.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Dr(e)){var n=e;e=this.mutableElements().filter(n)}else Bc(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),s=this.width(),a=this.height();r=r===void 0?this._private.zoom:r;var o={x:(s-r*(i.x1+i.x2))/2,y:(a-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),s=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-s("padding-left")-s("padding-right"),height:r.clientHeight-s("padding-top")-s("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Iy.centre=Iy.center;Iy.autolockNodes=Iy.autolock;Iy.autoungrabifyNodes=Iy.autoungrabify;var U6={data:hi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:hi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:hi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};U6.attr=U6.data;U6.removeAttr=U6.removeData;var Y6=function(e){var r=this;e=Gr({},e);var n=e.container;n&&!ML(n)&&ML(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var s=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var a=xa!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Gr({name:a?"grid":"null"},o.layout),o.renderer=Gr({name:a?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new So(this),listeners:[],aniEles:new So(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?a:o.styleEnabled,zoom:Zt(o.zoom)?o.zoom:1,pan:{x:jn(o.pan)&&Zt(o.pan.x)?o.pan.x:0,y:jn(o.pan)&&Zt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(qHt);if(y)return x3.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Gr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(jn(g)||Ei(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var x=Gr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Ts(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Rl(o?t.boundingBox:structuredClone(e.extent())),u;if(Bc(t.roots))u=t.roots;else if(Ei(t.roots)){for(var h=[],d=0;d0;){var L=N(),I=A(L,_);if(I)L.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(P);else if(I===null){pi("Detected double maximal shift for node `"+L.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(t.avoidOverlap)for(var O=0;O0&&v[0].length<=3?Me/2:0),le=2*Math.PI/v[He].length*we;return He===0&&v[0].length===1&&(je=1),{x:ie.x+je*Math.cos(le),y:ie.y+je*Math.sin(le)}}else{var pe=v[He].length,Ce=Math.max(pe===1?0:o?(l.w-t.padding*2-me.w)/((t.grid?_e:pe)-1):(l.w-t.padding*2-me.w)/((t.grid?_e:pe)+1),$),ne={x:ie.x+(we+1-(pe+1)/2)*Ce,y:ie.y+(He+1-(W+1)/2)*te};return ne}},Fe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Fe).indexOf(t.direction)===-1&&as("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Fe).join(", ")));var ce=function(Te){return xGt($e(Te),l,Fe[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var oYt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function dLe(t){this.options=Gr({},oYt,t)}dLe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,s=n.nodes().not(":parent");e.sort&&(s=s.sort(e.sort));for(var a=Rl(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/s.length:e.sweep,u=l/Math.max(1,s.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var T=function(S,k){var E=e.startAngle+k*u*(i?1:-1),A=h*Math.cos(E),R=h*Math.sin(E),_={x:o.x+A,y:o.y+R};return _};return n.nodes().layoutPositions(this,e,T),this};var lYt={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function fLe(t){this.options=Gr({},lYt,t)}fLe.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,s=i.nodes().not(":parent"),a=Rl(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},l=[],u=0,h=0;h0){var C=Math.abs(x[0].value-T.value);C>=y&&(x=[],v.push(x))}x.push(T)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,E=Math.min(a.w,a.h)/2-S,A=E/(v.length+k?1:0);S=Math.min(S,A)}for(var R=0,_=0;_1&&e.avoidOverlap){var I=Math.cos(L)-Math.cos(0),$=Math.sin(L)-Math.sin(0),O=Math.sqrt(S*S/(I*I+$*$));R=Math.max(O,R)}P.r=R,R+=S}if(e.equidistant){for(var D=0,F=0,z=0;z=t.numIter||(gYt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&s(),RL(h)}};h()}else{for(;u;)u=a(l),l++;bpe(n,t),o()}return this};lO.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};lO.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var uYt=function(e,r,n){for(var i=n.eles.edges(),s=n.eles.nodes(),a=Rl(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:s.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(E);for(var h=0;hi.count?0:i.graph},pLe=function(e,r,n,i){var s=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=PL(e,o,l),y=PL(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},vYt=function(e,r,n,i){if(n>0)var s=e.maxX-r.minX;else var s=r.maxX-e.minX;if(i>0)var a=e.maxY-r.minY;else var a=r.maxY-e.minY;return s>=0&&a>=0?Math.sqrt(s*s+a*a):0},PL=function(e,r,n){var i=e.positionX,s=e.positionY,a=e.height||1,o=e.width||1,l=n/r,u=a/o,h={};return r===0&&0n?(h.x=i,h.y=s+a/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=s-o*n/2/r,h):0=u)?(h.x=i+a*r/2/n,h.y=s+a/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-a*r/2/n,h.y=s-a/2),h)},bYt=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},wYt=function(e,r){var n=[],i=0,s=-1;for(n.push.apply(n,e.graphSet[0]),s+=e.graphSet[0].length;i<=s;){var a=n[i++],o=e.idToIndex[a],l=e.layoutNodes[o],u=l.children;if(0n)var s={x:n*e/i,y:n*r/i};else var s={x:e,y:r};return s},mLe=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],s=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,s=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,s=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},kYt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function yLe(t){this.options=Gr({},kYt,t)}yLe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var s=Rl(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(s.h===0||s.w===0)n.nodes().layoutPositions(this,e,function(H){return{x:s.x1,y:s.y1}});else{var a=i.size(),o=Math.sqrt(a*s.h/s.w),l=Math.round(o),u=Math.round(s.w/s.h*o),h=function(G){if(G==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=G:u=G},d=function(G){if(G==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=G:u=G},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(a/l);else if(f==null&&p!=null)u=p,l=Math.ceil(a/u);else if(u*l>a){var g=h(),m=d();(g-1)*m>=a?h(g-1):(m-1)*g>=a&&d(m-1)}else for(;u*l=a?d(v+1):h(y+1)}var x=s.w/u,b=s.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var T=0;T=u&&(I=0,L++)},O={},D=0;D(I=dWt(t,e,$[O],$[O+1],$[O+2],$[O+3])))return y(k,I),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var $=A.allpts,O=0;O+5(I=hWt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5])))return y(k,I),!0}for(var D=D||E.source,F=F||E.target,z=i.getArrowWidth(R,_),V=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],O=0;O0&&(v(D),v(F))}function b(k,E,A){return ul(k,E,A)}function T(k,E){var A=k._private,R=f,_;E?_=E+"-":_="",k.boundingBox();var P=A.labelBounds[E||"main"],N=k.pstyle(_+"label").value,L=k.pstyle("text-events").strValue==="yes";if(!(!L||!N)){var I=b(A.rscratch,"labelX",E),$=b(A.rscratch,"labelY",E),O=b(A.rscratch,"labelAngle",E),D=k.pstyle(_+"text-margin-x").pfValue,F=k.pstyle(_+"text-margin-y").pfValue,z=P.x1-R-D,V=P.x2+R-D,B=P.y1-R-F,H=P.y2+R-F;if(O){var G=Math.cos(O),W=Math.sin(O),K=function(me,te){return me=me-I,te=te-$,{x:me*G-te*W+I,y:me*W+te*G+$}},q=K(z,B),oe=K(z,H),Q=K(V,B),Z=K(V,H),re=[q.x+D,q.y+F,Q.x+D,Q.y+F,Z.x+D,Z.y+F,oe.x+D,oe.y+F];if(nc(t,e,re))return y(k),!0}else if(Gp(P,t,e))return y(k),!0}}for(var C=a.length-1;C>=0;C--){var S=a[C];S.isNode()?v(S)||T(S):x(S)||T(S)||T(S,"source")||T(S,"target")}return o};nv.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,s=this.cy.zoom(),a=2/s,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Rl({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(me,te,_e){return ul(me,te,_e)}function y(me,te){var _e=me._private,$e=a,Fe="";me.boundingBox();var ce=_e.labelBounds.main;if(!ce)return null;var he=m(_e.rscratch,"labelX",te),Te=m(_e.rscratch,"labelY",te),ge=m(_e.rscratch,"labelAngle",te),He=me.pstyle(Fe+"text-margin-x").pfValue,we=me.pstyle(Fe+"text-margin-y").pfValue,Me=ce.x1-$e-He,je=ce.x2+$e-He,le=ce.y1-$e-we,pe=ce.y2+$e-we;if(ge){var Ce=Math.cos(ge),ne=Math.sin(ge),j=function(ue,X){return ue=ue-he,X=X-Te,{x:ue*Ce-X*ne+he,y:ue*ne+X*Ce+Te}};return[j(Me,le),j(je,le),j(je,pe),j(Me,pe)]}else return[{x:Me,y:le},{x:je,y:le},{x:je,y:pe},{x:Me,y:pe}]}function v(me,te,_e,$e){function Fe(ce,he,Te){return(Te.y-ce.y)*(he.x-ce.x)>(he.y-ce.y)*(Te.x-ce.x)}return Fe(me,_e,$e)!==Fe(te,_e,$e)&&Fe(me,te,_e)!==Fe(me,te,$e)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},_Yt=function(e,r,n,i,s){if(e!==kpe?Spe(r,e,qh):RYt(iu,qh),Spe(r,n,iu),Tpe=qh.nx*iu.ny-qh.ny*iu.nx,Cpe=qh.nx*iu.nx-qh.ny*-iu.ny,df=Math.asin(Math.max(-1,Math.min(1,Tpe))),Math.abs(df)<1e-6){Bq=r.x,Fq=r.y,jm=Zv=0;return}u1=1,rR=!1,Cpe<0?df<0?df=Math.PI+df:(df=Math.PI-df,u1=-1,rR=!0):df>0&&(u1=-1,rR=!0),r.radius!==void 0?Zv=r.radius:Zv=i,Im=df/2,D8=Math.min(qh.len/2,iu.len/2),s?(Bh=Math.abs(Math.cos(Im)*Zv/Math.sin(Im)),Bh>D8?(Bh=D8,jm=Math.abs(Bh*Math.sin(Im)/Math.cos(Im))):jm=Zv):(Bh=Math.min(D8,Zv),jm=Math.abs(Bh*Math.sin(Im)/Math.cos(Im))),zq=r.x+iu.nx*Bh,Vq=r.y+iu.ny*Bh,Bq=zq-iu.ny*jm*u1,Fq=Vq+iu.nx*jm*u1,wLe=r.x+qh.nx*Bh,TLe=r.y+qh.ny*Bh,kpe=r};function CLe(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ree(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(_Yt(t,e,r,n,i),{cx:Bq,cy:Fq,radius:jm,startX:wLe,startY:TLe,stopX:zq,stopY:Vq,startAngle:qh.ang+Math.PI/2*u1,endAngle:iu.ang-Math.PI/2*u1,counterClockwise:rR})}var j6=.01,LYt=Math.sqrt(2*j6),Qo={};Qo.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,s,a=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=a.units!=null&&o.units!=null,u=function(C,S,k,E){var A=E-S,R=k-C,_=Math.sqrt(R*R+A*A);return{x:-A/_,y:R/_}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":s=r;break;case"intersection":s=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],a),f=ra(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=ra(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),s=b}else pi("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),s=n;break}}return{midptPts:s,vectorNormInverse:i}};Qo.findHaystackPoints=function(t){for(var e=0;e0?Math.max(X-fe,0):Math.min(X+fe,0)},N=P(R,E),L=P(_,A),I=!1;x===u?v=Math.abs(N)>Math.abs(L)?i:n:x===l||x===o?(v=n,I=!0):(x===s||x===a)&&(v=i,I=!0);var $=v===n,O=$?L:N,D=$?_:R,F=GJ(D),z=!1;!(I&&(T||S))&&(x===o&&D<0||x===l&&D>0||x===s&&D>0||x===a&&D<0)&&(F*=-1,O=F*Math.abs(O),z=!0);var V;if(T){var B=C<0?1+C:C;V=B*O}else{var H=C<0?O:0;V=H+C*F}var G=function(X){return Math.abs(X)=Math.abs(O)},W=G(V),K=G(Math.abs(O)-Math.abs(V)),q=W||K;if(q&&!z)if($){var oe=Math.abs(D)<=f/2,Q=Math.abs(R)<=p/2;if(oe){var Z=(h.x1+h.x2)/2,re=h.y1,ie=h.y2;r.segpts=[Z,re,Z,ie]}else if(Q){var me=(h.y1+h.y2)/2,te=h.x1,_e=h.x2;r.segpts=[te,me,_e,me]}else r.segpts=[h.x1,h.y2]}else{var $e=Math.abs(D)<=d/2,Fe=Math.abs(_)<=g/2;if($e){var ce=(h.y1+h.y2)/2,he=h.x1,Te=h.x2;r.segpts=[he,ce,Te,ce]}else if(Fe){var ge=(h.x1+h.x2)/2,He=h.y1,we=h.y2;r.segpts=[ge,He,ge,we]}else r.segpts=[h.x2,h.y1]}else if($){var Me=h.y1+V+(y?f/2*F:0),je=h.x1,le=h.x2;r.segpts=[je,Me,le,Me]}else{var pe=h.x1+V+(y?d/2*F:0),Ce=h.y1,ne=h.y2;r.segpts=[pe,Ce,pe,ne]}if(r.isRound){var j=t.pstyle("taxi-radius").value,J=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(j),r.isArcRadius=new Array(r.segpts.length/2).fill(J)}};Qo.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,s=e.srcW,a=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Zt(r.startX)||!Zt(r.startY),y=!Zt(r.arrowStartX)||!Zt(r.arrowStartY),v=!Zt(r.endX)||!Zt(r.endY),x=!Zt(r.arrowEndX)||!Zt(r.arrowEndY),b=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*T,S=_y({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=SD.poolIndex()){var F=O;O=D,D=F}var z=N.srcPos=O.position(),V=N.tgtPos=D.position(),B=N.srcW=O.outerWidth(),H=N.srcH=O.outerHeight(),G=N.tgtW=D.outerWidth(),W=N.tgtH=D.outerHeight(),K=N.srcShape=r.nodeShapes[e.getNodeShape(O)],q=N.tgtShape=r.nodeShapes[e.getNodeShape(D)],oe=N.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Q=N.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,Z=N.tgtRs=D._private.rscratch,re=N.srcRs=O._private.rscratch;N.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ie=0;ie=LYt||(le=Math.sqrt(Math.max(je*je,j6)+Math.max(Me*Me,j6)));var pe=N.vector={x:je,y:Me},Ce=N.vectorNorm={x:pe.x/le,y:pe.y/le},ne={x:-Ce.y,y:Ce.x};N.nodesOverlap=!Zt(le)||q.checkPoint(ce[0],ce[1],0,G,W,V.x,V.y,Q,Z)||K.checkPoint(Te[0],Te[1],0,B,H,z.x,z.y,oe,re),N.vectorNormInverse=ne,L={nodesOverlap:N.nodesOverlap,dirCounts:N.dirCounts,calculatedIntersection:!0,hasBezier:N.hasBezier,hasUnbundled:N.hasUnbundled,eles:N.eles,srcPos:V,srcRs:Z,tgtPos:z,tgtRs:re,srcW:G,srcH:W,tgtW:B,tgtH:H,srcIntn:ge,tgtIntn:he,srcShape:q,tgtShape:K,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:He.x2,y1:He.y2,x2:He.x1,y2:He.y1},vector:{x:-pe.x,y:-pe.y},vectorNorm:{x:-Ce.x,y:-Ce.y},vectorNormInverse:{x:-ne.x,y:-ne.y}}}var j=Fe?L:N;te.nodesOverlap=j.nodesOverlap,te.srcIntn=j.srcIntn,te.tgtIntn=j.tgtIntn,te.isRound=_e.startsWith("round"),i&&(O.isParent()||O.isChild()||D.isParent()||D.isChild())&&(O.parents().anySame(D)||D.parents().anySame(O)||O.same(D)&&O.isParent())?e.findCompoundLoopPoints(me,j,ie,$e):O===D?e.findLoopPoints(me,j,ie,$e):_e.endsWith("segments")?e.findSegmentsPoints(me,j):_e.endsWith("taxi")?e.findTaxiPoints(me,j):_e==="straight"||!$e&&N.eles.length%2===1&&ie===Math.floor(N.eles.length/2)?e.findStraightEdgePoints(me):e.findBezierPoints(me,j,ie,$e,Fe),e.findEndpoints(me),e.tryToCorrectInvalidPoints(me,j),e.checkForInvalidEdgeWarning(me),e.storeAllpts(me),e.storeEdgeProjections(me),e.calculateArrowAngles(me),e.recalculateEdgeLabelProjections(me),e.calculateLabelAngles(me)}},k=0;k0){var ce=u,he=Ym(ce,rb(a)),Te=Ym(ce,rb(Fe)),ge=he;if(Te2){var He=Ym(ce,{x:Fe[2],y:Fe[3]});He0){var ee=h,Ae=Ym(ee,rb(a)),Re=Ym(ee,rb(fe)),Xe=Ae;if(Re2){var Ne=Ym(ee,{x:fe[2],y:fe[3]});Ne=g||k){y={cp:T,segment:S};break}}if(y)break}var E=y.cp,A=y.segment,R=(g-v)/A.length,_=A.t1-A.t0,P=p?A.t0+_*R:A.t1-_*R;P=H6(0,P,1),e=Pb(E.p0,E.p1,E.p2,P),f=NYt(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var N=0,L,I,$,O,D=n.allpts.length,F=0;F+3=g));F+=2);var z=g-I,V=z/L;V=H6(0,V,1),e=eWt($,O,V),f=ELe($,O);break}}a("labelX",d,e.x),a("labelY",d,e.y),a("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Xd.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Xd.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Ry(n,t._private.labelDimsKey);if(ul(r.rscratch,"prefixedLabelDimsKey",e)!==i){rd(r.rscratch,"prefixedLabelDimsKey",e,i);var s=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=ul(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*a,f=s.width,p=s.height+(h-1)*(a-1)*o;rd(r.rstyle,"labelWidth",e,f),rd(r.rscratch,"labelWidth",e,f),rd(r.rstyle,"labelHeight",e,p),rd(r.rscratch,"labelHeight",e,p),rd(r.rscratch,"labelLineHeight",e,d),rd(r.rscratch,"labelActualDescent",e,s.labelActualDescent)}};Xd.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,s=t.pstyle("text-transform").value,a=function(H,G){return G?(rd(r.rscratch,H,e,G),G):ul(r.rscratch,H,e)};if(!i)return"";s=="none"||(s=="uppercase"?i=i.toUpperCase():s=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=a("labelKey");if(l!=null&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u="​",h=i.split(` -`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var C=v.matchAll(m),S="",k=0,E=oc(C),A;try{for(E.s();!(A=E.n()).done;){var R=A.value,_=R[0],P=v.substring(k,R.index);k=R.index+_.length;var N=S.length===0?P:S+P+_,L=this.calculateLabelDimensions(t,N),I=L.width;I<=d?S+=P+_:(S&&g.push(S),S=P+_)}}catch(B){E.e(B)}finally{E.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}a("labelWrapCachedLines",g),i=a("labelWrapCachedText",g.join(` -`)),a("labelWrapKey",l)}else if(o==="ellipsis"){var $=t.pstyle("text-max-width").pfValue,O="",D="…",F=!1;if(this.calculateLabelDimensions(t,i).width<$)return i;for(var z=0;z$)break;O+=i[z],z===i.length-1&&(F=!0)}return F||(O+=D),O}return i};Xd.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?xUt(r):"center":e};Xd.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,s=0,a=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(a," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` -`),v=y.length,x=0,b=0,T=0;T1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(a),o)for(var l=0;l=t.desktopTapThreshold2}var zt=s(j);Oe&&(t.hoverData.tapholdCancelled=!0);var It=function(){var xt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];xt.length===0?(xt.push(ze[0]),xt.push(ze[1])):(xt[0]+=ze[0],xt[1]+=ze[1])};ue=!0,i(qe,["mousemove","vmousemove","tapdrag"],j,{x:Ae[0],y:Ae[1]});var ft=function(xt){return{originalEvent:j,type:xt,position:{x:Ae[0],y:Ae[1]}}},xe=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit(ft("boxstart")),Ne[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Oe){var Nt=ft("cxtdrag");Ke?Ke.emit(Nt):X.emit(Nt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||qe!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ft("cxtdragout")),t.hoverData.cxtOver=qe,qe&&qe.emit(ft("cxtdragover")))}}else if(t.hoverData.dragging){if(ue=!0,X.panningEnabled()&&X.userPanningEnabled()){var Tt;if(t.hoverData.justStartedPan){var yt=t.hoverData.mdownPos;Tt={x:(Ae[0]-yt[0])*fe,y:(Ae[1]-yt[1])*fe},t.hoverData.justStartedPan=!1}else Tt={x:ze[0]*fe,y:ze[1]*fe};X.panBy(Tt),X.emit(ft("dragpan")),t.hoverData.dragged=!0}Ae=t.projectIntoViewport(j.clientX,j.clientY)}else if(Ne[4]==1&&(Ke==null||Ke.pannable())){if(Oe){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(zt||!X.panningEnabled()||!X.userPanningEnabled()))xe();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Rt=a(Ke,t.hoverData.downs);Rt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ne[4]=0,t.data.bgActivePosistion=rb(Re),t.redrawHint("select",!0),t.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&qe!=De&&(De&&i(De,["mouseout","tapdragout"],j,{x:Ae[0],y:Ae[1]}),qe&&i(qe,["mouseover","tapdragover"],j,{x:Ae[0],y:Ae[1]}),t.hoverData.last=qe),Ke)if(Oe){if(X.boxSelectionEnabled()&&zt)Ke&&Ke.grabbed()&&(m(st),Ke.emit(ft("freeon")),st.emit(ft("free")),t.dragData.didDrag&&(Ke.emit(ft("dragfreeon")),st.emit(ft("dragfree")))),xe();else if(Ke&&Ke.grabbed()&&t.nodeIsDraggable(Ke)){var Or=!t.dragData.didDrag;Or&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(st,{inDragLayer:!0});var Ee={x:0,y:0};if(Zt(ze[0])&&Zt(ze[1])&&(Ee.x+=ze[0],Ee.y+=ze[1],Or)){var it=t.hoverData.dragDelta;it&&Zt(it[0])&&Zt(it[1])&&(Ee.x+=it[0],Ee.y+=it[1])}t.hoverData.draggingEles=!0,st.silentShift(Ee).emit(ft("position")).emit(ft("drag")),t.redrawHint("drag",!0),t.redraw()}}else It();ue=!0}if(Ne[2]=Ae[0],Ne[3]=Ae[1],ue)return j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault(),!1}},!1);var R,_,P;t.registerBinding(e,"mouseup",function(j){if(!(t.hoverData.which===1&&j.which!==1&&t.hoverData.capture)){var J=t.hoverData.capture;if(J){t.hoverData.capture=!1;var ue=t.cy,X=t.projectIntoViewport(j.clientX,j.clientY),fe=t.selection,ee=t.findNearestElement(X[0],X[1],!0,!1),Ae=t.dragData.possibleDragElements,Re=t.hoverData.down,Xe=s(j);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Re&&Re.unactivate();var Ne=function(mt){return{originalEvent:j,type:mt,position:{x:X[0],y:X[1]}}};if(t.hoverData.which===3){var qe=Ne("cxttapend");if(Re?Re.emit(qe):ue.emit(qe),!t.hoverData.cxtDragged){var De=Ne("cxttap");Re?Re.emit(De):ue.emit(De)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(ee,["mouseup","tapend","vmouseup"],j,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Re,["click","tap","vclick"],j,{x:X[0],y:X[1]}),_=!1,j.timeStamp-P<=ue.multiClickDebounceTime()?(R&&clearTimeout(R),_=!0,P=null,i(Re,["dblclick","dbltap","vdblclick"],j,{x:X[0],y:X[1]})):(R=setTimeout(function(){_||i(Re,["oneclick","onetap","voneclick"],j,{x:X[0],y:X[1]})},ue.multiClickDebounceTime()),P=j.timeStamp)),Re==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!s(j)&&(ue.$(r).unselect(["tapunselect"]),Ae.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Ae=ue.collection()),ee==Re&&!t.dragData.didDrag&&!t.hoverData.selecting&&ee!=null&&ee._private.selectable&&(t.hoverData.dragging||(ue.selectionType()==="additive"||Xe?ee.selected()?ee.unselect(["tapunselect"]):ee.select(["tapselect"]):Xe||(ue.$(r).unmerge(ee).unselect(["tapunselect"]),ee.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ke=ue.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));t.redrawHint("select",!0),Ke.length>0&&t.redrawHint("eles",!0),ue.emit(Ne("boxend"));var ze=function(mt){return mt.selectable()&&!mt.selected()};ue.selectionType()==="additive"||Xe||ue.$(r).unmerge(Ke).unselect(),Ke.emit(Ne("box")).stdFilter(ze).select().emit(Ne("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!fe[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var st=Re&&Re.grabbed();m(Ae),st&&(Re.emit(Ne("freeon")),Ae.emit(Ne("free")),t.dragData.didDrag&&(Re.emit(Ne("dragfreeon")),Ae.emit(Ne("dragfree"))))}}fe[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var N=[],L=4,I,$=1e5,O=function(j){for(var J=Math.abs(j[0]),ue=1;ue=L){I=!1;var X=N;if(X[0]>=5){var fe;O(X)?fe=X[0]:fe=ZGt(X),fe>1&&(I=!0,$=fe)}}else N.push(Math.abs(ue)),J=!0;else I&&($=Math.min(Math.abs(ue),$));if(!t.scrollingPage){var ee=t.cy,Ae=ee.zoom(),Re=ee.pan(),Xe=t.projectIntoViewport(j.clientX,j.clientY),Ne=[Xe[0]*Ae+Re.x,Xe[1]*Ae+Re.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||k()){j.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){j.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var qe;J&&Math.abs(ue)>5&&(ue=GJ(ue)*5),qe=ue/-250,I&&(qe/=$,qe*=3),qe=qe*t.wheelSensitivity;var De=j.deltaMode===1;De&&(qe*=33);var Ke=ee.zoom()*Math.pow(10,qe);j.type==="gesturechange"&&(Ke=t.gestureStartZoom*j.scale),ee.zoom({level:Ke,renderedPosition:{x:Ne[0],y:Ne[1]}}),ee.emit({type:j.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:j,position:{x:Xe[0],y:Xe[1]}})}}}};t.registerBinding(t.container,"wheel",D,!0),t.registerBinding(e,"scroll",function(j){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(j){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||j.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||D(ne)},!0),t.registerBinding(t.container,"mouseout",function(j){var J=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseout",position:{x:J[0],y:J[1]}})},!1),t.registerBinding(t.container,"mouseover",function(j){var J=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseover",position:{x:J[0],y:J[1]}})},!1);var F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie=function(j,J,ue,X){return Math.sqrt((ue-j)*(ue-j)+(X-J)*(X-J))},me=function(j,J,ue,X){return(ue-j)*(ue-j)+(X-J)*(X-J)},te;t.registerBinding(t.container,"touchstart",te=function(j){if(t.hasTouchStarted=!0,!!E(j)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var J=t.cy,ue=t.touchData.now,X=t.touchData.earlier;if(j.touches[0]){var fe=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);ue[0]=fe[0],ue[1]=fe[1]}if(j.touches[1]){var fe=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);ue[2]=fe[0],ue[3]=fe[1]}if(j.touches[2]){var fe=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);ue[4]=fe[0],ue[5]=fe[1]}var ee=function(zt){return{originalEvent:j,type:zt,position:{x:ue[0],y:ue[1]}}};if(j.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var Ae=t.findContainerClientCoords();q=Ae[0],oe=Ae[1],Q=Ae[2],Z=Ae[3],F=j.touches[0].clientX-q,z=j.touches[0].clientY-oe,V=j.touches[1].clientX-q,B=j.touches[1].clientY-oe,re=0<=F&&F<=Q&&0<=V&&V<=Q&&0<=z&&z<=Z&&0<=B&&B<=Z;var Re=J.pan(),Xe=J.zoom();H=ie(F,z,V,B),G=me(F,z,V,B),W=[(F+V)/2,(z+B)/2],K=[(W[0]-Re.x)/Xe,(W[1]-Re.y)/Xe];var Ne=200,qe=Ne*Ne;if(G=1){for(var Le=t.touchData.startPosition=[null,null,null,null,null,null],St=0;St=t.touchTapThreshold2}if(J&&t.touchData.cxt){j.preventDefault();var St=j.touches[0].clientX-q,At=j.touches[0].clientY-oe,lt=j.touches[1].clientX-q,zt=j.touches[1].clientY-oe,It=me(St,At,lt,zt),ft=It/G,xe=150,Nt=xe*xe,Tt=1.5,yt=Tt*Tt;if(ft>=yt||It>=Nt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Rt=Xe("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Rt),t.touchData.start=null):X.emit(Rt)}}if(J&&t.touchData.cxt){var Rt=Xe("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Rt):X.emit(Rt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Or=t.findNearestElement(fe[0],fe[1],!0,!0);(!t.touchData.cxtOver||Or!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Xe("cxtdragout")),t.touchData.cxtOver=Or,Or&&Or.emit(Xe("cxtdragover")))}else if(J&&j.touches[2]&&X.boxSelectionEnabled())j.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit(Xe("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,ue[4]=1,!ue||ue.length===0||ue[0]===void 0?(ue[0]=(fe[0]+fe[2]+fe[4])/3,ue[1]=(fe[1]+fe[3]+fe[5])/3,ue[2]=(fe[0]+fe[2]+fe[4])/3+1,ue[3]=(fe[1]+fe[3]+fe[5])/3+1):(ue[2]=(fe[0]+fe[2]+fe[4])/3,ue[3]=(fe[1]+fe[3]+fe[5])/3),t.redrawHint("select",!0),t.redraw();else if(J&&j.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){j.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ee=t.dragData.touchDragEles;if(Ee){t.redrawHint("drag",!0);for(var it=0;it0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var $e;t.registerBinding(e,"touchcancel",$e=function(j){var J=t.touchData.start;t.touchData.capture=!1,J&&J.unactivate()});var Fe,ce,he,Te;if(t.registerBinding(e,"touchend",Fe=function(j){var J=t.touchData.start,ue=t.touchData.capture;if(ue)j.touches.length===0&&(t.touchData.capture=!1),j.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var fe=t.cy,ee=fe.zoom(),Ae=t.touchData.now,Re=t.touchData.earlier;if(j.touches[0]){var Xe=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);Ae[0]=Xe[0],Ae[1]=Xe[1]}if(j.touches[1]){var Xe=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);Ae[2]=Xe[0],Ae[3]=Xe[1]}if(j.touches[2]){var Xe=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);Ae[4]=Xe[0],Ae[5]=Xe[1]}var Ne=function(Nt){return{originalEvent:j,type:Nt,position:{x:Ae[0],y:Ae[1]}}};J&&J.unactivate();var qe;if(t.touchData.cxt){if(qe=Ne("cxttapend"),J?J.emit(qe):fe.emit(qe),!t.touchData.cxtDragged){var De=Ne("cxttap");J?J.emit(De):fe.emit(De)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!j.touches[2]&&fe.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ke=fe.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),fe.emit(Ne("boxend"));var ze=function(Nt){return Nt.selectable()&&!Nt.selected()};Ke.emit(Ne("box")).stdFilter(ze).select().emit(Ne("boxselect")),Ke.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(J!=null&&J.unactivate(),j.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!j.touches[1]){if(!j.touches[0]){if(!j.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var st=t.dragData.touchDragEles;if(J!=null){var Oe=J._private.grabbed;m(st),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Oe&&(J.emit(Ne("freeon")),st.emit(Ne("free")),t.dragData.didDrag&&(J.emit(Ne("dragfreeon")),st.emit(Ne("dragfree")))),i(J,["touchend","tapend","vmouseup","tapdragout"],j,{x:Ae[0],y:Ae[1]}),J.unactivate(),t.touchData.start=null}else{var mt=t.findNearestElement(Ae[0],Ae[1],!0,!0);i(mt,["touchend","tapend","vmouseup","tapdragout"],j,{x:Ae[0],y:Ae[1]})}var Le=t.touchData.startPosition[0]-Ae[0],St=Le*Le,At=t.touchData.startPosition[1]-Ae[1],lt=At*At,zt=St+lt,It=zt*ee*ee;t.touchData.singleTouchMoved||(J||fe.$(":selected").unselect(["tapunselect"]),i(J,["tap","vclick"],j,{x:Ae[0],y:Ae[1]}),ce=!1,j.timeStamp-Te<=fe.multiClickDebounceTime()?(he&&clearTimeout(he),ce=!0,Te=null,i(J,["dbltap","vdblclick"],j,{x:Ae[0],y:Ae[1]})):(he=setTimeout(function(){ce||i(J,["onetap","voneclick"],j,{x:Ae[0],y:Ae[1]})},fe.multiClickDebounceTime()),Te=j.timeStamp)),J!=null&&!t.dragData.didDrag&&J._private.selectable&&It"u"){var ge=[],He=function(j){return{clientX:j.clientX,clientY:j.clientY,force:1,identifier:j.pointerId,pageX:j.pageX,pageY:j.pageY,radiusX:j.width/2,radiusY:j.height/2,screenX:j.screenX,screenY:j.screenY,target:j.target}},we=function(j){return{event:j,touch:He(j)}},Me=function(j){ge.push(we(j))},je=function(j){for(var J=0;J0)return B[0]}return null},g=Object.keys(f),m=0;m0?p:M_e(s,a,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,s,a,o,l){l=l==="auto"?Ag(i,s):l;var u=2*l;if(x0(e,r,this.points,a,o,i,s-u,[0,-1],n)||x0(e,r,this.points,a,o,i-u,s,[0,-1],n))return!0;var h=i/2+2*n,d=s/2+2*n,f=[a-h,o-d,a-h,o,a+h,o,a+h,o-d];return!!(nc(e,r,f)||B1(e,r,u,u,a+i/2-l,o+s/2-l,n)||B1(e,r,u,u,a-i/2+l,o+s/2-l,n))}}};U0.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ol(3,0)),this.generateRoundPolygon("round-triangle",ol(3,0)),this.generatePolygon("rectangle",ol(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",ol(5,0)),this.generateRoundPolygon("round-pentagon",ol(5,0)),this.generatePolygon("hexagon",ol(6,0)),this.generateRoundPolygon("round-hexagon",ol(6,0)),this.generatePolygon("heptagon",ol(7,0)),this.generateRoundPolygon("round-heptagon",ol(7,0)),this.generatePolygon("octagon",ol(8,0)),this.generateRoundPolygon("round-octagon",ol(8,0));var n=new Array(20);{var i=Mq(5,0),s=Mq(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var o=0;o=e.deqFastCost*T)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*Rz)break;var C=e.deq(n,y,m);if(C.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&s())},o=e.priority||zJ;i.beforeRender(a,o(n))}}}},$Yt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_L;tm(this,t),this.idsByKey=new Vf,this.keyForId=new Vf,this.cachesByLvl=new Vf,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return rm(t,[{key:"getIdsFor",value:function(r){r==null&&as("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new b3,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),s=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(s,n),this.keyForId.set(n,s)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),s=this.getKey(r);return i!==s}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,s=n.get(r);return s||(s=new Vf,n.set(r,s),i.push(r)),s}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),s=this.getCache(i,n);return s!=null&&this.updateKeyMappingFor(r),s}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),s=this.getCache(i,n);return s}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var s=this.getKey(r);this.setCache(s,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var s=this.doesEleInvalidateKey(r);return s&&this.invalidateKey(i),s||this.getNumberOfIdsForKey(i)===0}}])})(),Rpe=25,O8=50,nR=-4,Hq=3,NLe=7.99,BYt=8,FYt=1024,zYt=1024,VYt=1024,HYt=.2,GYt=.8,WYt=10,qYt=.15,UYt=.1,YYt=.9,jYt=.9,XYt=100,KYt=1,ib={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ZYt=Mo({getKey:null,doesEleInvalidateKey:_L,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:x_e,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),uk=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=ZYt(r);Gr(n,i),n.lookup=new $Yt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Na=uk.prototype;Na.reasons=ib;Na.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Na.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Na.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new b7(function(r,n){return n.reqs-r.reqs});return e};Na.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Na.getElement=function(t,e,r,n,i){var s=this,a=this.renderer,o=a.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!s.allowEdgeTxrCaching&&t.isEdge()||!s.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(HJ(o*r))),n=NLe||n>Hq)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=a.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=Rpe?g=Rpe:h<=O8?g=O8:g=Math.ceil(h/O8)*O8,h>VYt||d>zYt)return null;var m=s.getTextureQueue(g),y=m[m.length-2],v=function(){return s.recycleTexture(g,d)||s.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;_--)A=s.getElement(t,e,r,_,ib.downscale);R()}else return s.queueElement(t,S.level-1),S;else{var P;if(!b&&!T&&!C)for(var N=n-1;N>=nR;N--){var L=l.get(t,N);if(L){P=L;break}}if(x(P))return s.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+BYt),y.eleCaches.push(p),l.set(t,n,p),s.checkTextureFullness(y),p};Na.invalidateElements=function(t){for(var e=0;e=HYt*t.width&&this.retireTexture(t)};Na.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>GYt&&t.fullnessChecks>=WYt?Eg(r,t):t.fullnessChecks++};Na.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Eg(n,t),t.retired=!0;for(var s=t.eleCaches,a=0;a=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,VJ(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Eg(i,a),n.push(a),a}};Na.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),s=this.getKey(t),a=i[s];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,n.updateItem(a);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:s};n.push(o),i[s]=o}};Na.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],s=e.lookup,a=0;a0;a++){var o=r.pop(),l=o.key,u=o.eles[0],h=s.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,ib.dequeue)}return i};Na.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),s=n[i];s!=null&&(s.eles.length===1?(s.reqs=FJ,r.updateItem(s),r.pop(),n[i]=null):s.eles.unmerge(t))};Na.onDequeue=function(t){this.onDequeues.push(t)};Na.offDequeue=function(t){Eg(this.onDequeues,t)};Na.setupDequeueing=ILe.setupDequeueing({deqRedrawThreshold:XYt,deqCost:qYt,deqAvgCost:UYt,deqNoDrawCost:YYt,deqFastCost:jYt,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=JYt||r>BL)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var R=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},_=function(I){if(!p)for(var $=r+I;oS<=$&&$<=BL&&!R($);$+=I);};_(1),_(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&Eg(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=Rl();for(var R=0;RLpe||N>Lpe)return null;var L=P*N;if(L>ojt)return null;var I=n.makeLayer(d,r);if(_!=null){var $=h.indexOf(_)+1;h.splice($,0,I)}else(R.insert===void 0||R.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,x=t.length/QYt,b=!o,T=0;T=x||!A_e(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(b?null:h)};Ro.getEleLevelForLayerLevel=function(t,e){return t};Ro.drawEleInLayer=function(t,e,r,n){var i=this,s=this.renderer,a=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),s.setImgSmoothing(a,!1),s.drawCachedElement(a,e,null,null,r,ljt),s.setImgSmoothing(a,!0))};Ro.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,s=0;s0||a.invalid)return!1;i+=a.eles.length}return i===e.length};Ro.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};Ro.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=b0(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,s){e.invalidateLayer(n)}))};Ro.invalidateLayer=function(t){if(this.lastInvalidationTime=b0(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Eg(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,o=e._private.rscratch;if(!(s&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=s?e.pstyle("opacity").value:1,h=s?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,x=u*h,b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(a.eleStrokeStyle(t,e,I),a.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,a.eleStrokeStyle(t,e,I),a.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},T=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)a.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?a.drawEdgeTrianglePath(e,t,o.allpts):(a.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&a.drawEdgeOverlay(t,e)},S=function(){i&&a.drawEdgeUnderlay(t,e)},k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;a.drawArrowheads(t,e,I)},E=function(){a.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var R=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,N=v*P;t.translate(R,_),b(N),k(N),t.translate(-R,-_)}else T();S(),b(),k(),C(),E(),r&&t.translate(l.x1,l.y1)}};var PLe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var s=this,a=s.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!a?r.lineCap="butt":r.lineCap="round",s.colorStrokeStyle(r,h[0],h[1],h[2],i),s.drawEdgePath(n,r,o.allpts,"solid")}}}};Y0.drawEdgeOverlay=PLe("overlay");Y0.drawEdgeUnderlay=PLe("underlay");Y0.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,s=e,a,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(a=e=i.pathCache,o=!0):(a=e=new Path2D,i.pathCacheKey=d,i.pathCache=a)}if(s.setLineDash)switch(n){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(u),s.lineDashOffset=h;break;case"solid":s.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,a=this;if(n==null){if(s&&!a.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=a.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(a.drawText(t,e,null,g,s),e.isEdge()&&(a.drawText(t,e,"source",g,s),a.drawText(t,e,"target",g,s))):a.drawText(t,e,i,g,s),r&&t.translate(m.x1,m.y1)};iv.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",s=e.pstyle("font-family").strValue,a=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+a+" "+i+" "+s,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function bjt(t,e,r,n,i){var s=Math.min(n,i),a=s/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,a,0,Math.PI*2),t.closePath()}function Ope(t,e,r,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,a=Math.min(s,n/2,i/2);t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath()}iv.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,s=e?e+"-":"",a=t.pstyle(s+"text-rotation");if(a.strValue==="autorotate"){var o=ul(i,"labelAngle",e);r=t.isEdge()?o:0}else a.strValue==="none"?r=0:r=a.pfValue;return r};iv.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=e._private,a=s.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=ul(a,"labelX",r),u=ul(a,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=ul(a,"labelWidth",r),m=ul(a,"labelHeight",r),y=ul(a,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),T=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(T="center",C="center"),l+=v,u+=x;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var k=S5(T),E=E5(C);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var A=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,L=N==="round-rectangle"||N==="roundrectangle",I=N==="circle",$=2;if(A>0||_>0&&R>0){var O=t.fillStyle,D=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,H=A>0,G=_>0&&R>0,W=l-P;switch(k){case"left":W-=g;break;case"center":W-=g/2;break}var K=u-m-P,q=g+2*P,oe=m+2*P;if(H&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(A*o,")")),G&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(R*o,")"),t.lineWidth=_,t.setLineDash))switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(L?(t.beginPath(),Ope(t,W,K,q,oe,$)):I?(t.beginPath(),bjt(t,W,K,q,oe)):(t.beginPath(),t.rect(W,K,q,oe)),H&&t.fill(),G&&t.stroke(),G&&B==="double"){var Q=_/2;t.beginPath(),L?Ope(t,W+Q,K+Q,q-2*Q,oe-2*Q,$):t.rect(W+Q,K+Q,q-2*Q,oe-2*Q),t.stroke()}t.fillStyle=O,t.strokeStyle=D,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var re=ul(a,"labelWrapCachedLines",r),ie=ul(a,"labelLineHeight",r),me=g/2,te=this.getLabelJustification(e);switch(te==="auto"||(k==="left"?te==="left"?l+=-g:te==="center"&&(l+=-me):k==="center"?te==="left"?l+=-me:te==="right"&&(l+=me):k==="right"&&(te==="center"?l+=me:te==="right"&&(l+=g))),E){case"top":u-=(re.length-1)*ie;break;case"center":case"bottom":u-=(re.length-1)*ie;break}for(var _e=0;_e0&&t.strokeText(re[_e],l,u),t.fillText(re[_e],l,u),u+=ie}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var im={};im.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Zt(d.x)||!Zt(d.y))&&!(s&&!e.visible())){var f=s?e.effectiveOpacity():1,p=a.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var x=e.pstyle("background-image"),b=x.value,T=new Array(b.length),C=new Array(b.length),S=0,k=0;k0&&arguments[0]!==void 0?arguments[0]:N;a.eleFillStyle(t,e,J)},Q=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;a.colorStrokeStyle(t,L[0],L[1],L[2],J)},Z=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;a.colorStrokeStyle(t,H[0],H[1],H[2],J)},re=function(J,ue,X,fe){var ee=a.nodePathCache=a.nodePathCache||[],Ae=b_e(X==="polygon"?X+","+fe.join(","):X,""+ue,""+J,""+q),Re=ee[Ae],Xe,Ne=!1;return Re!=null?(Xe=Re,Ne=!0,h.pathCache=Xe):(Xe=new Path2D,ee[Ae]=h.pathCache=Xe),{path:Xe,cacheHit:Ne}},ie=e.pstyle("shape").strValue,me=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var te=re(o,l,ie,me);g=te.path,m=te.cacheHit}var _e=function(){if(!m){var J=d;p&&(J={x:0,y:0}),a.nodeShapes[a.getNodeShape(e)].draw(g||t,J.x,J.y,o,l,q,h)}p?t.fill(g):t.fill()},$e=function(){for(var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,X=u.backgrounding,fe=0,ee=0;ee0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;a.hasPie(e)&&(a.drawPie(t,e,ue),J&&(p||a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h)))},ce=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;a.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h),t.clip()),a.drawStripe(t,e,ue),t.restore(),J&&(p||a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h)))},he=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=(_>0?_:-_)*J,X=_>0?0:255;_!==0&&(a.colorFillStyle(t,X,X,X,ue),p?t.fill(g):t.fill())},Te=function(){if(P>0){if(t.lineWidth=P,t.lineCap=O,t.lineJoin=$,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var J=new Path2D;J.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),J.addPath(g),t.clip(J,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=P/3;var ue=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ue}t.setLineDash&&t.setLineDash([])}},ge=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var J=d;p&&(J={x:0,y:0});var ue=a.getNodeShape(e),X=P;D==="inside"&&(X=0),D==="outside"&&(X*=2);var fe=(o+X+(B+K))/o,ee=(l+X+(B+K))/l,Ae=o*fe,Re=l*ee,Xe=a.nodeShapes[ue].points,Ne;if(p){var qe=re(Ae,Re,ue,Xe);Ne=qe.path}if(ue==="ellipse")a.drawEllipsePath(Ne||t,J.x,J.y,Ae,Re);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ue)){var De=0,Ke=0,ze=0;ue==="round-diamond"?De=(X+K+B)*1.4:ue==="round-heptagon"?(De=(X+K+B)*1.075,ze=-(X/2+K+B)/35):ue==="round-hexagon"?De=(X+K+B)*1.12:ue==="round-pentagon"?(De=(X+K+B)*1.13,ze=-(X/2+K+B)/15):ue==="round-tag"?(De=(X+K+B)*1.12,Ke=(X/2+B+K)*.07):ue==="round-triangle"&&(De=(X+K+B)*(Math.PI/2),ze=-(X+K/2+B)/Math.PI),De!==0&&(fe=(o+De)/o,Ae=o*fe,["round-hexagon","round-tag"].includes(ue)||(ee=(l+De)/l,Re=l*ee)),q=q==="auto"?__e(Ae,Re):q;for(var st=Ae/2,Oe=Re/2,mt=q+(X+B+K)/2,Le=new Array(Xe.length/2),St=new Array(Xe.length/2),At=0;At0){if(i=i||n.position(),s==null||a==null){var p=n.padding();s=n.width()+2*p,a=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,s+l*2,a+l*2,f),r.fill()}}}};im.drawNodeOverlay=$Le("overlay");im.drawNodeUnderlay=$Le("underlay");im.hasPie=function(t){return t=t[0],t._private.hasPie};im.hasStripe=function(t){return t=t[0],t._private.hasStripe};im.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),s=e.pstyle("pie-size"),a=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),s.units==="%"?f=f*s.pfValue:s.pfValue!==void 0&&(f=s.pfValue/2),a.units==="%"?p=f*a.pfValue:a.pfValue!==void 0&&(p=a.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,T=v/100;T+g>1&&(T=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var S=2*Math.PI*T,k=C+S;v===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=T)}};im.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),s=n.x,a=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(s=0,a=0),a-=p/2,s-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,x=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(s,a+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],x),t.fill(),u+=b)}t.restore()};var Bl={},xjt=100;Bl.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Bl.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),T=a!==void 0?a:b,C=r.pan(),S={x:C.x,y:C.y},k={zoom:b,pan:{x:C.x,y:C.y}},E=e.prevViewport,A=E===void 0||k.zoom!==E.zoom||k.pan.x!==E.pan.x||k.pan.y!==E.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),T*=l,S.x*=l,S.y*=l;var R=e.getCachedZSortedEles();function _(Q,Z,re,ie,me){var te=Q.globalCompositeOperation;Q.globalCompositeOperation="destination-out",e.colorFillStyle(Q,255,255,255,e.motionBlurTransparency),Q.fillRect(Z,re,ie,me),Q.globalCompositeOperation=te}function P(Q,Z){var re,ie,me,te;!e.clearingMotionBlur&&(Q===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Q===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(re={x:C.x*p,y:C.y*p},ie=b*p,me=e.canvasWidth*p,te=e.canvasHeight*p):(re=S,ie=T,me=e.canvasWidth,te=e.canvasHeight),Q.setTransform(1,0,0,1,0,0),Z==="motionBlur"?_(Q,0,0,me,te):!n&&(Z===void 0||Z)&&Q.clearRect(0,0,me,te),i||(Q.translate(re.x,re.y),Q.scale(ie,ie)),o&&Q.translate(o.x,o.y),a&&Q.scale(a,a)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var N=e.data.bufferContexts[e.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var L=u.contexts[e.NODE],I=e.textureCache.texture,k=e.textureCache.viewport;L.setTransform(1,0,0,1,0,0),f?_(L,0,0,k.width,k.height):L.clearRect(0,0,k.width,k.height);var $=x.core("outside-texture-bg-color").value,O=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(L,$[0],$[1],$[2],O),L.fillRect(0,0,k.width,k.height);var b=r.zoom();P(L,!1),L.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),L.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||s||V[e.NODE]){var B=f&&!V[e.NODE]&&p!==1,L=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),H=f&&!B?"motionBlur":void 0;P(L,H),z?e.drawCachedNodes(L,R.nondrag,l,D):e.drawLayeredElements(L,R.nondrag,l,D),e.debug&&e.drawDebugPoints(L,R.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!s&&(h[e.DRAG]||i||V[e.DRAG])){var B=f&&!V[e.DRAG]&&p!==1,L=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(L,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(L,R.drag,l,D):e.drawCachedElements(L,R.drag,l,D),e.debug&&e.drawDebugPoints(L,R.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var G=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],K=u.contexts[e.DRAG],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],oe=function(Z,re,ie){Z.setTransform(1,0,0,1,0,0),ie||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(Z,0,0,e.canvasWidth,e.canvasHeight);var me=p;Z.drawImage(re,0,0,e.canvasWidth*me,e.canvasHeight*me,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(oe(G,W,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(oe(K,q,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},xjt)),n||r.emit("render")};var gC;Bl.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,s=n.style(),a=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!a&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=s.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+s.core("selection-box-color").value[0]+","+s.core("selection-box-color").value[1]+","+s.core("selection-box-color").value[2]+","+s.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+s.core("selection-box-border-color").value[0]+","+s.core("selection-box-border-color").value[1]+","+s.core("selection-box-border-color").value[2]+","+s.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+s.core("active-bg-color").value[0]+","+s.core("active-bg-color").value[1]+","+s.core("active-bg-color").value[2]+","+s.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,s.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!gC){var v=h.measureText(y);gC=v.actualBoundingBoxAscent}h.fillText(y,0,gC);var x=60;h.strokeRect(0,gC+10,250,20),h.fillRect(0,gC+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Ppe(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function wjt(t,e,r){var n=Ppe(t,t.VERTEX_SHADER,e),i=Ppe(t,t.FRAGMENT_SHADER,r),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,i),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw new Error("Could not initialize shaders");return s}function Tjt(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function see(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function Cjt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function kjt(t,e,r,n,i){var s=n*r+e.x,a=i*r+e.y;return a=Math.round(t.canvasHeight-a),[s,a]}function Sjt(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function Ejt(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function Ajt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Mjt(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function BLe(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function FLe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Rjt(t,e,r,n,i,s){switch(e){case t.FLOAT:return new Float32Array(r.buffer,s*n,i);case t.INT:return new Int32Array(r.buffer,s*n,i)}}function _jt(t,e,r,n){var i=BLe(t,e),s=ra(i,2),a=s[0],o=s[1],l=FLe(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,a,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,a,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Fh(t,e,r,n){var i=BLe(t,r),s=ra(i,3),a=s[0],o=s[1],l=s[2],u=FLe(t,o,e*a),h=a*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,a,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,a,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;pa&&(o=a/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var s=this;if(this.locked)throw new Error("can't draw, atlas is locked");var a=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,T){if(i&&T){var C=T.context,S=b.x,k=b.row,E=S,A=l*k;C.save(),C.translate(E,A),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(s.freePointer,s.canvas),g[0]={x:s.freePointer.x,y:s.freePointer.row*l,w:d,h:f},g[1]={x:s.freePointer.x+d,y:s.freePointer.row*l,w:0,h:f},s.freePointer.x+=d,s.freePointer.x==a&&(s.freePointer.x=0,s.freePointer.row++)},y=function(){var b=s.scratch,T=s.canvas;b.clear(),p({x:0,row:0},b);var C=a-s.freePointer.x,S=d-C,k=l;{var E=s.freePointer.x,A=s.freePointer.row*l,R=C;T.context.drawImage(b,0,0,R,k,E,A,R,k),g[0]={x:E,y:A,w:R,h:f}}{var _=C,P=(s.freePointer.row+1)*l,N=S;T&&T.context.drawImage(b,_,0,N,k,0,P,N,k),g[1]={x:0,y:P,w:N,h:f}}s.freePointer.x=S,s.freePointer.row++},v=function(){s.freePointer.x=0,s.freePointer.row++};if(this.freePointer.x+d<=a)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===a?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,s=this.getScale(r),a=s.texW;return this.freePointer.x+a>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},s=i.forceRedraw,a=s===void 0?!1:s,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=oc(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=oc(this.renderTypes.values()),v;try{var x=function(){var T=v.value,C=T.type;if(h(C)){var S=n.collections.get(T.collection),k=T.getKey(m),E=Array.isArray(k)?k:[k];if(a)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),R=n._key(C,A),_=n.typeAndIdToKey.get(R);_!==void 0&&!Ejt(E,_)&&(d=!0,n.typeAndIdToKey.delete(R),_.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)x()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=oc(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(s){r.e(s)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,s){var a=this.renderTypes.get(n),o=this.collections.get(a.collection),l=!1,u=o.draw(s,i,function(f){a.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),a.drawElement(f,r,i,!0,!0),f.restore()):a.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=a.getID?a.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(s):this.typeAndIdToKey.set(d,[s])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,s=this.renderTypes.get(n),a=s.getKey(r),o=Array.isArray(a)?a:[a];return o.map(function(l){var u=s.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=ra(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=oc(this.collections),i;try{for(n.s();!(i=n.n()).done;){var s=ra(i.value,2),a=s[0],o=s[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:a,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),Fjt=(function(){function t(e){tm(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return rm(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),zjt=` +*/var lLe=function(e,r){this.recycle(e,r)};function mC(){return!1}function O8(){return!0}lLe.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=mC,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?O8:mC):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),s=this.cy.pan();this.renderedPosition={x:n.x*i+s.x,y:n.y*i+s.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=O8;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=O8;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=O8,this.stopPropagation()},isDefaultPrevented:mC,isPropagationStopped:mC,isImmediatePropagationStopped:mC};var cLe=/^([^.]+)(\.(?:[^.]+))?$/,QUt=".*",uLe={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},hpe=Object.keys(uLe),JUt={};function aO(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:JUt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)a(o);return this};Ng.removeAllListeners=function(){return this.removeListener("*")};Ng.emit=Ng.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Ei(e)||(e=[e]),eYt(this,function(s,a){r!=null&&(n=[{event:a.event,type:a.type,namespace:a.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===a.type&&(!h.namespace||h.namespace===a.namespace||h.namespace===QUt)&&s.eventMatches(s.context,h,a)){var d=[a];e!=null&&HGt(d,e),s.beforeEmit(s.context,h,a),h.conf&&h.conf.one&&(s.listeners=s.listeners.filter(function(g){return g!==h}));var f=s.callbackContext(s.context,h,a),p=h.callback.apply(f,d);s.afterEmit(s.context,h,a),p===!1&&(a.stopPropagation(),a.preventDefault())}},l=0;l1&&!a){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,s.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,s=i.get(n);if(!s)return this;var a=s.index;return this.unmergeAt(a),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Dr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,s=0;sn&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,s=this,a=0;a=0&&s"u"?"undefined":La(Symbol))!=e&&La(Symbol.iterator)!=e;r&&($L[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},s=0,a=this.length;return u_e({next:function(){return s1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var s=n._private.style[e];return s??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,s=n.style();if(jn(e)){var a=e;s.applyBypass(this,a,i),this.emitAndNotify("style")}else if(Dr(e))if(r===void 0){var o=this[0];return o?s.getStylePropertyValue(o,e):void 0}else s.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?s.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),s=this;if(e===void 0)for(var a=0;a0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Uo.neighbourhood=Uo.neighborhood;Uo.closedNeighbourhood=Uo.closedNeighborhood;Uo.openNeighbourhood=Uo.openNeighborhood;Gr(Uo,{source:wu(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:wu(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:ype({attr:"source"}),targets:ype({attr:"target"})});function ype(t){return function(r){for(var n=[],i=0;i0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Uo.componentsOf=Uo.components;var So=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){as("A collection must have a reference to the core");return}var s=new qf,a=!1;if(!r)r=[];else if(r.length>0&&jn(r[0])&&!y7(r[0])){a=!0;for(var o=[],l=new T3,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,s=[],a=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new So(n,o),z=0;z0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},s=r._private.cy;function a(L){for(var I=L._private.edges,$=0;$0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var P=0;P0?P=L:_=L;while(Math.abs(N)>a&&++I=s?x(R,I):$===0?I:T(R,_,_+u)}var S=!1;function k(){S=!0,(t!==e||r!==n)&&b()}var E=function(_){return S||k(),t===e&&r===n?_:_===0?0:_===1?1:y(C(_),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return A},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var hYt=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,s){var a={x:n.x+s.dx*i,v:n.v+s.dv*i,tension:n.tension,friction:n.friction};return{dx:a.v,dv:t(a)}}function r(n,i){var s={dx:n.v,dv:t(n)},a=e(n,i*.5,s),o=e(n,i*.5,a),l=e(n,i,o),u=1/6*(s.dx+2*(a.dx+o.dx)+l.dx),h=1/6*(s.dv+2*(a.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,s,a){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,s=parseFloat(s)||20,a=a||null,o.tension=i,o.friction=s,f=a!==null,f?(u=n(i,s),p=u/a*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),Li=function(e,r,n,i){var s=uYt(e,r,n,i);return function(a,o,l){return a+(o-a)*s(l)}},nR={linear:function(e,r,n){return e+(r-e)*n},ease:Li(.25,.1,.25,1),"ease-in":Li(.42,0,1,1),"ease-out":Li(0,0,.58,1),"ease-in-out":Li(.42,0,.58,1),"ease-in-sine":Li(.47,0,.745,.715),"ease-out-sine":Li(.39,.575,.565,1),"ease-in-out-sine":Li(.445,.05,.55,.95),"ease-in-quad":Li(.55,.085,.68,.53),"ease-out-quad":Li(.25,.46,.45,.94),"ease-in-out-quad":Li(.455,.03,.515,.955),"ease-in-cubic":Li(.55,.055,.675,.19),"ease-out-cubic":Li(.215,.61,.355,1),"ease-in-out-cubic":Li(.645,.045,.355,1),"ease-in-quart":Li(.895,.03,.685,.22),"ease-out-quart":Li(.165,.84,.44,1),"ease-in-out-quart":Li(.77,0,.175,1),"ease-in-quint":Li(.755,.05,.855,.06),"ease-out-quint":Li(.23,1,.32,1),"ease-in-out-quint":Li(.86,0,.07,1),"ease-in-expo":Li(.95,.05,.795,.035),"ease-out-expo":Li(.19,1,.22,1),"ease-in-out-expo":Li(1,0,0,1),"ease-in-circ":Li(.6,.04,.98,.335),"ease-out-circ":Li(.075,.82,.165,1),"ease-in-out-circ":Li(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return nR.linear;var i=hYt(e,r,n);return function(s,a,o){return s+(a-s)*i(o)}},"cubic-bezier":Li};function xpe(t,e,r,n,i){if(n===1||e===r)return r;var s=i(e,r,n);return t==null||((t.roundValue||t.color)&&(s=Math.round(s)),t.min!==void 0&&(s=Math.max(s,t.min)),t.max!==void 0&&(s=Math.min(s,t.max))),s}function wpe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Zv(t,e,r,n,i){var s=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var a=wpe(t,i),o=wpe(e,i);if(Zt(a)&&Zt(o))return xpe(s,a,o,r,n);if(Ei(a)&&Ei(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(a.duration),a.easingImpl=nR[p].apply(null,g)):a.easingImpl=nR[p]}var m=a.easingImpl,y;if(a.duration===0?y=1:y=(r-l)/a.duration,a.applying&&(y=a.progress),y<0?y=0:y>1&&(y=1),a.delay==null){var v=a.startPosition,x=a.position;if(x&&i&&!t.locked()){var b={};yC(v.x,x.x)&&(b.x=Zv(v.x,x.x,y,m)),yC(v.y,x.y)&&(b.y=Zv(v.y,x.y,y,m)),t.position(b)}var T=a.startPan,C=a.pan,S=s.pan,k=C!=null&&n;k&&(yC(T.x,C.x)&&(S.x=Zv(T.x,C.x,y,m)),yC(T.y,C.y)&&(S.y=Zv(T.y,C.y,y,m)),t.emit("pan"));var E=a.startZoom,A=a.zoom,R=A!=null&&n;R&&(yC(E,A)&&(s.zoom=q6(s.minZoom,Zv(E,A,y,m),s.maxZoom)),t.emit("zoom")),(k||R)&&t.emit("viewport");var _=a.style;if(_&&_.length>0&&i){for(var P=0;P<_.length;P++){var N=_[P],L=N.name,I=N,$=a.startStyle[L],O=h.properties[$.name],D=Zv($,I,y,m,O);h.overrideBypass(t,L,D)}t.emit("style")}}return a.progress=y,y}function yC(t,e){return t==null||e==null?!1:Zt(t)&&Zt(e)?!0:!!(t&&e)}function fYt(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function Tpe(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var y=g.shift();y&&p.push(y)}for(var v=function(S){for(var k=S.length-1;k>=0;k--){var E=S[k];E()}S.splice(0,S.length)},x=p.length-1;x>=0;x--){var b=p[x],T=b._private;if(T.stopped){p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||fYt(h,b,t),dYt(h,b,t,d),T.applying&&(T.applying=!1),v(T.frames),T.step!=null&&T.step(t),b.completed()&&(p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var s=!1,a=0;a0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var pYt={animate:di.animate(),animation:di.animation(),animated:di.animated(),clearQueue:di.clearQueue(),delay:di.delay(),delayAnimation:di.delayAnimation(),stop:di.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&IL(function(s){Tpe(s,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(s,a){Tpe(a,e)},n.beforeRenderPriorities.animations):r()}},gYt={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&y7(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},$8=function(e){return Dr(e)?new Lg(e):e},mLe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new aO(gYt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,$8(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,$8(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,$8(r),n),this},once:function(e,r,n){return this.emitter().one(e,$8(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};di.eventAliasesOn(mLe);var zq={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};zq.jpeg=zq.jpg;var iR={layout:function(e){var r=this;if(e==null){as("Layout options must be specified to make a layout");return}if(e.name==null){as("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){as("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var s;Dr(e.eles)?s=r.$(e.eles):s=e.eles!=null?e.eles:r.$();var a=new i(Gr({},e,{cy:r,eles:s}));return a}};iR.createLayout=iR.makeLayout=iR.layout;var mYt={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var s=this.renderer();this.destroyed()||!s||s.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Vq.invalidateDimensions=Vq.resize;var sR={collection:function(e,r){return Dr(e)?this.$(e):Vc(e)?e.collection():Ei(e)?(r||(r={}),new So(this,e,r.unique,r.removed)):new So(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};sR.elements=sR.filter=sR.$;var to={},cS="t",vYt="f";to.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),s=0;s0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(T=1),o.color){var S=n.valueMin[0],k=n.valueMax[0],E=n.valueMin[1],A=n.valueMax[1],R=n.valueMin[2],_=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],L=[Math.round(S+(k-S)*T),Math.round(E+(A-E)*T),Math.round(R+(_-R)*T),Math.round(P+(N-P)*T)];s={bypass:n.bypass,name:n.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*T;s=this.parse(n.name,I,n.bypass,f)}else return!1;if(!s)return m(),!1;s.mapping=n,n=s;break}case a.data:{for(var $=n.field.split("."),O=d.data,D=0;D<$.length&&O;D++){var F=$[D];O=O[F]}if(O!=null&&(s=this.parse(n.name,O,n.bypass,f)),!s)return m(),!1;s.mapping=n,n=s;break}case a.fn:{var z=n.value,V=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=V,V==null)return gi("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(s=this.parse(n.name,V,n.bypass,f),!s)return gi("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;s.mapping=vd(n),n=s;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};to.cleanElements=function(t,e){for(var r=0;r0&&s>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(a).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:s,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};to.checkTrigger=function(t,e,r,n,i,s){var a=this.properties[e],o=i(a);t.removed()||o!=null&&o(r,n,t)&&s(a)};to.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(s){return s.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};to.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};to.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};to.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};to.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var k7={};k7.applyBypass=function(t,e,r,n){var i=this,s=[],a=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){s.length>a.length?s=s.substr(a.length):s=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){gi("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new Lg(d);if(f.invalid){gi("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;s=p;for(var m=[];;){var y=s.match(/^\s*$/);if(y)break;var v=s.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){gi("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}a=v[0];var x=v[1],b=v[2],T=e.properties[x];if(!T){gi("Skipping property: Invalid property name in: "+a),l();continue}var C=r.parse(x,b);if(!C){gi("Skipping property: Invalid property definition in: "+a),l();continue}m.push({name:x,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return gi("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,x=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(x)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Ei(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var T=[],C=[],S=[],k="",E=!1,A=0;A0?" ":"")+R.strValue}return u.validate&&!u.validate(T,C)?null:u.singleEnum&&E?T.length===1&&Dr(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:S,strValue:k,bypass:r,units:C}}var _=function(){for(var Q=0;Qu.max||u.strictMax&&e===u.max))return null;var $={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?$.pfValue=e:$.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&($.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&($.pfValue=P==="rad"?e:pWt(e)),P==="%"&&($.pfValue=e/100),$}else if(u.propList){var O=[],D=""+e;if(D!=="none"){for(var F=D.split(/\s*,\s*|\s+/),z=0;z0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((a-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,s,a,o=!1;if(r.zoomingEnabled||(o=!0),Zt(e)?a=e:jn(e)&&(a=e.level,e.position!=null?s=JD(e.position,i,n):e.renderedPosition!=null&&(s=e.renderedPosition),s!=null&&!r.panningEnabled&&(o=!0)),a=a>r.maxZoom?r.maxZoom:a,a=ar.maxZoom||!r.zoomingEnabled?a=!0:(r.zoom=l,s.push("zoom"))}if(i&&(!a||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Zt(u.x)&&(r.pan.x=u.x,o=!1),Zt(u.y)&&(r.pan.y=u.y,o=!1),o||s.push("pan")}return s.length>0&&(s.push("viewport"),this.emit(s.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Dr(e)){var n=e;e=this.mutableElements().filter(n)}else Vc(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),s=this.width(),a=this.height();r=r===void 0?this._private.zoom:r;var o={x:(s-r*(i.x1+i.x2))/2,y:(a-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),s=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-s("padding-left")-s("padding-right"),height:r.clientHeight-s("padding-top")-s("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Dy.centre=Dy.center;Dy.autolockNodes=Dy.autolock;Dy.autoungrabifyNodes=Dy.autoungrabify;var X6={data:di.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:di.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:di.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:di.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};X6.attr=X6.data;X6.removeAttr=X6.removeData;var K6=function(e){var r=this;e=Gr({},e);var n=e.container;n&&!LL(n)&&LL(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var s=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var a=xa!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Gr({name:a?"grid":"null"},o.layout),o.renderer=Gr({name:a?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new So(this),listeners:[],aniEles:new So(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?a:o.styleEnabled,zoom:Zt(o.zoom)?o.zoom:1,pan:{x:jn(o.pan)&&Zt(o.pan.x)?o.pan.x:0,y:jn(o.pan)&&Zt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(oGt);if(y)return C3.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Gr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(jn(g)||Ei(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var x=Gr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Ts(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Ll(o?t.boundingBox:structuredClone(e.extent())),u;if(Vc(t.roots))u=t.roots;else if(Ei(t.roots)){for(var h=[],d=0;d0;){var L=N(),I=A(L,_);if(I)L.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(P);else if(I===null){gi("Detected double maximal shift for node `"+L.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(t.avoidOverlap)for(var O=0;O0&&v[0].length<=3?Me/2:0),le=2*Math.PI/v[He].length*we;return He===0&&v[0].length===1&&(je=1),{x:ie.x+je*Math.cos(le),y:ie.y+je*Math.sin(le)}}else{var pe=v[He].length,Ce=Math.max(pe===1?0:o?(l.w-t.padding*2-me.w)/((t.grid?_e:pe)-1):(l.w-t.padding*2-me.w)/((t.grid?_e:pe)+1),$),ne={x:ie.x+(we+1-(pe+1)/2)*Ce,y:ie.y+(He+1-(W+1)/2)*te};return ne}},Fe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Fe).indexOf(t.direction)===-1&&as("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Fe).join(", ")));var ce=function(Te){return PGt($e(Te),l,Fe[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var CYt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function vLe(t){this.options=Gr({},CYt,t)}vLe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,s=n.nodes().not(":parent");e.sort&&(s=s.sort(e.sort));for(var a=Ll(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/s.length:e.sweep,u=l/Math.max(1,s.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var T=function(S,k){var E=e.startAngle+k*u*(i?1:-1),A=h*Math.cos(E),R=h*Math.sin(E),_={x:o.x+A,y:o.y+R};return _};return n.nodes().layoutPositions(this,e,T),this};var kYt={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function bLe(t){this.options=Gr({},kYt,t)}bLe.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,s=i.nodes().not(":parent"),a=Ll(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},l=[],u=0,h=0;h0){var C=Math.abs(x[0].value-T.value);C>=y&&(x=[],v.push(x))}x.push(T)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,E=Math.min(a.w,a.h)/2-S,A=E/(v.length+k?1:0);S=Math.min(S,A)}for(var R=0,_=0;_1&&e.avoidOverlap){var I=Math.cos(L)-Math.cos(0),$=Math.sin(L)-Math.sin(0),O=Math.sqrt(S*S/(I*I+$*$));R=Math.max(O,R)}P.r=R,R+=S}if(e.equidistant){for(var D=0,F=0,z=0;z=t.numIter||(LYt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&s(),IL(h)}};h()}else{for(;u;)u=a(l),l++;Spe(n,t),o()}return this};hO.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};hO.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var EYt=function(e,r,n){for(var i=n.eles.edges(),s=n.eles.nodes(),a=Ll(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:s.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(E);for(var h=0;hi.count?0:i.graph},xLe=function(e,r,n,i){var s=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=FL(e,o,l),y=FL(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},DYt=function(e,r,n,i){if(n>0)var s=e.maxX-r.minX;else var s=r.maxX-e.minX;if(i>0)var a=e.maxY-r.minY;else var a=r.maxY-e.minY;return s>=0&&a>=0?Math.sqrt(s*s+a*a):0},FL=function(e,r,n){var i=e.positionX,s=e.positionY,a=e.height||1,o=e.width||1,l=n/r,u=a/o,h={};return r===0&&0n?(h.x=i,h.y=s+a/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=s-o*n/2/r,h):0=u)?(h.x=i+a*r/2/n,h.y=s+a/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-a*r/2/n,h.y=s-a/2),h)},OYt=function(e,r){for(var n=0;nn){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},$Yt=function(e,r){var n=[],i=0,s=-1;for(n.push.apply(n,e.graphSet[0]),s+=e.graphSet[0].length;i<=s;){var a=n[i++],o=e.idToIndex[a],l=e.layoutNodes[o],u=l.children;if(0n)var s={x:n*e/i,y:n*r/i};else var s={x:e,y:r};return s},TLe=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],s=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,s=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,s=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},zYt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function CLe(t){this.options=Gr({},zYt,t)}CLe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var s=Ll(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(s.h===0||s.w===0)n.nodes().layoutPositions(this,e,function(H){return{x:s.x1,y:s.y1}});else{var a=i.size(),o=Math.sqrt(a*s.h/s.w),l=Math.round(o),u=Math.round(s.w/s.h*o),h=function(G){if(G==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=G:u=G},d=function(G){if(G==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=G:u=G},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(a/l);else if(f==null&&p!=null)u=p,l=Math.ceil(a/u);else if(u*l>a){var g=h(),m=d();(g-1)*m>=a?h(g-1):(m-1)*g>=a&&d(m-1)}else for(;u*l=a?d(v+1):h(y+1)}var x=s.w/u,b=s.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var T=0;T=u&&(I=0,L++)},O={},D=0;D(I=MWt(t,e,$[O],$[O+1],$[O+2],$[O+3])))return y(k,I),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var $=A.allpts,O=0;O+5(I=AWt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5])))return y(k,I),!0}for(var D=D||E.source,F=F||E.target,z=i.getArrowWidth(R,_),V=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],O=0;O0&&(v(D),v(F))}function b(k,E,A){return dl(k,E,A)}function T(k,E){var A=k._private,R=f,_;E?_=E+"-":_="",k.boundingBox();var P=A.labelBounds[E||"main"],N=k.pstyle(_+"label").value,L=k.pstyle("text-events").strValue==="yes";if(!(!L||!N)){var I=b(A.rscratch,"labelX",E),$=b(A.rscratch,"labelY",E),O=b(A.rscratch,"labelAngle",E),D=k.pstyle(_+"text-margin-x").pfValue,F=k.pstyle(_+"text-margin-y").pfValue,z=P.x1-R-D,V=P.x2+R-D,B=P.y1-R-F,H=P.y2+R-F;if(O){var G=Math.cos(O),W=Math.sin(O),K=function(me,te){return me=me-I,te=te-$,{x:me*G-te*W+I,y:me*W+te*G+$}},q=K(z,B),oe=K(z,H),Q=K(V,B),Z=K(V,H),re=[q.x+D,q.y+F,Q.x+D,Q.y+F,Z.x+D,Z.y+F,oe.x+D,oe.y+F];if(ac(t,e,re))return y(k),!0}else if(Yp(P,t,e))return y(k),!0}}for(var C=a.length-1;C>=0;C--){var S=a[C];S.isNode()?v(S)||T(S):x(S)||T(S)||T(S,"source")||T(S,"target")}return o};sv.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,s=this.cy.zoom(),a=2/s,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Ll({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(me,te,_e){return dl(me,te,_e)}function y(me,te){var _e=me._private,$e=a,Fe="";me.boundingBox();var ce=_e.labelBounds.main;if(!ce)return null;var he=m(_e.rscratch,"labelX",te),Te=m(_e.rscratch,"labelY",te),ge=m(_e.rscratch,"labelAngle",te),He=me.pstyle(Fe+"text-margin-x").pfValue,we=me.pstyle(Fe+"text-margin-y").pfValue,Me=ce.x1-$e-He,je=ce.x2+$e-He,le=ce.y1-$e-we,pe=ce.y2+$e-we;if(ge){var Ce=Math.cos(ge),ne=Math.sin(ge),j=function(ue,X){return ue=ue-he,X=X-Te,{x:ue*Ce-X*ne+he,y:ue*ne+X*Ce+Te}};return[j(Me,le),j(je,le),j(je,pe),j(Me,pe)]}else return[{x:Me,y:le},{x:je,y:le},{x:je,y:pe},{x:Me,y:pe}]}function v(me,te,_e,$e){function Fe(ce,he,Te){return(Te.y-ce.y)*(he.x-ce.x)>(he.y-ce.y)*(Te.x-ce.x)}return Fe(me,_e,$e)!==Fe(te,_e,$e)&&Fe(me,te,_e)!==Fe(me,te,$e)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},UYt=function(e,r,n,i,s){if(e!==_pe?Lpe(r,e,jh):qYt(ou,jh),Lpe(r,n,ou),Mpe=jh.nx*ou.ny-jh.ny*ou.nx,Rpe=jh.nx*ou.nx-jh.ny*-ou.ny,gf=Math.asin(Math.max(-1,Math.min(1,Mpe))),Math.abs(gf)<1e-6){Hq=r.x,Gq=r.y,Zm=Jv=0;return}f1=1,aR=!1,Rpe<0?gf<0?gf=Math.PI+gf:(gf=Math.PI-gf,f1=-1,aR=!0):gf>0&&(f1=-1,aR=!0),r.radius!==void 0?Jv=r.radius:Jv=i,Om=gf/2,B8=Math.min(jh.len/2,ou.len/2),s?(Vh=Math.abs(Math.cos(Om)*Jv/Math.sin(Om)),Vh>B8?(Vh=B8,Zm=Math.abs(Vh*Math.sin(Om)/Math.cos(Om))):Zm=Jv):(Vh=Math.min(B8,Jv),Zm=Math.abs(Vh*Math.sin(Om)/Math.cos(Om))),Wq=r.x+ou.nx*Vh,qq=r.y+ou.ny*Vh,Hq=Wq-ou.ny*Zm*f1,Gq=qq+ou.nx*Zm*f1,ALe=r.x+jh.nx*Vh,MLe=r.y+jh.ny*Vh,_pe=r};function RLe(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function aee(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(UYt(t,e,r,n,i),{cx:Hq,cy:Gq,radius:Zm,startX:ALe,startY:MLe,stopX:Wq,stopY:qq,startAngle:jh.ang+Math.PI/2*f1,endAngle:ou.ang-Math.PI/2*f1,counterClockwise:aR})}var Z6=.01,YYt=Math.sqrt(2*Z6),Qo={};Qo.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,s,a=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=a.units!=null&&o.units!=null,u=function(C,S,k,E){var A=E-S,R=k-C,_=Math.sqrt(R*R+A*A);return{x:-A/_,y:R/_}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":s=r;break;case"intersection":s=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],a),f=ra(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=ra(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),s=b}else gi("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),s=n;break}}return{midptPts:s,vectorNormInverse:i}};Qo.findHaystackPoints=function(t){for(var e=0;e0?Math.max(X-fe,0):Math.min(X+fe,0)},N=P(R,E),L=P(_,A),I=!1;x===u?v=Math.abs(N)>Math.abs(L)?i:n:x===l||x===o?(v=n,I=!0):(x===s||x===a)&&(v=i,I=!0);var $=v===n,O=$?L:N,D=$?_:R,F=YJ(D),z=!1;!(I&&(T||S))&&(x===o&&D<0||x===l&&D>0||x===s&&D>0||x===a&&D<0)&&(F*=-1,O=F*Math.abs(O),z=!0);var V;if(T){var B=C<0?1+C:C;V=B*O}else{var H=C<0?O:0;V=H+C*F}var G=function(X){return Math.abs(X)=Math.abs(O)},W=G(V),K=G(Math.abs(O)-Math.abs(V)),q=W||K;if(q&&!z)if($){var oe=Math.abs(D)<=f/2,Q=Math.abs(R)<=p/2;if(oe){var Z=(h.x1+h.x2)/2,re=h.y1,ie=h.y2;r.segpts=[Z,re,Z,ie]}else if(Q){var me=(h.y1+h.y2)/2,te=h.x1,_e=h.x2;r.segpts=[te,me,_e,me]}else r.segpts=[h.x1,h.y2]}else{var $e=Math.abs(D)<=d/2,Fe=Math.abs(_)<=g/2;if($e){var ce=(h.y1+h.y2)/2,he=h.x1,Te=h.x2;r.segpts=[he,ce,Te,ce]}else if(Fe){var ge=(h.x1+h.x2)/2,He=h.y1,we=h.y2;r.segpts=[ge,He,ge,we]}else r.segpts=[h.x2,h.y1]}else if($){var Me=h.y1+V+(y?f/2*F:0),je=h.x1,le=h.x2;r.segpts=[je,Me,le,Me]}else{var pe=h.x1+V+(y?d/2*F:0),Ce=h.y1,ne=h.y2;r.segpts=[pe,Ce,pe,ne]}if(r.isRound){var j=t.pstyle("taxi-radius").value,J=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(j),r.isArcRadius=new Array(r.segpts.length/2).fill(J)}};Qo.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,s=e.srcW,a=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Zt(r.startX)||!Zt(r.startY),y=!Zt(r.arrowStartX)||!Zt(r.arrowStartY),v=!Zt(r.endX)||!Zt(r.endY),x=!Zt(r.arrowEndX)||!Zt(r.arrowEndY),b=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*T,S=Iy({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=SD.poolIndex()){var F=O;O=D,D=F}var z=N.srcPos=O.position(),V=N.tgtPos=D.position(),B=N.srcW=O.outerWidth(),H=N.srcH=O.outerHeight(),G=N.tgtW=D.outerWidth(),W=N.tgtH=D.outerHeight(),K=N.srcShape=r.nodeShapes[e.getNodeShape(O)],q=N.tgtShape=r.nodeShapes[e.getNodeShape(D)],oe=N.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Q=N.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,Z=N.tgtRs=D._private.rscratch,re=N.srcRs=O._private.rscratch;N.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ie=0;ie=YYt||(le=Math.sqrt(Math.max(je*je,Z6)+Math.max(Me*Me,Z6)));var pe=N.vector={x:je,y:Me},Ce=N.vectorNorm={x:pe.x/le,y:pe.y/le},ne={x:-Ce.y,y:Ce.x};N.nodesOverlap=!Zt(le)||q.checkPoint(ce[0],ce[1],0,G,W,V.x,V.y,Q,Z)||K.checkPoint(Te[0],Te[1],0,B,H,z.x,z.y,oe,re),N.vectorNormInverse=ne,L={nodesOverlap:N.nodesOverlap,dirCounts:N.dirCounts,calculatedIntersection:!0,hasBezier:N.hasBezier,hasUnbundled:N.hasUnbundled,eles:N.eles,srcPos:V,srcRs:Z,tgtPos:z,tgtRs:re,srcW:G,srcH:W,tgtW:B,tgtH:H,srcIntn:ge,tgtIntn:he,srcShape:q,tgtShape:K,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:He.x2,y1:He.y2,x2:He.x1,y2:He.y1},vector:{x:-pe.x,y:-pe.y},vectorNorm:{x:-Ce.x,y:-Ce.y},vectorNormInverse:{x:-ne.x,y:-ne.y}}}var j=Fe?L:N;te.nodesOverlap=j.nodesOverlap,te.srcIntn=j.srcIntn,te.tgtIntn=j.tgtIntn,te.isRound=_e.startsWith("round"),i&&(O.isParent()||O.isChild()||D.isParent()||D.isChild())&&(O.parents().anySame(D)||D.parents().anySame(O)||O.same(D)&&O.isParent())?e.findCompoundLoopPoints(me,j,ie,$e):O===D?e.findLoopPoints(me,j,ie,$e):_e.endsWith("segments")?e.findSegmentsPoints(me,j):_e.endsWith("taxi")?e.findTaxiPoints(me,j):_e==="straight"||!$e&&N.eles.length%2===1&&ie===Math.floor(N.eles.length/2)?e.findStraightEdgePoints(me):e.findBezierPoints(me,j,ie,$e,Fe),e.findEndpoints(me),e.tryToCorrectInvalidPoints(me,j),e.checkForInvalidEdgeWarning(me),e.storeAllpts(me),e.storeEdgeProjections(me),e.calculateArrowAngles(me),e.recalculateEdgeLabelProjections(me),e.calculateLabelAngles(me)}},k=0;k0){var ce=u,he=Km(ce,ib(a)),Te=Km(ce,ib(Fe)),ge=he;if(Te2){var He=Km(ce,{x:Fe[2],y:Fe[3]});He0){var ee=h,Ae=Km(ee,ib(a)),Re=Km(ee,ib(fe)),Xe=Ae;if(Re2){var Ne=Km(ee,{x:fe[2],y:fe[3]});Ne=g||k){y={cp:T,segment:S};break}}if(y)break}var E=y.cp,A=y.segment,R=(g-v)/A.length,_=A.t1-A.t0,P=p?A.t0+_*R:A.t1-_*R;P=q6(0,P,1),e=Bb(E.p0,E.p1,E.p2,P),f=XYt(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var N=0,L,I,$,O,D=n.allpts.length,F=0;F+3=g));F+=2);var z=g-I,V=z/L;V=q6(0,V,1),e=mWt($,O,V),f=ILe($,O);break}}a("labelX",d,e.x),a("labelY",d,e.y),a("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Qd.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Qd.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=Ly(n,t._private.labelDimsKey);if(dl(r.rscratch,"prefixedLabelDimsKey",e)!==i){sd(r.rscratch,"prefixedLabelDimsKey",e,i);var s=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=dl(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*a,f=s.width,p=s.height+(h-1)*(a-1)*o;sd(r.rstyle,"labelWidth",e,f),sd(r.rscratch,"labelWidth",e,f),sd(r.rstyle,"labelHeight",e,p),sd(r.rscratch,"labelHeight",e,p),sd(r.rscratch,"labelLineHeight",e,d),sd(r.rscratch,"labelActualDescent",e,s.labelActualDescent)}};Qd.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,s=t.pstyle("text-transform").value,a=function(H,G){return G?(sd(r.rscratch,H,e,G),G):dl(r.rscratch,H,e)};if(!i)return"";s=="none"||(s=="uppercase"?i=i.toUpperCase():s=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=a("labelKey");if(l!=null&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u="​",h=i.split(` +`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var C=v.matchAll(m),S="",k=0,E=uc(C),A;try{for(E.s();!(A=E.n()).done;){var R=A.value,_=R[0],P=v.substring(k,R.index);k=R.index+_.length;var N=S.length===0?P:S+P+_,L=this.calculateLabelDimensions(t,N),I=L.width;I<=d?S+=P+_:(S&&g.push(S),S=P+_)}}catch(B){E.e(B)}finally{E.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}a("labelWrapCachedLines",g),i=a("labelWrapCachedText",g.join(` +`)),a("labelWrapKey",l)}else if(o==="ellipsis"){var $=t.pstyle("text-max-width").pfValue,O="",D="…",F=!1;if(this.calculateLabelDimensions(t,i).width<$)return i;for(var z=0;z$)break;O+=i[z],z===i.length-1&&(F=!0)}return F||(O+=D),O}return i};Qd.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?PUt(r):"center":e};Qd.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,s=0,a=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(a," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` +`),v=y.length,x=0,b=0,T=0;T1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(a),o)for(var l=0;l=t.desktopTapThreshold2}var zt=s(j);Oe&&(t.hoverData.tapholdCancelled=!0);var It=function(){var xt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];xt.length===0?(xt.push(ze[0]),xt.push(ze[1])):(xt[0]+=ze[0],xt[1]+=ze[1])};ue=!0,i(qe,["mousemove","vmousemove","tapdrag"],j,{x:Ae[0],y:Ae[1]});var ft=function(xt){return{originalEvent:j,type:xt,position:{x:Ae[0],y:Ae[1]}}},xe=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit(ft("boxstart")),Ne[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Oe){var Nt=ft("cxtdrag");Ke?Ke.emit(Nt):X.emit(Nt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||qe!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ft("cxtdragout")),t.hoverData.cxtOver=qe,qe&&qe.emit(ft("cxtdragover")))}}else if(t.hoverData.dragging){if(ue=!0,X.panningEnabled()&&X.userPanningEnabled()){var Tt;if(t.hoverData.justStartedPan){var yt=t.hoverData.mdownPos;Tt={x:(Ae[0]-yt[0])*fe,y:(Ae[1]-yt[1])*fe},t.hoverData.justStartedPan=!1}else Tt={x:ze[0]*fe,y:ze[1]*fe};X.panBy(Tt),X.emit(ft("dragpan")),t.hoverData.dragged=!0}Ae=t.projectIntoViewport(j.clientX,j.clientY)}else if(Ne[4]==1&&(Ke==null||Ke.pannable())){if(Oe){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(zt||!X.panningEnabled()||!X.userPanningEnabled()))xe();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Rt=a(Ke,t.hoverData.downs);Rt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ne[4]=0,t.data.bgActivePosistion=ib(Re),t.redrawHint("select",!0),t.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&qe!=De&&(De&&i(De,["mouseout","tapdragout"],j,{x:Ae[0],y:Ae[1]}),qe&&i(qe,["mouseover","tapdragover"],j,{x:Ae[0],y:Ae[1]}),t.hoverData.last=qe),Ke)if(Oe){if(X.boxSelectionEnabled()&&zt)Ke&&Ke.grabbed()&&(m(st),Ke.emit(ft("freeon")),st.emit(ft("free")),t.dragData.didDrag&&(Ke.emit(ft("dragfreeon")),st.emit(ft("dragfree")))),xe();else if(Ke&&Ke.grabbed()&&t.nodeIsDraggable(Ke)){var Or=!t.dragData.didDrag;Or&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(st,{inDragLayer:!0});var Ee={x:0,y:0};if(Zt(ze[0])&&Zt(ze[1])&&(Ee.x+=ze[0],Ee.y+=ze[1],Or)){var it=t.hoverData.dragDelta;it&&Zt(it[0])&&Zt(it[1])&&(Ee.x+=it[0],Ee.y+=it[1])}t.hoverData.draggingEles=!0,st.silentShift(Ee).emit(ft("position")).emit(ft("drag")),t.redrawHint("drag",!0),t.redraw()}}else It();ue=!0}if(Ne[2]=Ae[0],Ne[3]=Ae[1],ue)return j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault(),!1}},!1);var R,_,P;t.registerBinding(e,"mouseup",function(j){if(!(t.hoverData.which===1&&j.which!==1&&t.hoverData.capture)){var J=t.hoverData.capture;if(J){t.hoverData.capture=!1;var ue=t.cy,X=t.projectIntoViewport(j.clientX,j.clientY),fe=t.selection,ee=t.findNearestElement(X[0],X[1],!0,!1),Ae=t.dragData.possibleDragElements,Re=t.hoverData.down,Xe=s(j);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Re&&Re.unactivate();var Ne=function(mt){return{originalEvent:j,type:mt,position:{x:X[0],y:X[1]}}};if(t.hoverData.which===3){var qe=Ne("cxttapend");if(Re?Re.emit(qe):ue.emit(qe),!t.hoverData.cxtDragged){var De=Ne("cxttap");Re?Re.emit(De):ue.emit(De)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(ee,["mouseup","tapend","vmouseup"],j,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Re,["click","tap","vclick"],j,{x:X[0],y:X[1]}),_=!1,j.timeStamp-P<=ue.multiClickDebounceTime()?(R&&clearTimeout(R),_=!0,P=null,i(Re,["dblclick","dbltap","vdblclick"],j,{x:X[0],y:X[1]})):(R=setTimeout(function(){_||i(Re,["oneclick","onetap","voneclick"],j,{x:X[0],y:X[1]})},ue.multiClickDebounceTime()),P=j.timeStamp)),Re==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!s(j)&&(ue.$(r).unselect(["tapunselect"]),Ae.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Ae=ue.collection()),ee==Re&&!t.dragData.didDrag&&!t.hoverData.selecting&&ee!=null&&ee._private.selectable&&(t.hoverData.dragging||(ue.selectionType()==="additive"||Xe?ee.selected()?ee.unselect(["tapunselect"]):ee.select(["tapselect"]):Xe||(ue.$(r).unmerge(ee).unselect(["tapunselect"]),ee.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ke=ue.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));t.redrawHint("select",!0),Ke.length>0&&t.redrawHint("eles",!0),ue.emit(Ne("boxend"));var ze=function(mt){return mt.selectable()&&!mt.selected()};ue.selectionType()==="additive"||Xe||ue.$(r).unmerge(Ke).unselect(),Ke.emit(Ne("box")).stdFilter(ze).select().emit(Ne("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!fe[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var st=Re&&Re.grabbed();m(Ae),st&&(Re.emit(Ne("freeon")),Ae.emit(Ne("free")),t.dragData.didDrag&&(Re.emit(Ne("dragfreeon")),Ae.emit(Ne("dragfree"))))}}fe[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var N=[],L=4,I,$=1e5,O=function(j){for(var J=Math.abs(j[0]),ue=1;ue=L){I=!1;var X=N;if(X[0]>=5){var fe;O(X)?fe=X[0]:fe=fWt(X),fe>1&&(I=!0,$=fe)}}else N.push(Math.abs(ue)),J=!0;else I&&($=Math.min(Math.abs(ue),$));if(!t.scrollingPage){var ee=t.cy,Ae=ee.zoom(),Re=ee.pan(),Xe=t.projectIntoViewport(j.clientX,j.clientY),Ne=[Xe[0]*Ae+Re.x,Xe[1]*Ae+Re.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||k()){j.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){j.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var qe;J&&Math.abs(ue)>5&&(ue=YJ(ue)*5),qe=ue/-250,I&&(qe/=$,qe*=3),qe=qe*t.wheelSensitivity;var De=j.deltaMode===1;De&&(qe*=33);var Ke=ee.zoom()*Math.pow(10,qe);j.type==="gesturechange"&&(Ke=t.gestureStartZoom*j.scale),ee.zoom({level:Ke,renderedPosition:{x:Ne[0],y:Ne[1]}}),ee.emit({type:j.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:j,position:{x:Xe[0],y:Xe[1]}})}}}};t.registerBinding(t.container,"wheel",D,!0),t.registerBinding(e,"scroll",function(j){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(j){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||j.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||D(ne)},!0),t.registerBinding(t.container,"mouseout",function(j){var J=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseout",position:{x:J[0],y:J[1]}})},!1),t.registerBinding(t.container,"mouseover",function(j){var J=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseover",position:{x:J[0],y:J[1]}})},!1);var F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie=function(j,J,ue,X){return Math.sqrt((ue-j)*(ue-j)+(X-J)*(X-J))},me=function(j,J,ue,X){return(ue-j)*(ue-j)+(X-J)*(X-J)},te;t.registerBinding(t.container,"touchstart",te=function(j){if(t.hasTouchStarted=!0,!!E(j)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var J=t.cy,ue=t.touchData.now,X=t.touchData.earlier;if(j.touches[0]){var fe=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);ue[0]=fe[0],ue[1]=fe[1]}if(j.touches[1]){var fe=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);ue[2]=fe[0],ue[3]=fe[1]}if(j.touches[2]){var fe=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);ue[4]=fe[0],ue[5]=fe[1]}var ee=function(zt){return{originalEvent:j,type:zt,position:{x:ue[0],y:ue[1]}}};if(j.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var Ae=t.findContainerClientCoords();q=Ae[0],oe=Ae[1],Q=Ae[2],Z=Ae[3],F=j.touches[0].clientX-q,z=j.touches[0].clientY-oe,V=j.touches[1].clientX-q,B=j.touches[1].clientY-oe,re=0<=F&&F<=Q&&0<=V&&V<=Q&&0<=z&&z<=Z&&0<=B&&B<=Z;var Re=J.pan(),Xe=J.zoom();H=ie(F,z,V,B),G=me(F,z,V,B),W=[(F+V)/2,(z+B)/2],K=[(W[0]-Re.x)/Xe,(W[1]-Re.y)/Xe];var Ne=200,qe=Ne*Ne;if(G=1){for(var Le=t.touchData.startPosition=[null,null,null,null,null,null],St=0;St=t.touchTapThreshold2}if(J&&t.touchData.cxt){j.preventDefault();var St=j.touches[0].clientX-q,At=j.touches[0].clientY-oe,lt=j.touches[1].clientX-q,zt=j.touches[1].clientY-oe,It=me(St,At,lt,zt),ft=It/G,xe=150,Nt=xe*xe,Tt=1.5,yt=Tt*Tt;if(ft>=yt||It>=Nt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Rt=Xe("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Rt),t.touchData.start=null):X.emit(Rt)}}if(J&&t.touchData.cxt){var Rt=Xe("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Rt):X.emit(Rt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Or=t.findNearestElement(fe[0],fe[1],!0,!0);(!t.touchData.cxtOver||Or!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Xe("cxtdragout")),t.touchData.cxtOver=Or,Or&&Or.emit(Xe("cxtdragover")))}else if(J&&j.touches[2]&&X.boxSelectionEnabled())j.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit(Xe("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,ue[4]=1,!ue||ue.length===0||ue[0]===void 0?(ue[0]=(fe[0]+fe[2]+fe[4])/3,ue[1]=(fe[1]+fe[3]+fe[5])/3,ue[2]=(fe[0]+fe[2]+fe[4])/3+1,ue[3]=(fe[1]+fe[3]+fe[5])/3+1):(ue[2]=(fe[0]+fe[2]+fe[4])/3,ue[3]=(fe[1]+fe[3]+fe[5])/3),t.redrawHint("select",!0),t.redraw();else if(J&&j.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){j.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ee=t.dragData.touchDragEles;if(Ee){t.redrawHint("drag",!0);for(var it=0;it0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var $e;t.registerBinding(e,"touchcancel",$e=function(j){var J=t.touchData.start;t.touchData.capture=!1,J&&J.unactivate()});var Fe,ce,he,Te;if(t.registerBinding(e,"touchend",Fe=function(j){var J=t.touchData.start,ue=t.touchData.capture;if(ue)j.touches.length===0&&(t.touchData.capture=!1),j.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var fe=t.cy,ee=fe.zoom(),Ae=t.touchData.now,Re=t.touchData.earlier;if(j.touches[0]){var Xe=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);Ae[0]=Xe[0],Ae[1]=Xe[1]}if(j.touches[1]){var Xe=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);Ae[2]=Xe[0],Ae[3]=Xe[1]}if(j.touches[2]){var Xe=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);Ae[4]=Xe[0],Ae[5]=Xe[1]}var Ne=function(Nt){return{originalEvent:j,type:Nt,position:{x:Ae[0],y:Ae[1]}}};J&&J.unactivate();var qe;if(t.touchData.cxt){if(qe=Ne("cxttapend"),J?J.emit(qe):fe.emit(qe),!t.touchData.cxtDragged){var De=Ne("cxttap");J?J.emit(De):fe.emit(De)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!j.touches[2]&&fe.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ke=fe.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),fe.emit(Ne("boxend"));var ze=function(Nt){return Nt.selectable()&&!Nt.selected()};Ke.emit(Ne("box")).stdFilter(ze).select().emit(Ne("boxselect")),Ke.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(J!=null&&J.unactivate(),j.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!j.touches[1]){if(!j.touches[0]){if(!j.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var st=t.dragData.touchDragEles;if(J!=null){var Oe=J._private.grabbed;m(st),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Oe&&(J.emit(Ne("freeon")),st.emit(Ne("free")),t.dragData.didDrag&&(J.emit(Ne("dragfreeon")),st.emit(Ne("dragfree")))),i(J,["touchend","tapend","vmouseup","tapdragout"],j,{x:Ae[0],y:Ae[1]}),J.unactivate(),t.touchData.start=null}else{var mt=t.findNearestElement(Ae[0],Ae[1],!0,!0);i(mt,["touchend","tapend","vmouseup","tapdragout"],j,{x:Ae[0],y:Ae[1]})}var Le=t.touchData.startPosition[0]-Ae[0],St=Le*Le,At=t.touchData.startPosition[1]-Ae[1],lt=At*At,zt=St+lt,It=zt*ee*ee;t.touchData.singleTouchMoved||(J||fe.$(":selected").unselect(["tapunselect"]),i(J,["tap","vclick"],j,{x:Ae[0],y:Ae[1]}),ce=!1,j.timeStamp-Te<=fe.multiClickDebounceTime()?(he&&clearTimeout(he),ce=!0,Te=null,i(J,["dbltap","vdblclick"],j,{x:Ae[0],y:Ae[1]})):(he=setTimeout(function(){ce||i(J,["onetap","voneclick"],j,{x:Ae[0],y:Ae[1]})},fe.multiClickDebounceTime()),Te=j.timeStamp)),J!=null&&!t.dragData.didDrag&&J._private.selectable&&It"u"){var ge=[],He=function(j){return{clientX:j.clientX,clientY:j.clientY,force:1,identifier:j.pointerId,pageX:j.pageX,pageY:j.pageY,radiusX:j.width/2,radiusY:j.height/2,screenX:j.screenX,screenY:j.screenY,target:j.target}},we=function(j){return{event:j,touch:He(j)}},Me=function(j){ge.push(we(j))},je=function(j){for(var J=0;J0)return B[0]}return null},g=Object.keys(f),m=0;m0?p:D_e(s,a,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,s,a,o,l){l=l==="auto"?_g(i,s):l;var u=2*l;if(S0(e,r,this.points,a,o,i,s-u,[0,-1],n)||S0(e,r,this.points,a,o,i-u,s,[0,-1],n))return!0;var h=i/2+2*n,d=s/2+2*n,f=[a-h,o-d,a-h,o,a+h,o,a+h,o-d];return!!(ac(e,r,f)||z1(e,r,u,u,a+i/2-l,o+s/2-l,n)||z1(e,r,u,u,a-i/2+l,o+s/2-l,n))}}};K0.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",cl(3,0)),this.generateRoundPolygon("round-triangle",cl(3,0)),this.generatePolygon("rectangle",cl(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",cl(5,0)),this.generateRoundPolygon("round-pentagon",cl(5,0)),this.generatePolygon("hexagon",cl(6,0)),this.generateRoundPolygon("round-hexagon",cl(6,0)),this.generatePolygon("heptagon",cl(7,0)),this.generateRoundPolygon("round-heptagon",cl(7,0)),this.generatePolygon("octagon",cl(8,0)),this.generateRoundPolygon("round-octagon",cl(8,0));var n=new Array(20);{var i=Iq(5,0),s=Iq(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var o=0;o=e.deqFastCost*T)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*Nz)break;var C=e.deq(n,y,m);if(C.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&s())},o=e.priority||WJ;i.beforeRender(a,o(n))}}}},JYt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NL;im(this,t),this.idsByKey=new qf,this.keyForId=new qf,this.cachesByLvl=new qf,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return sm(t,[{key:"getIdsFor",value:function(r){r==null&&as("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new T3,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),s=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(s,n),this.keyForId.set(n,s)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),s=this.getKey(r);return i!==s}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,s=n.get(r);return s||(s=new qf,n.set(r,s),i.push(r)),s}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),s=this.getCache(i,n);return s!=null&&this.updateKeyMappingFor(r),s}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),s=this.getCache(i,n);return s}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var s=this.getKey(r);this.setCache(s,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var s=this.doesEleInvalidateKey(r);return s&&this.invalidateKey(i),s||this.getNumberOfIdsForKey(i)===0}}])})(),Ope=25,F8=50,oR=-4,Uq=3,FLe=7.99,ejt=8,tjt=1024,rjt=1024,njt=1024,ijt=.2,sjt=.8,ajt=10,ojt=.15,ljt=.1,cjt=.9,ujt=.9,hjt=100,djt=1,ab={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},fjt=Mo({getKey:null,doesEleInvalidateKey:NL,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:E_e,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),fk=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=fjt(r);Gr(n,i),n.lookup=new JYt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Na=fk.prototype;Na.reasons=ab;Na.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Na.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Na.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new T7(function(r,n){return n.reqs-r.reqs});return e};Na.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Na.getElement=function(t,e,r,n,i){var s=this,a=this.renderer,o=a.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!s.allowEdgeTxrCaching&&t.isEdge()||!s.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(UJ(o*r))),n=FLe||n>Uq)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=a.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=Ope?g=Ope:h<=F8?g=F8:g=Math.ceil(h/F8)*F8,h>njt||d>rjt)return null;var m=s.getTextureQueue(g),y=m[m.length-2],v=function(){return s.recycleTexture(g,d)||s.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;_--)A=s.getElement(t,e,r,_,ab.downscale);R()}else return s.queueElement(t,S.level-1),S;else{var P;if(!b&&!T&&!C)for(var N=n-1;N>=oR;N--){var L=l.get(t,N);if(L){P=L;break}}if(x(P))return s.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+ejt),y.eleCaches.push(p),l.set(t,n,p),s.checkTextureFullness(y),p};Na.invalidateElements=function(t){for(var e=0;e=ijt*t.width&&this.retireTexture(t)};Na.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>sjt&&t.fullnessChecks>=ajt?Rg(r,t):t.fullnessChecks++};Na.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Rg(n,t),t.retired=!0;for(var s=t.eleCaches,a=0;a=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,qJ(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Rg(i,a),n.push(a),a}};Na.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),s=this.getKey(t),a=i[s];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,n.updateItem(a);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:s};n.push(o),i[s]=o}};Na.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],s=e.lookup,a=0;a0;a++){var o=r.pop(),l=o.key,u=o.eles[0],h=s.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,ab.dequeue)}return i};Na.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),s=n[i];s!=null&&(s.eles.length===1?(s.reqs=GJ,r.updateItem(s),r.pop(),n[i]=null):s.eles.unmerge(t))};Na.onDequeue=function(t){this.onDequeues.push(t)};Na.offDequeue=function(t){Rg(this.onDequeues,t)};Na.setupDequeueing=BLe.setupDequeueing({deqRedrawThreshold:hjt,deqCost:ojt,deqAvgCost:ljt,deqNoDrawCost:cjt,deqFastCost:ujt,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=gjt||r>VL)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var R=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},_=function(I){if(!p)for(var $=r+I;uS<=$&&$<=VL&&!R($);$+=I);};_(1),_(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&Rg(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=Ll();for(var R=0;R$pe||N>$pe)return null;var L=P*N;if(L>Cjt)return null;var I=n.makeLayer(d,r);if(_!=null){var $=h.indexOf(_)+1;h.splice($,0,I)}else(R.insert===void 0||R.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,x=t.length/pjt,b=!o,T=0;T=x||!N_e(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(b?null:h)};Ro.getEleLevelForLayerLevel=function(t,e){return t};Ro.drawEleInLayer=function(t,e,r,n){var i=this,s=this.renderer,a=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),s.setImgSmoothing(a,!1),s.drawCachedElement(a,e,null,null,r,kjt),s.setImgSmoothing(a,!0))};Ro.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,s=0;s0||a.invalid)return!1;i+=a.eles.length}return i===e.length};Ro.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};Ro.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=k0(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,s){e.invalidateLayer(n)}))};Ro.invalidateLayer=function(t){if(this.lastInvalidationTime=k0(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Rg(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,o=e._private.rscratch;if(!(s&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=s?e.pstyle("opacity").value:1,h=s?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,x=u*h,b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(a.eleStrokeStyle(t,e,I),a.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,a.eleStrokeStyle(t,e,I),a.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},T=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)a.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?a.drawEdgeTrianglePath(e,t,o.allpts):(a.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&a.drawEdgeOverlay(t,e)},S=function(){i&&a.drawEdgeUnderlay(t,e)},k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;a.drawArrowheads(t,e,I)},E=function(){a.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var R=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,N=v*P;t.translate(R,_),b(N),k(N),t.translate(-R,-_)}else T();S(),b(),k(),C(),E(),r&&t.translate(l.x1,l.y1)}};var HLe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var s=this,a=s.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!a?r.lineCap="butt":r.lineCap="round",s.colorStrokeStyle(r,h[0],h[1],h[2],i),s.drawEdgePath(n,r,o.allpts,"solid")}}}};Z0.drawEdgeOverlay=HLe("overlay");Z0.drawEdgeUnderlay=HLe("underlay");Z0.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,s=e,a,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(a=e=i.pathCache,o=!0):(a=e=new Path2D,i.pathCacheKey=d,i.pathCache=a)}if(s.setLineDash)switch(n){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(u),s.lineDashOffset=h;break;case"solid":s.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,a=this;if(n==null){if(s&&!a.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=a.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(a.drawText(t,e,null,g,s),e.isEdge()&&(a.drawText(t,e,"source",g,s),a.drawText(t,e,"target",g,s))):a.drawText(t,e,i,g,s),r&&t.translate(m.x1,m.y1)};av.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",s=e.pstyle("font-family").strValue,a=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+a+" "+i+" "+s,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function Ojt(t,e,r,n,i){var s=Math.min(n,i),a=s/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,a,0,Math.PI*2),t.closePath()}function Vpe(t,e,r,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,a=Math.min(s,n/2,i/2);t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath()}av.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,s=e?e+"-":"",a=t.pstyle(s+"text-rotation");if(a.strValue==="autorotate"){var o=dl(i,"labelAngle",e);r=t.isEdge()?o:0}else a.strValue==="none"?r=0:r=a.pfValue;return r};av.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=e._private,a=s.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=dl(a,"labelX",r),u=dl(a,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=dl(a,"labelWidth",r),m=dl(a,"labelHeight",r),y=dl(a,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),T=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(T="center",C="center"),l+=v,u+=x;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var k=M5(T),E=R5(C);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var A=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,L=N==="round-rectangle"||N==="roundrectangle",I=N==="circle",$=2;if(A>0||_>0&&R>0){var O=t.fillStyle,D=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,H=A>0,G=_>0&&R>0,W=l-P;switch(k){case"left":W-=g;break;case"center":W-=g/2;break}var K=u-m-P,q=g+2*P,oe=m+2*P;if(H&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(A*o,")")),G&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(R*o,")"),t.lineWidth=_,t.setLineDash))switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(L?(t.beginPath(),Vpe(t,W,K,q,oe,$)):I?(t.beginPath(),Ojt(t,W,K,q,oe)):(t.beginPath(),t.rect(W,K,q,oe)),H&&t.fill(),G&&t.stroke(),G&&B==="double"){var Q=_/2;t.beginPath(),L?Vpe(t,W+Q,K+Q,q-2*Q,oe-2*Q,$):t.rect(W+Q,K+Q,q-2*Q,oe-2*Q),t.stroke()}t.fillStyle=O,t.strokeStyle=D,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=y,e.pstyle("text-wrap").value==="wrap"){var re=dl(a,"labelWrapCachedLines",r),ie=dl(a,"labelLineHeight",r),me=g/2,te=this.getLabelJustification(e);switch(te==="auto"||(k==="left"?te==="left"?l+=-g:te==="center"&&(l+=-me):k==="center"?te==="left"?l+=-me:te==="right"&&(l+=me):k==="right"&&(te==="center"?l+=me:te==="right"&&(l+=g))),E){case"top":u-=(re.length-1)*ie;break;case"center":case"bottom":u-=(re.length-1)*ie;break}for(var _e=0;_e0&&t.strokeText(re[_e],l,u),t.fillText(re[_e],l,u),u+=ie}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var om={};om.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Zt(d.x)||!Zt(d.y))&&!(s&&!e.visible())){var f=s?e.effectiveOpacity():1,p=a.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var x=e.pstyle("background-image"),b=x.value,T=new Array(b.length),C=new Array(b.length),S=0,k=0;k0&&arguments[0]!==void 0?arguments[0]:N;a.eleFillStyle(t,e,J)},Q=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;a.colorStrokeStyle(t,L[0],L[1],L[2],J)},Z=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;a.colorStrokeStyle(t,H[0],H[1],H[2],J)},re=function(J,ue,X,fe){var ee=a.nodePathCache=a.nodePathCache||[],Ae=S_e(X==="polygon"?X+","+fe.join(","):X,""+ue,""+J,""+q),Re=ee[Ae],Xe,Ne=!1;return Re!=null?(Xe=Re,Ne=!0,h.pathCache=Xe):(Xe=new Path2D,ee[Ae]=h.pathCache=Xe),{path:Xe,cacheHit:Ne}},ie=e.pstyle("shape").strValue,me=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var te=re(o,l,ie,me);g=te.path,m=te.cacheHit}var _e=function(){if(!m){var J=d;p&&(J={x:0,y:0}),a.nodeShapes[a.getNodeShape(e)].draw(g||t,J.x,J.y,o,l,q,h)}p?t.fill(g):t.fill()},$e=function(){for(var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,X=u.backgrounding,fe=0,ee=0;ee0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;a.hasPie(e)&&(a.drawPie(t,e,ue),J&&(p||a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h)))},ce=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;a.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h),t.clip()),a.drawStripe(t,e,ue),t.restore(),J&&(p||a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h)))},he=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=(_>0?_:-_)*J,X=_>0?0:255;_!==0&&(a.colorFillStyle(t,X,X,X,ue),p?t.fill(g):t.fill())},Te=function(){if(P>0){if(t.lineWidth=P,t.lineCap=O,t.lineJoin=$,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var J=new Path2D;J.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),J.addPath(g),t.clip(J,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=P/3;var ue=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ue}t.setLineDash&&t.setLineDash([])}},ge=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var J=d;p&&(J={x:0,y:0});var ue=a.getNodeShape(e),X=P;D==="inside"&&(X=0),D==="outside"&&(X*=2);var fe=(o+X+(B+K))/o,ee=(l+X+(B+K))/l,Ae=o*fe,Re=l*ee,Xe=a.nodeShapes[ue].points,Ne;if(p){var qe=re(Ae,Re,ue,Xe);Ne=qe.path}if(ue==="ellipse")a.drawEllipsePath(Ne||t,J.x,J.y,Ae,Re);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ue)){var De=0,Ke=0,ze=0;ue==="round-diamond"?De=(X+K+B)*1.4:ue==="round-heptagon"?(De=(X+K+B)*1.075,ze=-(X/2+K+B)/35):ue==="round-hexagon"?De=(X+K+B)*1.12:ue==="round-pentagon"?(De=(X+K+B)*1.13,ze=-(X/2+K+B)/15):ue==="round-tag"?(De=(X+K+B)*1.12,Ke=(X/2+B+K)*.07):ue==="round-triangle"&&(De=(X+K+B)*(Math.PI/2),ze=-(X+K/2+B)/Math.PI),De!==0&&(fe=(o+De)/o,Ae=o*fe,["round-hexagon","round-tag"].includes(ue)||(ee=(l+De)/l,Re=l*ee)),q=q==="auto"?P_e(Ae,Re):q;for(var st=Ae/2,Oe=Re/2,mt=q+(X+B+K)/2,Le=new Array(Xe.length/2),St=new Array(Xe.length/2),At=0;At0){if(i=i||n.position(),s==null||a==null){var p=n.padding();s=n.width()+2*p,a=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,s+l*2,a+l*2,f),r.fill()}}}};om.drawNodeOverlay=GLe("overlay");om.drawNodeUnderlay=GLe("underlay");om.hasPie=function(t){return t=t[0],t._private.hasPie};om.hasStripe=function(t){return t=t[0],t._private.hasStripe};om.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),s=e.pstyle("pie-size"),a=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),s.units==="%"?f=f*s.pfValue:s.pfValue!==void 0&&(f=s.pfValue/2),a.units==="%"?p=f*a.pfValue:a.pfValue!==void 0&&(p=a.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,T=v/100;T+g>1&&(T=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var S=2*Math.PI*T,k=C+S;v===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=T)}};om.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),s=n.x,a=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(s=0,a=0),a-=p/2,s-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,x=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(s,a+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],x),t.fill(),u+=b)}t.restore()};var zl={},Pjt=100;zl.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};zl.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),T=a!==void 0?a:b,C=r.pan(),S={x:C.x,y:C.y},k={zoom:b,pan:{x:C.x,y:C.y}},E=e.prevViewport,A=E===void 0||k.zoom!==E.zoom||k.pan.x!==E.pan.x||k.pan.y!==E.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),T*=l,S.x*=l,S.y*=l;var R=e.getCachedZSortedEles();function _(Q,Z,re,ie,me){var te=Q.globalCompositeOperation;Q.globalCompositeOperation="destination-out",e.colorFillStyle(Q,255,255,255,e.motionBlurTransparency),Q.fillRect(Z,re,ie,me),Q.globalCompositeOperation=te}function P(Q,Z){var re,ie,me,te;!e.clearingMotionBlur&&(Q===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Q===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(re={x:C.x*p,y:C.y*p},ie=b*p,me=e.canvasWidth*p,te=e.canvasHeight*p):(re=S,ie=T,me=e.canvasWidth,te=e.canvasHeight),Q.setTransform(1,0,0,1,0,0),Z==="motionBlur"?_(Q,0,0,me,te):!n&&(Z===void 0||Z)&&Q.clearRect(0,0,me,te),i||(Q.translate(re.x,re.y),Q.scale(ie,ie)),o&&Q.translate(o.x,o.y),a&&Q.scale(a,a)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var N=e.data.bufferContexts[e.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var L=u.contexts[e.NODE],I=e.textureCache.texture,k=e.textureCache.viewport;L.setTransform(1,0,0,1,0,0),f?_(L,0,0,k.width,k.height):L.clearRect(0,0,k.width,k.height);var $=x.core("outside-texture-bg-color").value,O=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(L,$[0],$[1],$[2],O),L.fillRect(0,0,k.width,k.height);var b=r.zoom();P(L,!1),L.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),L.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||s||V[e.NODE]){var B=f&&!V[e.NODE]&&p!==1,L=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),H=f&&!B?"motionBlur":void 0;P(L,H),z?e.drawCachedNodes(L,R.nondrag,l,D):e.drawLayeredElements(L,R.nondrag,l,D),e.debug&&e.drawDebugPoints(L,R.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!s&&(h[e.DRAG]||i||V[e.DRAG])){var B=f&&!V[e.DRAG]&&p!==1,L=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(L,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(L,R.drag,l,D):e.drawCachedElements(L,R.drag,l,D),e.debug&&e.drawDebugPoints(L,R.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var G=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],K=u.contexts[e.DRAG],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],oe=function(Z,re,ie){Z.setTransform(1,0,0,1,0,0),ie||!v?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(Z,0,0,e.canvasWidth,e.canvasHeight);var me=p;Z.drawImage(re,0,0,e.canvasWidth*me,e.canvasHeight*me,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(oe(G,W,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(oe(K,q,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},Pjt)),n||r.emit("render")};var vC;zl.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,s=n.style(),a=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!a&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=s.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+s.core("selection-box-color").value[0]+","+s.core("selection-box-color").value[1]+","+s.core("selection-box-color").value[2]+","+s.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+s.core("selection-box-border-color").value[0]+","+s.core("selection-box-border-color").value[1]+","+s.core("selection-box-border-color").value[2]+","+s.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+s.core("active-bg-color").value[0]+","+s.core("active-bg-color").value[1]+","+s.core("active-bg-color").value[2]+","+s.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,s.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!vC){var v=h.measureText(y);vC=v.actualBoundingBoxAscent}h.fillText(y,0,vC);var x=60;h.strokeRect(0,vC+10,250,20),h.fillRect(0,vC+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Hpe(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function $jt(t,e,r){var n=Hpe(t,t.VERTEX_SHADER,e),i=Hpe(t,t.FRAGMENT_SHADER,r),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,i),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw new Error("Could not initialize shaders");return s}function Bjt(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function cee(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function Fjt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function zjt(t,e,r,n,i){var s=n*r+e.x,a=i*r+e.y;return a=Math.round(t.canvasHeight-a),[s,a]}function Vjt(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function Hjt(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function Gjt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Wjt(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function WLe(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function qLe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function qjt(t,e,r,n,i,s){switch(e){case t.FLOAT:return new Float32Array(r.buffer,s*n,i);case t.INT:return new Int32Array(r.buffer,s*n,i)}}function Ujt(t,e,r,n){var i=WLe(t,e),s=ra(i,2),a=s[0],o=s[1],l=qLe(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,a,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,a,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Hh(t,e,r,n){var i=WLe(t,r),s=ra(i,3),a=s[0],o=s[1],l=s[2],u=qLe(t,o,e*a),h=a*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,a,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,a,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;pa&&(o=a/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var s=this;if(this.locked)throw new Error("can't draw, atlas is locked");var a=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,T){if(i&&T){var C=T.context,S=b.x,k=b.row,E=S,A=l*k;C.save(),C.translate(E,A),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(s.freePointer,s.canvas),g[0]={x:s.freePointer.x,y:s.freePointer.row*l,w:d,h:f},g[1]={x:s.freePointer.x+d,y:s.freePointer.row*l,w:0,h:f},s.freePointer.x+=d,s.freePointer.x==a&&(s.freePointer.x=0,s.freePointer.row++)},y=function(){var b=s.scratch,T=s.canvas;b.clear(),p({x:0,row:0},b);var C=a-s.freePointer.x,S=d-C,k=l;{var E=s.freePointer.x,A=s.freePointer.row*l,R=C;T.context.drawImage(b,0,0,R,k,E,A,R,k),g[0]={x:E,y:A,w:R,h:f}}{var _=C,P=(s.freePointer.row+1)*l,N=S;T&&T.context.drawImage(b,_,0,N,k,0,P,N,k),g[1]={x:0,y:P,w:N,h:f}}s.freePointer.x=S,s.freePointer.row++},v=function(){s.freePointer.x=0,s.freePointer.row++};if(this.freePointer.x+d<=a)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===a?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,s=this.getScale(r),a=s.texW;return this.freePointer.x+a>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},s=i.forceRedraw,a=s===void 0?!1:s,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=uc(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=uc(this.renderTypes.values()),v;try{var x=function(){var T=v.value,C=T.type;if(h(C)){var S=n.collections.get(T.collection),k=T.getKey(m),E=Array.isArray(k)?k:[k];if(a)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),R=n._key(C,A),_=n.typeAndIdToKey.get(R);_!==void 0&&!Hjt(E,_)&&(d=!0,n.typeAndIdToKey.delete(R),_.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)x()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=uc(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(s){r.e(s)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,s){var a=this.renderTypes.get(n),o=this.collections.get(a.collection),l=!1,u=o.draw(s,i,function(f){a.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),a.drawElement(f,r,i,!0,!0),f.restore()):a.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=a.getID?a.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(s):this.typeAndIdToKey.set(d,[s])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,s=this.renderTypes.get(n),a=s.getKey(r),o=Array.isArray(a)?a:[a];return o.map(function(l){var u=s.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=ra(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=uc(this.collections),i;try{for(n.s();!(i=n.n()).done;){var s=ra(i.value,2),a=s[0],o=s[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:a,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),tXt=(function(){function t(e){im(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return sm(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),rXt=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,Vjt=` +`,nXt=` 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); } -`,Hjt=` +`,iXt=` 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; } -`,Gjt=` +`,sXt=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -2858,7 +2865,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,lS={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},FL={IGNORE:1,USE_BB:2},Iz=0,zpe=1,Vpe=2,Nz=3,Jv=4,P8=5,mC=6,yC=7,Wjt=(function(){function t(e,r,n){tm(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=Tjt,this.atlasManager=new Bjt(e,n),this.batchManager=new Fjt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(lS.SCREEN),this.pickingProgram=this._createShaderProgram(lS.PICKING),this.vao=this._createVAO()}return rm(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,s=this.atlasManager;return i?s.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):s.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,hS={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},HL={IGNORE:1,USE_BB:2},Pz=0,Upe=1,Ype=2,$z=3,t2=4,z8=5,bC=6,xC=7,aXt=(function(){function t(e,r,n){im(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=Bjt,this.atlasManager=new eXt(e,n),this.batchManager=new tXt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(hS.SCREEN),this.pickingProgram=this._createShaderProgram(hS.PICKING),this.vao=this._createVAO()}return sm(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,s=this.atlasManager;return i?s.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):s.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; @@ -2905,7 +2912,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - if(aVertType == `.concat(Iz,`) { + if(aVertType == `.concat(Pz,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; @@ -2923,8 +2930,8 @@ https://github.com/jquery/jquery/blob/master/src/event.js gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(Jv," || aVertType == ").concat(yC,` - || aVertType == `).concat(P8," || aVertType == ").concat(mC,`) { // simple shapes + else if(aVertType == `).concat(t2," || aVertType == ").concat(xC,` + || aVertType == `).concat(z8," || aVertType == ").concat(bC,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat @@ -2939,7 +2946,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(zpe,`) { + else if(aVertType == `).concat(Upe,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -2954,7 +2961,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; } - else if(aVertType == `).concat(Vpe,`) { + else if(aVertType == `).concat(Ype,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -3003,7 +3010,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js vColor = aColor; } - else if(aVertType == `).concat(Nz,` && vid < 3) { + else if(aVertType == `).concat($z,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); @@ -3048,10 +3055,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js out vec4 outColor; - `).concat(zjt,` - `).concat(Vjt,` - `).concat(Hjt,` - `).concat(Gjt,` + `).concat(rXt,` + `).concat(nXt,` + `).concat(iXt,` + `).concat(sXt,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -3067,21 +3074,21 @@ https://github.com/jquery/jquery/blob/master/src/event.js } void main(void) { - if(vVertType == `).concat(Iz,`) { + if(vVertType == `).concat(Pz,`) { // look up the texel from the texture unit `).concat(s.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` } - else if(vVertType == `).concat(Nz,`) { + else if(vVertType == `).concat($z,`) { // 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(Jv,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + else if(vVertType == `).concat(t2,` && 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(Jv," || vVertType == ").concat(yC,` - || vVertType == `).concat(P8," || vVertType == ").concat(mC,`) { // use SDF + else if(vVertType == `).concat(t2," || vVertType == ").concat(xC,` + || vVertType == `).concat(z8," || vVertType == ").concat(bC,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; @@ -3092,11 +3099,11 @@ https://github.com/jquery/jquery/blob/master/src/event.js vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance - if(vVertType == `).concat(Jv,`) { + if(vVertType == `).concat(t2,`) { d = rectangleSD(p, b); - } else if(vVertType == `).concat(yC,` && w == h) { + } else if(vVertType == `).concat(xC,` && w == h) { d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(yC,`) { + } else if(vVertType == `).concat(xC,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); @@ -3136,16 +3143,16 @@ https://github.com/jquery/jquery/blob/master/src/event.js `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=wjt(n,i,a);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:lS.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var s=this.atlasManager,a=this.batchManager,o=s.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===FL.IGNORE)return;if(l==FL.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=s.getAtlasInfo(r,i),h=oc(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;a.canAddToCurrentBatch(p)||this.endBatch();for(var y=a.getAtlasIndexForBatch(p),v=0,x=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(_){h.e(_)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),s){var l=s.bb,u=s.tex1,h=s.tex2,d=u.w/(u.w+h.w);a||(d=1-d);var f=this._getAdjustedBB(l,o,a,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,s){var a,o;Bpe(r);var l=i.getRotation?i.getRotation(s):0;if(l!==0){var u=i.getRotationPoint(s),h=u.x,d=u.y;iR(r,r,[h,d]),Fpe(r,r,l);var f=i.getRotationOffset(s);a=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else a=n.x1,o=n.y1;iR(r,r,[a,o]),Gq(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,s){var a=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(a-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*s;return i&&s<1?l=f:!i&&s<1&&(d=l-f,a+=d,l=f),{x1:a,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var s=this.atlasManager.getRenderTypeOpts(i),a=this.instanceCount;this.vertTypeBuffer.getView(a)[0]=Jv;var o=this.indexBuffer.getView(a);Qv(n,o);var l=this.colorBuffer.getView(a);Nm([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(a);this.setTransformMatrix(r,u,s),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var s=this.simpleShapeOptions.get(i);if(this._isVisible(r,s)){var a=s.shapeProps,o=this._getVertTypeForShape(r,a.shape);if(o===void 0||s.isSimple&&!s.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===P8||o===mC){var u=s.getBoundingBox(r),h=this._getCornerRadius(r,a.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===mC&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Qv(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(a.opacity).value*p,m=r.pstyle(a.color).value,y=this.colorBuffer.getView(l);Nm(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,a.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,T=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Nm(b,T,C);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-x;else if(S==="outside")v[0]=x,v[1]=0;else{var k=x/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,s),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return Jv;case"ellipse":return yC;case"roundrectangle":case"round-rectangle":return P8;case"bottom-round-rectangle":return mC;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var s=i.w,a=i.h;if(r.pstyle(n).value==="auto")return Ag(s,a);var o=r.pstyle(n).pfValue,l=s/2,u=a/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var s=r._private.rscratch,a,o,l;if(i==="source"?(a=s.arrowStartX,o=s.arrowStartY,l=s.srcArrowAngle):(a=s.arrowEndX,o=s.arrowEndY,l=s.tgtArrowAngle),!(isNaN(a)||a==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,x=this.transformBuffer.getMatrixView(v);Bpe(x),iR(x,x,[a,o]),Gq(x,x,[y,y]),Fpe(x,x,l),this.vertTypeBuffer.getView(v)[0]=Nz;var b=this.indexBuffer.getView(v);Qv(n,b);var T=this.colorBuffer.getView(v);Nm(h,p,T),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var s=r.pstyle("opacity").value,a=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=s*a;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=zpe;var d=this.indexBuffer.getView(h);Qv(n,d);var f=this.colorBuffer.getView(h);Nm(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var s=this._getNumSegments(r);return this._getCurveSegmentPoints(i,s)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),s=0;s<=n;s++)if(s==0)i[0]=r[0],i[1]=r[1];else if(s==n)i[s*2]=r[r.length-2],i[s*2+1]=r[r.length-1];else{var a=s/n;this._setCurvePoint(r,a,i,s*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,s){if(r.length<=2)i[s]=r[0],i[s+1]=r[1];else{for(var a=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?FL.USE_BB:FL.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:Sjt,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:a("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:a("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Dz(e.getLabelKey,null),getBoundingBox:Oz(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Dz(e.getSourceLabelKey,"source"),getBoundingBox:Oz(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:s("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Dz(e.getTargetLabelKey,"target"),getBoundingBox:Oz(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:s("target-label")});var u=v7(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),Ujt(r)};function qjt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return d_e(r)}function VLe(t,e){var r=t._private.rscratch;return ul(r,"labelWrapCachedLines",e)||[]}var Dz=function(e,r){return function(n){var i=e(n),s=VLe(n,r);return s.length>1?s.map(function(a,o){return"".concat(i,"_").concat(o)}):i}},Oz=function(e,r){return function(n,i){var s=e(n);if(typeof i=="string"){var a=i.indexOf("_");if(a>0){var o=Number(i.substring(a+1)),l=VLe(n,r),u=s.h/l.length,h=u*o,d=s.y1+h;return{x1:s.x1,w:s.w,y1:d,h:u,yOffset:h}}}return s}};function Ujt(t){{var e=t.render;t.render=function(s){s=s||{};var a=t.cy;t.webgl&&(a.zoom()>NLe?(Yjt(t),e.call(t,s)):(jjt(t),GLe(t,s,lS.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(s){r.call(t,s),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(s,a,o,l){return eXt(t,s,a)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(s,a){i.call(t,s,a),s==="viewport"||s==="bounds"?t.pickingFrameBuffer.needsDraw=!0:s==="background"&&t.drawing.invalidate(a,{type:"node-body"})}}}function Yjt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function jjt(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Xjt(t){var e=t.canvasWidth,r=t.canvasHeight,n=see(t),i=n.pan,s=n.zoom,a=Lz();iR(a,a,[i.x,i.y]),Gq(a,a,[s,s]);var o=Lz();Djt(o,e,r);var l=Lz();return Njt(l,o,a),l}function HLe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=see(t),s=i.pan,a=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(s.x,s.y),e.scale(a,a)}function Kjt(t,e){t.drawSelectionRectangle(e,function(r){return HLe(t,r)})}function Zjt(t){var e=t.data.contexts[t.NODE];e.save(),HLe(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Qjt(t){var e=function(i,s,a){for(var o=i.atlasManager.getAtlasCollection(s),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&T.add(k)}return T}function eXt(t,e,r){var n=Jjt(t,e,r),i=t.getCachedZSortedEles(),s,a,o=oc(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!s&&h.isNode()&&(s=h),!a&&h.isEdge()&&(a=h),s&&a)break}}catch(d){o.e(d)}finally{o.f()}return[s,a].filter(Boolean)}function Pz(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function GLe(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Kjt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var a=t.data.contexts[t.WEBGL];r.screen?(a.clearColor(0,0,0,0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)):a.disable(a.BLEND),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),a.viewport(0,0,a.canvas.width,a.canvas.height);var o=Xjt(t),l=t.getCachedZSortedEles();if(s=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&a>0){p.clearRect(0,0,s,a),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,s,a),p.fill())}return f};function tXt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),s=0;s"u"?"undefined":La(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[OLe,Kd,Y0,iee,iv,im,Bl,zLe,sm,k7,ULe].forEach(function(t){Gr(kn,t)});var iXt=[{name:"null",impl:xLe},{name:"base",impl:LLe},{name:"canvas",impl:rXt}],sXt=[{type:"layout",extensions:MYt},{type:"renderer",extensions:iXt}],jLe={},XLe={};function KLe(t,e,r){var n=r,i=function(E){pi("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Y6.prototype[e])return i(e);Y6.prototype[e]=r}else if(t==="collection"){if(So.prototype[e])return i(e);So.prototype[e]=r}else if(t==="layout"){for(var s=function(E){this.options=E,r.call(this,E),jn(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},a=s.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function s(a,o){a==null&&o==null?(this.x=0,this.y=0):(this.x=a,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(a){this.x=a},s.prototype.setY=function(a){this.y=a},s.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},r.exports=s}),(function(r,n,i){var s=i(2),a=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){s.call(this,x),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(s.prototype);for(var m in s)g[m]=s[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,T=x.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=a.MAX_VALUE,v=a.MAX_VALUE,x,b,T,C=this.getNodes(),S=C.length,k=0;kx&&(y=x),v>b&&(v=b)}return y==a.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=a.MAX_VALUE,x=-a.MAX_VALUE,b=a.MAX_VALUE,T=-a.MAX_VALUE,C,S,k,E,A,R=this.nodes,_=R.length,P=0;P<_;P++){var N=R[P];y&&N.child!=null&&N.updateBounds(),C=N.getLeft(),S=N.getRight(),k=N.getTop(),E=N.getBottom(),v>C&&(v=C),xk&&(b=k),TC&&(v=C),xk&&(b=k),T=this.nodes.length){var _=0;x.forEach(function(P){P.owner==y&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var s,a=i(1);function o(l){s=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof s){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=R,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,L=!0):(u[0]=y,u[1]=m,L=!0):$===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=b,u[1]=x,L=!0)),-O===D?f>h?(u[2]=A,u[3]=R,I=!0):(u[2]=E,u[3]=k,I=!0):O===D&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=_,u[3]=R,I=!0)),L&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,D,4),z=this.getCardinalDirection(O,D,2)):(F=this.getCardinalDirection(-$,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(F=this.getCardinalDirection(-$,D,1),z=this.getCardinalDirection(-O,D,3)):(F=this.getCardinalDirection($,D,2),z=this.getCardinalDirection(O,D,4)),!L)switch(F){case 1:B=m,V=h+-C/D,u[0]=V,u[1]=B;break;case 2:V=b,B=d+T*D,u[0]=V,u[1]=B;break;case 3:B=x,V=h+C/D,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-T*D,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:G=k,H=f+-N/D,u[2]=H,u[3]=G;break;case 2:H=_,G=p+P*D,u[2]=H,u[3]=G;break;case 3:G=R,H=f+N/D,u[2]=H,u[3]=G;break;case 4:H=A,G=p+-P*D,u[2]=H,u[3]=G;break}}return!1},a.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},a.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,T=void 0,C=void 0,S=void 0,k=void 0,E=void 0,A=void 0,R=void 0,_=void 0;return C=g-f,k=d-p,A=p*f-d*g,S=x-y,E=m-v,R=v*y-m*x,_=C*E-S*k,_===0?null:(b=(k*R-E*A)/_,T=(S*A-C*R)/_,new s(b,T))},a.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:a<0?-1:0},s.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},s.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},r.exports=s}),(function(r,n,i){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s}),(function(r,n,i){var s=(function(){function d(f,p){for(var g=0;g"u"?"undefined":s(o);return o==null||l!="object"&&l!="function"},r.exports=a}),(function(r,n,i){function s(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&k.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(R,1);var _=S.getNeighborsList();_.forEach(function(L){if(v.indexOf(L)<0){var I=x.get(L),$=I-1;$==1&&E.push(L),x.set(L,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s}),(function(r,n,i){var s=i(4);function a(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(o){this.lworldExtX=o},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(o){this.lworldExtY=o},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},a.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},a.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},a.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},a.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},a.prototype.inverseTransformPoint=function(o){var l=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=a}),(function(r,n,i){function s(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mC||T>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||T>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var s=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},a.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(R){return E.has(R)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(_){return k.has(_)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var A=!this.isTreeGrowing&&!this.isGrowthFinished,R=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(A,R),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),E={},A=0;A1){var L;for(L=0;LR&&(R=Math.floor(N.y)),P=Math.floor(N.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-N.x/2,p.WORLD_CENTER_Y-N.y/2))},C.radialLayout=function(k,E,A){var R=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,R);var _=b.calculateBounds(k),P=new T;P.setDeviceOrgX(_.getMinX()),P.setDeviceOrgY(_.getMinY()),P.setWorldOrgX(A.x),P.setWorldOrgY(A.y);for(var N=0;N1;){var G=H[0];H.splice(0,1);var W=D.indexOf(G);W>=0&&D.splice(W,1),V--,F--}E!=null?B=(D.indexOf(H[0])+1)%V:B=0;for(var K=Math.abs(R-A)/F,q=B;z!=F;q=++q%V){var oe=D[q].getOtherEnd(k);if(oe!=E){var Q=(A+z*K)%360,Z=(Q+K)%360;C.branchRadialLayout(oe,k,Q,Z,_+P,P),z++}}},C.maxDiagonalInTree=function(k){for(var E=v.MIN_VALUE,A=0;AE&&(E=_)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,E={};this.memberGroups={},this.idToDummyNode={};for(var A=[],R=this.graphManager.getAllNodes(),_=0;_"u"&&(E[L]=[]),E[L]=E[L].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var $="DummyCompound_"+I;k.memberGroups[$]=E[I];var O=E[I][0].getParent(),D=new u(k.graphManager);D.id=$,D.paddingLeft=O.paddingLeft||0,D.paddingRight=O.paddingRight||0,D.paddingBottom=O.paddingBottom||0,D.paddingTop=O.paddingTop||0,k.idToDummyNode[$]=D;var F=k.getGraphManager().add(k.newGraph(),D),z=O.getChild();z.add(D);for(var V=0;V=0;k--){var E=this.compoundOrder[k],A=E.id,R=E.paddingLeft,_=E.paddingTop;this.adjustLocations(this.tiledMemberPack[A],E.rect.x,E.rect.y,R,_)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(A){var R=k.idToDummyNode[A],_=R.paddingLeft,P=R.paddingTop;k.adjustLocations(E[A],R.rect.x,R.rect.y,_,P)})},C.prototype.getToBeTiled=function(k){var E=k.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var A=k.getChild();if(A==null)return this.toBeTiled[E]=!1,!1;for(var R=A.getNodes(),_=0;_0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var E=k.getEdges(),A=0,R=0;RI&&(I=O.rect.height)}A+=I+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,E){var A=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(R){var _=E[R];A.tiledMemberPack[R]=A.tileNodes(k[R],_.paddingLeft+_.paddingRight),_.rect.width=A.tiledMemberPack[R].width,_.rect.height=A.tiledMemberPack[R].height})},C.prototype.tileNodes=function(k,E){var A=d.TILING_PADDING_VERTICAL,R=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:A,horizontalPadding:R};k.sort(function(L,I){return L.rect.width*L.rect.height>I.rect.width*I.rect.height?-1:L.rect.width*L.rect.height0&&(N+=k.horizontalPadding),k.rowWidth[A]=N,k.width0&&(L+=k.verticalPadding);var I=0;L>k.rowHeight[A]&&(I=k.rowHeight[A],k.rowHeight[A]=L,I=k.rowHeight[A]-I),k.height+=I,k.rows[A].push(E)},C.prototype.getShortestRowIndex=function(k){for(var E=-1,A=Number.MAX_VALUE,R=0;RA&&(E=R,A=k.rowWidth[R]);return E},C.prototype.canAddHorizontal=function(k,E,A){var R=this.getShortestRowIndex(k);if(R<0)return!0;var _=k.rowWidth[R];if(_+k.horizontalPadding+E<=k.width)return!0;var P=0;k.rowHeight[R]0&&(P=A+k.verticalPadding-k.rowHeight[R]);var N;k.width-_>=E+k.horizontalPadding?N=(k.height+P)/(_+E+k.horizontalPadding):N=(k.height+P)/k.width,P=A+k.verticalPadding;var L;return k.widthP&&E!=A){R.splice(-1,1),k.rows[A].push(_),k.rowWidth[E]=k.rowWidth[E]-P,k.rowWidth[A]=k.rowWidth[A]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var N=Number.MIN_VALUE,L=0;LN&&(N=R[L].height);E>0&&(N+=k.verticalPadding);var I=k.rowHeight[E]+k.rowHeight[A];k.rowHeight[E]=N,k.rowHeight[A]<_.height+k.verticalPadding&&(k.rowHeight[A]=_.height+k.verticalPadding);var $=k.rowHeight[E]+k.rowHeight[A];k.height+=$-I,this.shiftToLastRow(k)}},C.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},C.prototype.reduceTrees=function(){for(var k=[],E=!0,A;E;){var R=this.graphManager.getAllNodes(),_=[];E=!1;for(var P=0;P0)for(var z=_;z<=P;z++)F[0]+=this.grid[z][N-1].length+this.grid[z][N].length-1;if(P0)for(var z=N;z<=L;z++)F[3]+=this.grid[_-1][z].length+this.grid[_][z].length-1;for(var V=v.MAX_VALUE,B,H,G=0;G0){var L;L=T.getGraphManager().add(T.newGraph(),A),this.processChildrenList(L,E,T)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(sR)),sR.exports}var gXt=pXt();const mXt=qg(gXt);Od.use(mXt);function QLe(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}w(QLe,"addNodes");function JLe(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}w(JLe,"addEdges");function eIe(t){return new Promise(e=>{const r=wt("body").append("div").attr("id","cy").attr("style","display:none"),n=Od({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),QLe(t.nodes,n),JLe(t.edges,n),n.nodes().forEach(function(s){s.layoutDimensions=()=>{const a=s.data();return{w:a.width,h:a.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(s=>{de.info("Cytoscape ready",s),e(n)})})}w(eIe,"createCytoscapeInstance");function tIe(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(s=>{s!=="id"&&(i[s]=r[s])}),i})}w(tIe,"extractPositionedNodes");function rIe(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(s=>{["id","source","target"].includes(s)||(i[s]=r[s])}),i})}w(rIe,"extractPositionedEdges");async function nIe(t,e){de.debug("Starting cose-bilkent layout algorithm");try{iIe(t);const r=await eIe(t),n=tIe(r),i=rIe(r);return de.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw de.error("Error in cose-bilkent layout algorithm:",r),r}}w(nIe,"executeCoseBilkentLayout");function iIe(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}w(iIe,"validateLayoutData");var yXt=w(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:s,insertNode:a,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");s(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const T={...b};d[b.id]=T,h[b.id]=T,await r(p,b)}else{const T={...b};h[b.id]=T;const C=await a(y,b,{config:t.config,dir:t.direction||"TB"}),S=C.node().getBBox();T.width=S.width,T.height=S.height,T.domId=C,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const T=h[b.id];return{...b,width:T.width,height:T.height}})},x=await nIe(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const T=h[b.id];T!=null&&T.domId&&(T.domId.attr("transform",`translate(${b.x}, ${b.y})`),T.x=b.x,T.y=b.y,o.debug(`Positioned node ${T.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const T=t.edges.find(C=>C.id===b.id);T&&(T.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const T=h[b.start??""],C=h[b.end??""];if(T&&C){const S=x.edges.find(k=>k.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const k={...b},E=n(g,k,d,t.type,T,C,t.diagramId);l(k,E)}else{const k={...b,points:[{x:T.x||0,y:T.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,k,d,t.type,T,C,t.diagramId);l(k,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),vXt=yXt;const bXt=Object.freeze(Object.defineProperty({__proto__:null,render:vXt},Symbol.toStringTag,{value:"Module"}));var hO=w((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),sIe=w((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};hO(t,r).lower()},"drawBackgroundRect"),xXt=w((t,e)=>{const r=e.text.replace(r3," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),aee=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const s=Xy.sanitizeUrl(n);i.attr("xlink:href",s)},"drawImage"),oee=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const s=Xy.sanitizeUrl(n);i.attr("xlink:href",`#${s}`)},"drawEmbeddedImage"),jc=w(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),lee=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),cee=w(()=>{let t=wt(".mermaidTooltip");return t.empty()&&(t=wt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),VL=(function(){var t=w(function(we,Me,je,le){for(je=je||{},le=we.length;le--;je[we[le]]=Me);return je},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],s=[1,28],a=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],x=[1,34],b=[1,35],T=[1,36],C=[1,37],S=[1,38],k=[1,39],E=[1,40],A=[1,41],R=[1,42],_=[1,43],P=[1,44],N=[1,45],L=[1,46],I=[1,47],$=[1,48],O=[1,50],D=[1,51],F=[1,52],z=[1,53],V=[1,54],B=[1,55],H=[1,56],G=[1,57],W=[1,58],K=[1,59],q=[1,60],oe=[14,42],Q=[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],Z=[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],re=[1,82],ie=[1,83],me=[1,84],te=[1,85],_e=[12,14,42],$e=[12,14,33,42],Fe=[12,14,33,42,76,77,79,80],ce=[12,33],he=[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],Te={trace:w(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:w(function(Me,je,le,pe,Ce,ne,j){var J=ne.length-1;switch(Ce){case 3:pe.setDirection("TB");break;case 4:pe.setDirection("BT");break;case 5:pe.setDirection("RL");break;case 6:pe.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:pe.setC4Type(ne[J-3]);break;case 19:pe.setTitle(ne[J].substring(6)),this.$=ne[J].substring(6);break;case 20:pe.setAccDescription(ne[J].substring(15)),this.$=ne[J].substring(15);break;case 21:this.$=ne[J].trim(),pe.setTitle(this.$);break;case 22:case 23:this.$=ne[J].trim(),pe.setAccDescription(this.$);break;case 28:ne[J].splice(2,0,"ENTERPRISE"),pe.addPersonOrSystemBoundary(...ne[J]),this.$=ne[J];break;case 29:ne[J].splice(2,0,"SYSTEM"),pe.addPersonOrSystemBoundary(...ne[J]),this.$=ne[J];break;case 30:pe.addPersonOrSystemBoundary(...ne[J]),this.$=ne[J];break;case 31:ne[J].splice(2,0,"CONTAINER"),pe.addContainerBoundary(...ne[J]),this.$=ne[J];break;case 32:pe.addDeploymentNode("node",...ne[J]),this.$=ne[J];break;case 33:pe.addDeploymentNode("nodeL",...ne[J]),this.$=ne[J];break;case 34:pe.addDeploymentNode("nodeR",...ne[J]),this.$=ne[J];break;case 35:pe.popBoundaryParseStack();break;case 39:pe.addPersonOrSystem("person",...ne[J]),this.$=ne[J];break;case 40:pe.addPersonOrSystem("external_person",...ne[J]),this.$=ne[J];break;case 41:pe.addPersonOrSystem("system",...ne[J]),this.$=ne[J];break;case 42:pe.addPersonOrSystem("system_db",...ne[J]),this.$=ne[J];break;case 43:pe.addPersonOrSystem("system_queue",...ne[J]),this.$=ne[J];break;case 44:pe.addPersonOrSystem("external_system",...ne[J]),this.$=ne[J];break;case 45:pe.addPersonOrSystem("external_system_db",...ne[J]),this.$=ne[J];break;case 46:pe.addPersonOrSystem("external_system_queue",...ne[J]),this.$=ne[J];break;case 47:pe.addContainer("container",...ne[J]),this.$=ne[J];break;case 48:pe.addContainer("container_db",...ne[J]),this.$=ne[J];break;case 49:pe.addContainer("container_queue",...ne[J]),this.$=ne[J];break;case 50:pe.addContainer("external_container",...ne[J]),this.$=ne[J];break;case 51:pe.addContainer("external_container_db",...ne[J]),this.$=ne[J];break;case 52:pe.addContainer("external_container_queue",...ne[J]),this.$=ne[J];break;case 53:pe.addComponent("component",...ne[J]),this.$=ne[J];break;case 54:pe.addComponent("component_db",...ne[J]),this.$=ne[J];break;case 55:pe.addComponent("component_queue",...ne[J]),this.$=ne[J];break;case 56:pe.addComponent("external_component",...ne[J]),this.$=ne[J];break;case 57:pe.addComponent("external_component_db",...ne[J]),this.$=ne[J];break;case 58:pe.addComponent("external_component_queue",...ne[J]),this.$=ne[J];break;case 60:pe.addRel("rel",...ne[J]),this.$=ne[J];break;case 61:pe.addRel("birel",...ne[J]),this.$=ne[J];break;case 62:pe.addRel("rel_u",...ne[J]),this.$=ne[J];break;case 63:pe.addRel("rel_d",...ne[J]),this.$=ne[J];break;case 64:pe.addRel("rel_l",...ne[J]),this.$=ne[J];break;case 65:pe.addRel("rel_r",...ne[J]),this.$=ne[J];break;case 66:pe.addRel("rel_b",...ne[J]),this.$=ne[J];break;case 67:ne[J].splice(0,1),pe.addRel("rel",...ne[J]),this.$=ne[J];break;case 68:pe.updateElStyle("update_el_style",...ne[J]),this.$=ne[J];break;case 69:pe.updateRelStyle("update_rel_style",...ne[J]),this.$=ne[J];break;case 70:pe.updateLayoutConfig("update_layout_config",...ne[J]),this.$=ne[J];break;case 71:this.$=[ne[J]];break;case 72:ne[J].unshift(ne[J-1]),this.$=ne[J];break;case 73:case 75:this.$=ne[J].trim();break;case 74:let ue={};ue[ne[J-1].trim()]=ne[J].trim(),this.$=ue;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{14:[1,74]},t(oe,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q}),t(oe,[2,14]),t(Q,[2,16],{12:[1,76]}),t(oe,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:re,77:ie,79:me,80:te},{35:86,75:81,76:re,77:ie,79:me,80:te},{35:87,75:81,76:re,77:ie,79:me,80:te},{35:88,75:81,76:re,77:ie,79:me,80:te},{35:89,75:81,76:re,77:ie,79:me,80:te},{35:90,75:81,76:re,77:ie,79:me,80:te},{35:91,75:81,76:re,77:ie,79:me,80:te},{35:92,75:81,76:re,77:ie,79:me,80:te},{35:93,75:81,76:re,77:ie,79:me,80:te},{35:94,75:81,76:re,77:ie,79:me,80:te},{35:95,75:81,76:re,77:ie,79:me,80:te},{35:96,75:81,76:re,77:ie,79:me,80:te},{35:97,75:81,76:re,77:ie,79:me,80:te},{35:98,75:81,76:re,77:ie,79:me,80:te},{35:99,75:81,76:re,77:ie,79:me,80:te},{35:100,75:81,76:re,77:ie,79:me,80:te},{35:101,75:81,76:re,77:ie,79:me,80:te},{35:102,75:81,76:re,77:ie,79:me,80:te},{35:103,75:81,76:re,77:ie,79:me,80:te},{35:104,75:81,76:re,77:ie,79:me,80:te},t(_e,[2,59]),{35:105,75:81,76:re,77:ie,79:me,80:te},{35:106,75:81,76:re,77:ie,79:me,80:te},{35:107,75:81,76:re,77:ie,79:me,80:te},{35:108,75:81,76:re,77:ie,79:me,80:te},{35:109,75:81,76:re,77:ie,79:me,80:te},{35:110,75:81,76:re,77:ie,79:me,80:te},{35:111,75:81,76:re,77:ie,79:me,80:te},{35:112,75:81,76:re,77:ie,79:me,80:te},{35:113,75:81,76:re,77:ie,79:me,80:te},{35:114,75:81,76:re,77:ie,79:me,80:te},{35:115,75:81,76:re,77:ie,79:me,80:te},{20:116,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{12:[1,118],33:[1,117]},{35:119,75:81,76:re,77:ie,79:me,80:te},{35:120,75:81,76:re,77:ie,79:me,80:te},{35:121,75:81,76:re,77:ie,79:me,80:te},{35:122,75:81,76:re,77:ie,79:me,80:te},{35:123,75:81,76:re,77:ie,79:me,80:te},{35:124,75:81,76:re,77:ie,79:me,80:te},{35:125,75:81,76:re,77:ie,79:me,80:te},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(oe,[2,15]),t(Q,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:s}),t(oe,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:s,34:a,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q}),t(Z,[2,21]),t(Z,[2,22]),t(_e,[2,39]),t($e,[2,71],{75:81,35:132,76:re,77:ie,79:me,80:te}),t(Fe,[2,73]),{78:[1,133]},t(Fe,[2,75]),t(Fe,[2,76]),t(_e,[2,40]),t(_e,[2,41]),t(_e,[2,42]),t(_e,[2,43]),t(_e,[2,44]),t(_e,[2,45]),t(_e,[2,46]),t(_e,[2,47]),t(_e,[2,48]),t(_e,[2,49]),t(_e,[2,50]),t(_e,[2,51]),t(_e,[2,52]),t(_e,[2,53]),t(_e,[2,54]),t(_e,[2,55]),t(_e,[2,56]),t(_e,[2,57]),t(_e,[2,58]),t(_e,[2,60]),t(_e,[2,61]),t(_e,[2,62]),t(_e,[2,63]),t(_e,[2,64]),t(_e,[2,65]),t(_e,[2,66]),t(_e,[2,67]),t(_e,[2,68]),t(_e,[2,69]),t(_e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Q,[2,18]),t(oe,[2,38]),t($e,[2,72]),t(Fe,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(he,[2,25]),t(he,[2,26],{12:[1,138]}),t(he,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:w(function(Me,je){if(je.recoverable)this.trace(Me);else{var le=new Error(Me);throw le.hash=je,le}},"parseError"),parse:w(function(Me){var je=this,le=[0],pe=[],Ce=[null],ne=[],j=this.table,J="",ue=0,X=0,fe=2,ee=1,Ae=ne.slice.call(arguments,1),Re=Object.create(this.lexer),Xe={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(Xe.yy[Ne]=this.yy[Ne]);Re.setInput(Me,Xe.yy),Xe.yy.lexer=Re,Xe.yy.parser=this,typeof Re.yylloc>"u"&&(Re.yylloc={});var qe=Re.yylloc;ne.push(qe);var De=Re.options&&Re.options.ranges;typeof Xe.yy.parseError=="function"?this.parseError=Xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ke(xe){le.length=le.length-2*xe,Ce.length=Ce.length-xe,ne.length=ne.length-xe}w(Ke,"popStack");function ze(){var xe;return xe=pe.pop()||Re.lex()||ee,typeof xe!="number"&&(xe instanceof Array&&(pe=xe,xe=pe.pop()),xe=je.symbols_[xe]||xe),xe}w(ze,"lex");for(var st,Oe,mt,Le,St={},At,lt,zt,It;;){if(Oe=le[le.length-1],this.defaultActions[Oe]?mt=this.defaultActions[Oe]:((st===null||typeof st>"u")&&(st=ze()),mt=j[Oe]&&j[Oe][st]),typeof mt>"u"||!mt.length||!mt[0]){var ft="";It=[];for(At in j[Oe])this.terminals_[At]&&At>fe&&It.push("'"+this.terminals_[At]+"'");Re.showPosition?ft="Parse error on line "+(ue+1)+`: + `),o=$jt(n,i,a);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:hS.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var s=this.atlasManager,a=this.batchManager,o=s.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===HL.IGNORE)return;if(l==HL.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=s.getAtlasInfo(r,i),h=uc(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;a.canAddToCurrentBatch(p)||this.endBatch();for(var y=a.getAtlasIndexForBatch(p),v=0,x=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(_){h.e(_)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),s){var l=s.bb,u=s.tex1,h=s.tex2,d=u.w/(u.w+h.w);a||(d=1-d);var f=this._getAdjustedBB(l,o,a,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,s){var a,o;Wpe(r);var l=i.getRotation?i.getRotation(s):0;if(l!==0){var u=i.getRotationPoint(s),h=u.x,d=u.y;lR(r,r,[h,d]),qpe(r,r,l);var f=i.getRotationOffset(s);a=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else a=n.x1,o=n.y1;lR(r,r,[a,o]),Yq(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,s){var a=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(a-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*s;return i&&s<1?l=f:!i&&s<1&&(d=l-f,a+=d,l=f),{x1:a,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var s=this.atlasManager.getRenderTypeOpts(i),a=this.instanceCount;this.vertTypeBuffer.getView(a)[0]=t2;var o=this.indexBuffer.getView(a);e2(n,o);var l=this.colorBuffer.getView(a);Pm([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(a);this.setTransformMatrix(r,u,s),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var s=this.simpleShapeOptions.get(i);if(this._isVisible(r,s)){var a=s.shapeProps,o=this._getVertTypeForShape(r,a.shape);if(o===void 0||s.isSimple&&!s.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===z8||o===bC){var u=s.getBoundingBox(r),h=this._getCornerRadius(r,a.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===bC&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);e2(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(a.opacity).value*p,m=r.pstyle(a.color).value,y=this.colorBuffer.getView(l);Pm(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,a.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,T=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Pm(b,T,C);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-x;else if(S==="outside")v[0]=x,v[1]=0;else{var k=x/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,s),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return t2;case"ellipse":return xC;case"roundrectangle":case"round-rectangle":return z8;case"bottom-round-rectangle":return bC;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var s=i.w,a=i.h;if(r.pstyle(n).value==="auto")return _g(s,a);var o=r.pstyle(n).pfValue,l=s/2,u=a/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var s=r._private.rscratch,a,o,l;if(i==="source"?(a=s.arrowStartX,o=s.arrowStartY,l=s.srcArrowAngle):(a=s.arrowEndX,o=s.arrowEndY,l=s.tgtArrowAngle),!(isNaN(a)||a==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,x=this.transformBuffer.getMatrixView(v);Wpe(x),lR(x,x,[a,o]),Yq(x,x,[y,y]),qpe(x,x,l),this.vertTypeBuffer.getView(v)[0]=$z;var b=this.indexBuffer.getView(v);e2(n,b);var T=this.colorBuffer.getView(v);Pm(h,p,T),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var s=r.pstyle("opacity").value,a=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=s*a;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=Upe;var d=this.indexBuffer.getView(h);e2(n,d);var f=this.colorBuffer.getView(h);Pm(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var s=this._getNumSegments(r);return this._getCurveSegmentPoints(i,s)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),s=0;s<=n;s++)if(s==0)i[0]=r[0],i[1]=r[1];else if(s==n)i[s*2]=r[r.length-2],i[s*2+1]=r[r.length-1];else{var a=s/n;this._setCurvePoint(r,a,i,s*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,s){if(r.length<=2)i[s]=r[0],i[s+1]=r[1];else{for(var a=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?HL.USE_BB:HL.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:Vjt,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:a("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:a("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Bz(e.getLabelKey,null),getBoundingBox:Fz(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Bz(e.getSourceLabelKey,"source"),getBoundingBox:Fz(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:s("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Bz(e.getTargetLabelKey,"target"),getBoundingBox:Fz(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:s("target-label")});var u=w7(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),lXt(r)};function oXt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return v_e(r)}function YLe(t,e){var r=t._private.rscratch;return dl(r,"labelWrapCachedLines",e)||[]}var Bz=function(e,r){return function(n){var i=e(n),s=YLe(n,r);return s.length>1?s.map(function(a,o){return"".concat(i,"_").concat(o)}):i}},Fz=function(e,r){return function(n,i){var s=e(n);if(typeof i=="string"){var a=i.indexOf("_");if(a>0){var o=Number(i.substring(a+1)),l=YLe(n,r),u=s.h/l.length,h=u*o,d=s.y1+h;return{x1:s.x1,w:s.w,y1:d,h:u,yOffset:h}}}return s}};function lXt(t){{var e=t.render;t.render=function(s){s=s||{};var a=t.cy;t.webgl&&(a.zoom()>FLe?(cXt(t),e.call(t,s)):(uXt(t),XLe(t,s,hS.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(s){r.call(t,s),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(s,a,o,l){return mXt(t,s,a)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(s,a){i.call(t,s,a),s==="viewport"||s==="bounds"?t.pickingFrameBuffer.needsDraw=!0:s==="background"&&t.drawing.invalidate(a,{type:"node-body"})}}}function cXt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function uXt(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function hXt(t){var e=t.canvasWidth,r=t.canvasHeight,n=cee(t),i=n.pan,s=n.zoom,a=Oz();lR(a,a,[i.x,i.y]),Yq(a,a,[s,s]);var o=Oz();Kjt(o,e,r);var l=Oz();return Xjt(l,o,a),l}function jLe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=cee(t),s=i.pan,a=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(s.x,s.y),e.scale(a,a)}function dXt(t,e){t.drawSelectionRectangle(e,function(r){return jLe(t,r)})}function fXt(t){var e=t.data.contexts[t.NODE];e.save(),jLe(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function pXt(t){var e=function(i,s,a){for(var o=i.atlasManager.getAtlasCollection(s),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&T.add(k)}return T}function mXt(t,e,r){var n=gXt(t,e,r),i=t.getCachedZSortedEles(),s,a,o=uc(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!s&&h.isNode()&&(s=h),!a&&h.isEdge()&&(a=h),s&&a)break}}catch(d){o.e(d)}finally{o.f()}return[s,a].filter(Boolean)}function zz(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function XLe(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&dXt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var a=t.data.contexts[t.WEBGL];r.screen?(a.clearColor(0,0,0,0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)):a.disable(a.BLEND),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),a.viewport(0,0,a.canvas.width,a.canvas.height);var o=hXt(t),l=t.getCachedZSortedEles();if(s=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&a>0){p.clearRect(0,0,s,a),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,s,a),p.fill())}return f};function yXt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),s=0;s"u"?"undefined":La(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[VLe,Jd,Z0,lee,av,om,zl,ULe,lm,A7,QLe].forEach(function(t){Gr(kn,t)});var xXt=[{name:"null",impl:ELe},{name:"base",impl:$Le},{name:"canvas",impl:vXt}],wXt=[{type:"layout",extensions:WYt},{type:"renderer",extensions:xXt}],eIe={},tIe={};function rIe(t,e,r){var n=r,i=function(E){gi("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(K6.prototype[e])return i(e);K6.prototype[e]=r}else if(t==="collection"){if(So.prototype[e])return i(e);So.prototype[e]=r}else if(t==="layout"){for(var s=function(E){this.options=E,r.call(this,E),jn(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},a=s.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function s(a,o){a==null&&o==null?(this.x=0,this.y=0):(this.x=a,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(a){this.x=a},s.prototype.setY=function(a){this.y=a},s.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},r.exports=s}),(function(r,n,i){var s=i(2),a=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){s.call(this,x),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(s.prototype);for(var m in s)g[m]=s[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,T=x.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=a.MAX_VALUE,v=a.MAX_VALUE,x,b,T,C=this.getNodes(),S=C.length,k=0;kx&&(y=x),v>b&&(v=b)}return y==a.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=a.MAX_VALUE,x=-a.MAX_VALUE,b=a.MAX_VALUE,T=-a.MAX_VALUE,C,S,k,E,A,R=this.nodes,_=R.length,P=0;P<_;P++){var N=R[P];y&&N.child!=null&&N.updateBounds(),C=N.getLeft(),S=N.getRight(),k=N.getTop(),E=N.getBottom(),v>C&&(v=C),xk&&(b=k),TC&&(v=C),xk&&(b=k),T=this.nodes.length){var _=0;x.forEach(function(P){P.owner==y&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var s,a=i(1);function o(l){s=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof s){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=R,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,L=!0):(u[0]=y,u[1]=m,L=!0):$===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=b,u[1]=x,L=!0)),-O===D?f>h?(u[2]=A,u[3]=R,I=!0):(u[2]=E,u[3]=k,I=!0):O===D&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=_,u[3]=R,I=!0)),L&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,D,4),z=this.getCardinalDirection(O,D,2)):(F=this.getCardinalDirection(-$,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(F=this.getCardinalDirection(-$,D,1),z=this.getCardinalDirection(-O,D,3)):(F=this.getCardinalDirection($,D,2),z=this.getCardinalDirection(O,D,4)),!L)switch(F){case 1:B=m,V=h+-C/D,u[0]=V,u[1]=B;break;case 2:V=b,B=d+T*D,u[0]=V,u[1]=B;break;case 3:B=x,V=h+C/D,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-T*D,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:G=k,H=f+-N/D,u[2]=H,u[3]=G;break;case 2:H=_,G=p+P*D,u[2]=H,u[3]=G;break;case 3:G=R,H=f+N/D,u[2]=H,u[3]=G;break;case 4:H=A,G=p+-P*D,u[2]=H,u[3]=G;break}}return!1},a.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},a.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,T=void 0,C=void 0,S=void 0,k=void 0,E=void 0,A=void 0,R=void 0,_=void 0;return C=g-f,k=d-p,A=p*f-d*g,S=x-y,E=m-v,R=v*y-m*x,_=C*E-S*k,_===0?null:(b=(k*R-E*A)/_,T=(S*A-C*R)/_,new s(b,T))},a.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:a<0?-1:0},s.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},s.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},r.exports=s}),(function(r,n,i){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s}),(function(r,n,i){var s=(function(){function d(f,p){for(var g=0;g"u"?"undefined":s(o);return o==null||l!="object"&&l!="function"},r.exports=a}),(function(r,n,i){function s(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&k.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(R,1);var _=S.getNeighborsList();_.forEach(function(L){if(v.indexOf(L)<0){var I=x.get(L),$=I-1;$==1&&E.push(L),x.set(L,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s}),(function(r,n,i){var s=i(4);function a(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(o){this.lworldExtX=o},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(o){this.lworldExtY=o},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},a.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},a.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},a.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},a.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},a.prototype.inverseTransformPoint=function(o){var l=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=a}),(function(r,n,i){function s(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mC||T>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||T>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var s=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},a.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(R){return E.has(R)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(_){return k.has(_)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var A=!this.isTreeGrowing&&!this.isGrowthFinished,R=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(A,R),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),E={},A=0;A1){var L;for(L=0;LR&&(R=Math.floor(N.y)),P=Math.floor(N.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-N.x/2,p.WORLD_CENTER_Y-N.y/2))},C.radialLayout=function(k,E,A){var R=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,R);var _=b.calculateBounds(k),P=new T;P.setDeviceOrgX(_.getMinX()),P.setDeviceOrgY(_.getMinY()),P.setWorldOrgX(A.x),P.setWorldOrgY(A.y);for(var N=0;N1;){var G=H[0];H.splice(0,1);var W=D.indexOf(G);W>=0&&D.splice(W,1),V--,F--}E!=null?B=(D.indexOf(H[0])+1)%V:B=0;for(var K=Math.abs(R-A)/F,q=B;z!=F;q=++q%V){var oe=D[q].getOtherEnd(k);if(oe!=E){var Q=(A+z*K)%360,Z=(Q+K)%360;C.branchRadialLayout(oe,k,Q,Z,_+P,P),z++}}},C.maxDiagonalInTree=function(k){for(var E=v.MIN_VALUE,A=0;AE&&(E=_)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,E={};this.memberGroups={},this.idToDummyNode={};for(var A=[],R=this.graphManager.getAllNodes(),_=0;_"u"&&(E[L]=[]),E[L]=E[L].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var $="DummyCompound_"+I;k.memberGroups[$]=E[I];var O=E[I][0].getParent(),D=new u(k.graphManager);D.id=$,D.paddingLeft=O.paddingLeft||0,D.paddingRight=O.paddingRight||0,D.paddingBottom=O.paddingBottom||0,D.paddingTop=O.paddingTop||0,k.idToDummyNode[$]=D;var F=k.getGraphManager().add(k.newGraph(),D),z=O.getChild();z.add(D);for(var V=0;V=0;k--){var E=this.compoundOrder[k],A=E.id,R=E.paddingLeft,_=E.paddingTop;this.adjustLocations(this.tiledMemberPack[A],E.rect.x,E.rect.y,R,_)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(A){var R=k.idToDummyNode[A],_=R.paddingLeft,P=R.paddingTop;k.adjustLocations(E[A],R.rect.x,R.rect.y,_,P)})},C.prototype.getToBeTiled=function(k){var E=k.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var A=k.getChild();if(A==null)return this.toBeTiled[E]=!1,!1;for(var R=A.getNodes(),_=0;_0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var E=k.getEdges(),A=0,R=0;RI&&(I=O.rect.height)}A+=I+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,E){var A=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(R){var _=E[R];A.tiledMemberPack[R]=A.tileNodes(k[R],_.paddingLeft+_.paddingRight),_.rect.width=A.tiledMemberPack[R].width,_.rect.height=A.tiledMemberPack[R].height})},C.prototype.tileNodes=function(k,E){var A=d.TILING_PADDING_VERTICAL,R=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:A,horizontalPadding:R};k.sort(function(L,I){return L.rect.width*L.rect.height>I.rect.width*I.rect.height?-1:L.rect.width*L.rect.height0&&(N+=k.horizontalPadding),k.rowWidth[A]=N,k.width0&&(L+=k.verticalPadding);var I=0;L>k.rowHeight[A]&&(I=k.rowHeight[A],k.rowHeight[A]=L,I=k.rowHeight[A]-I),k.height+=I,k.rows[A].push(E)},C.prototype.getShortestRowIndex=function(k){for(var E=-1,A=Number.MAX_VALUE,R=0;RA&&(E=R,A=k.rowWidth[R]);return E},C.prototype.canAddHorizontal=function(k,E,A){var R=this.getShortestRowIndex(k);if(R<0)return!0;var _=k.rowWidth[R];if(_+k.horizontalPadding+E<=k.width)return!0;var P=0;k.rowHeight[R]0&&(P=A+k.verticalPadding-k.rowHeight[R]);var N;k.width-_>=E+k.horizontalPadding?N=(k.height+P)/(_+E+k.horizontalPadding):N=(k.height+P)/k.width,P=A+k.verticalPadding;var L;return k.widthP&&E!=A){R.splice(-1,1),k.rows[A].push(_),k.rowWidth[E]=k.rowWidth[E]-P,k.rowWidth[A]=k.rowWidth[A]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var N=Number.MIN_VALUE,L=0;LN&&(N=R[L].height);E>0&&(N+=k.verticalPadding);var I=k.rowHeight[E]+k.rowHeight[A];k.rowHeight[E]=N,k.rowHeight[A]<_.height+k.verticalPadding&&(k.rowHeight[A]=_.height+k.verticalPadding);var $=k.rowHeight[E]+k.rowHeight[A];k.height+=$-I,this.shiftToLastRow(k)}},C.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},C.prototype.reduceTrees=function(){for(var k=[],E=!0,A;E;){var R=this.graphManager.getAllNodes(),_=[];E=!1;for(var P=0;P0)for(var z=_;z<=P;z++)F[0]+=this.grid[z][N-1].length+this.grid[z][N].length-1;if(P0)for(var z=N;z<=L;z++)F[3]+=this.grid[_-1][z].length+this.grid[_][z].length-1;for(var V=v.MAX_VALUE,B,H,G=0;G0){var L;L=T.getGraphManager().add(T.newGraph(),A),this.processChildrenList(L,E,T)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(cR)),cR.exports}var LXt=_Xt();const IXt=jg(LXt);Bd.use(IXt);function iIe(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}w(iIe,"addNodes");function sIe(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}w(sIe,"addEdges");function aIe(t){return new Promise(e=>{const r=wt("body").append("div").attr("id","cy").attr("style","display:none"),n=Bd({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),iIe(t.nodes,n),sIe(t.edges,n),n.nodes().forEach(function(s){s.layoutDimensions=()=>{const a=s.data();return{w:a.width,h:a.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(s=>{de.info("Cytoscape ready",s),e(n)})})}w(aIe,"createCytoscapeInstance");function oIe(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(s=>{s!=="id"&&(i[s]=r[s])}),i})}w(oIe,"extractPositionedNodes");function lIe(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(s=>{["id","source","target"].includes(s)||(i[s]=r[s])}),i})}w(lIe,"extractPositionedEdges");async function cIe(t,e){de.debug("Starting cose-bilkent layout algorithm");try{uIe(t);const r=await aIe(t),n=oIe(r),i=lIe(r);return de.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw de.error("Error in cose-bilkent layout algorithm:",r),r}}w(cIe,"executeCoseBilkentLayout");function uIe(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}w(uIe,"validateLayoutData");var NXt=w(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:s,insertNode:a,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");s(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const T={...b};d[b.id]=T,h[b.id]=T,await r(p,b)}else{const T={...b};h[b.id]=T;const C=await a(y,b,{config:t.config,dir:t.direction||"TB"}),S=C.node().getBBox();T.width=S.width,T.height=S.height,T.domId=C,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const T=h[b.id];return{...b,width:T.width,height:T.height}})},x=await cIe(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const T=h[b.id];T!=null&&T.domId&&(T.domId.attr("transform",`translate(${b.x}, ${b.y})`),T.x=b.x,T.y=b.y,o.debug(`Positioned node ${T.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const T=t.edges.find(C=>C.id===b.id);T&&(T.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const T=h[b.start??""],C=h[b.end??""];if(T&&C){const S=x.edges.find(k=>k.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const k={...b},E=n(g,k,d,t.type,T,C,t.diagramId);l(k,E)}else{const k={...b,points:[{x:T.x||0,y:T.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,k,d,t.type,T,C,t.diagramId);l(k,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),DXt=NXt;const OXt=Object.freeze(Object.defineProperty({__proto__:null,render:DXt},Symbol.toStringTag,{value:"Module"}));var pO=w((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),hIe=w((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};pO(t,r).lower()},"drawBackgroundRect"),PXt=w((t,e)=>{const r=e.text.replace(s3," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),uee=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const s=Zy.sanitizeUrl(n);i.attr("xlink:href",s)},"drawImage"),hee=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const s=Zy.sanitizeUrl(n);i.attr("xlink:href",`#${s}`)},"drawEmbeddedImage"),Zc=w(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),dee=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),fee=w(()=>{let t=wt(".mermaidTooltip");return t.empty()&&(t=wt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),WL=(function(){var t=w(function(we,Me,je,le){for(je=je||{},le=we.length;le--;je[we[le]]=Me);return je},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],s=[1,28],a=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],x=[1,34],b=[1,35],T=[1,36],C=[1,37],S=[1,38],k=[1,39],E=[1,40],A=[1,41],R=[1,42],_=[1,43],P=[1,44],N=[1,45],L=[1,46],I=[1,47],$=[1,48],O=[1,50],D=[1,51],F=[1,52],z=[1,53],V=[1,54],B=[1,55],H=[1,56],G=[1,57],W=[1,58],K=[1,59],q=[1,60],oe=[14,42],Q=[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],Z=[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],re=[1,82],ie=[1,83],me=[1,84],te=[1,85],_e=[12,14,42],$e=[12,14,33,42],Fe=[12,14,33,42,76,77,79,80],ce=[12,33],he=[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],Te={trace:w(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:w(function(Me,je,le,pe,Ce,ne,j){var J=ne.length-1;switch(Ce){case 3:pe.setDirection("TB");break;case 4:pe.setDirection("BT");break;case 5:pe.setDirection("RL");break;case 6:pe.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:pe.setC4Type(ne[J-3]);break;case 19:pe.setTitle(ne[J].substring(6)),this.$=ne[J].substring(6);break;case 20:pe.setAccDescription(ne[J].substring(15)),this.$=ne[J].substring(15);break;case 21:this.$=ne[J].trim(),pe.setTitle(this.$);break;case 22:case 23:this.$=ne[J].trim(),pe.setAccDescription(this.$);break;case 28:ne[J].splice(2,0,"ENTERPRISE"),pe.addPersonOrSystemBoundary(...ne[J]),this.$=ne[J];break;case 29:ne[J].splice(2,0,"SYSTEM"),pe.addPersonOrSystemBoundary(...ne[J]),this.$=ne[J];break;case 30:pe.addPersonOrSystemBoundary(...ne[J]),this.$=ne[J];break;case 31:ne[J].splice(2,0,"CONTAINER"),pe.addContainerBoundary(...ne[J]),this.$=ne[J];break;case 32:pe.addDeploymentNode("node",...ne[J]),this.$=ne[J];break;case 33:pe.addDeploymentNode("nodeL",...ne[J]),this.$=ne[J];break;case 34:pe.addDeploymentNode("nodeR",...ne[J]),this.$=ne[J];break;case 35:pe.popBoundaryParseStack();break;case 39:pe.addPersonOrSystem("person",...ne[J]),this.$=ne[J];break;case 40:pe.addPersonOrSystem("external_person",...ne[J]),this.$=ne[J];break;case 41:pe.addPersonOrSystem("system",...ne[J]),this.$=ne[J];break;case 42:pe.addPersonOrSystem("system_db",...ne[J]),this.$=ne[J];break;case 43:pe.addPersonOrSystem("system_queue",...ne[J]),this.$=ne[J];break;case 44:pe.addPersonOrSystem("external_system",...ne[J]),this.$=ne[J];break;case 45:pe.addPersonOrSystem("external_system_db",...ne[J]),this.$=ne[J];break;case 46:pe.addPersonOrSystem("external_system_queue",...ne[J]),this.$=ne[J];break;case 47:pe.addContainer("container",...ne[J]),this.$=ne[J];break;case 48:pe.addContainer("container_db",...ne[J]),this.$=ne[J];break;case 49:pe.addContainer("container_queue",...ne[J]),this.$=ne[J];break;case 50:pe.addContainer("external_container",...ne[J]),this.$=ne[J];break;case 51:pe.addContainer("external_container_db",...ne[J]),this.$=ne[J];break;case 52:pe.addContainer("external_container_queue",...ne[J]),this.$=ne[J];break;case 53:pe.addComponent("component",...ne[J]),this.$=ne[J];break;case 54:pe.addComponent("component_db",...ne[J]),this.$=ne[J];break;case 55:pe.addComponent("component_queue",...ne[J]),this.$=ne[J];break;case 56:pe.addComponent("external_component",...ne[J]),this.$=ne[J];break;case 57:pe.addComponent("external_component_db",...ne[J]),this.$=ne[J];break;case 58:pe.addComponent("external_component_queue",...ne[J]),this.$=ne[J];break;case 60:pe.addRel("rel",...ne[J]),this.$=ne[J];break;case 61:pe.addRel("birel",...ne[J]),this.$=ne[J];break;case 62:pe.addRel("rel_u",...ne[J]),this.$=ne[J];break;case 63:pe.addRel("rel_d",...ne[J]),this.$=ne[J];break;case 64:pe.addRel("rel_l",...ne[J]),this.$=ne[J];break;case 65:pe.addRel("rel_r",...ne[J]),this.$=ne[J];break;case 66:pe.addRel("rel_b",...ne[J]),this.$=ne[J];break;case 67:ne[J].splice(0,1),pe.addRel("rel",...ne[J]),this.$=ne[J];break;case 68:pe.updateElStyle("update_el_style",...ne[J]),this.$=ne[J];break;case 69:pe.updateRelStyle("update_rel_style",...ne[J]),this.$=ne[J];break;case 70:pe.updateLayoutConfig("update_layout_config",...ne[J]),this.$=ne[J];break;case 71:this.$=[ne[J]];break;case 72:ne[J].unshift(ne[J-1]),this.$=ne[J];break;case 73:case 75:this.$=ne[J].trim();break;case 74:let ue={};ue[ne[J-1].trim()]=ne[J].trim(),this.$=ue;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{14:[1,74]},t(oe,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q}),t(oe,[2,14]),t(Q,[2,16],{12:[1,76]}),t(oe,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:re,77:ie,79:me,80:te},{35:86,75:81,76:re,77:ie,79:me,80:te},{35:87,75:81,76:re,77:ie,79:me,80:te},{35:88,75:81,76:re,77:ie,79:me,80:te},{35:89,75:81,76:re,77:ie,79:me,80:te},{35:90,75:81,76:re,77:ie,79:me,80:te},{35:91,75:81,76:re,77:ie,79:me,80:te},{35:92,75:81,76:re,77:ie,79:me,80:te},{35:93,75:81,76:re,77:ie,79:me,80:te},{35:94,75:81,76:re,77:ie,79:me,80:te},{35:95,75:81,76:re,77:ie,79:me,80:te},{35:96,75:81,76:re,77:ie,79:me,80:te},{35:97,75:81,76:re,77:ie,79:me,80:te},{35:98,75:81,76:re,77:ie,79:me,80:te},{35:99,75:81,76:re,77:ie,79:me,80:te},{35:100,75:81,76:re,77:ie,79:me,80:te},{35:101,75:81,76:re,77:ie,79:me,80:te},{35:102,75:81,76:re,77:ie,79:me,80:te},{35:103,75:81,76:re,77:ie,79:me,80:te},{35:104,75:81,76:re,77:ie,79:me,80:te},t(_e,[2,59]),{35:105,75:81,76:re,77:ie,79:me,80:te},{35:106,75:81,76:re,77:ie,79:me,80:te},{35:107,75:81,76:re,77:ie,79:me,80:te},{35:108,75:81,76:re,77:ie,79:me,80:te},{35:109,75:81,76:re,77:ie,79:me,80:te},{35:110,75:81,76:re,77:ie,79:me,80:te},{35:111,75:81,76:re,77:ie,79:me,80:te},{35:112,75:81,76:re,77:ie,79:me,80:te},{35:113,75:81,76:re,77:ie,79:me,80:te},{35:114,75:81,76:re,77:ie,79:me,80:te},{35:115,75:81,76:re,77:ie,79:me,80:te},{20:116,29:49,30:61,32:62,34:a,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q},{12:[1,118],33:[1,117]},{35:119,75:81,76:re,77:ie,79:me,80:te},{35:120,75:81,76:re,77:ie,79:me,80:te},{35:121,75:81,76:re,77:ie,79:me,80:te},{35:122,75:81,76:re,77:ie,79:me,80:te},{35:123,75:81,76:re,77:ie,79:me,80:te},{35:124,75:81,76:re,77:ie,79:me,80:te},{35:125,75:81,76:re,77:ie,79:me,80:te},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(oe,[2,15]),t(Q,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:s}),t(oe,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:s,34:a,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:x,50:b,51:T,52:C,53:S,54:k,55:E,56:A,57:R,58:_,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:F,67:z,68:V,69:B,70:H,71:G,72:W,73:K,74:q}),t(Z,[2,21]),t(Z,[2,22]),t(_e,[2,39]),t($e,[2,71],{75:81,35:132,76:re,77:ie,79:me,80:te}),t(Fe,[2,73]),{78:[1,133]},t(Fe,[2,75]),t(Fe,[2,76]),t(_e,[2,40]),t(_e,[2,41]),t(_e,[2,42]),t(_e,[2,43]),t(_e,[2,44]),t(_e,[2,45]),t(_e,[2,46]),t(_e,[2,47]),t(_e,[2,48]),t(_e,[2,49]),t(_e,[2,50]),t(_e,[2,51]),t(_e,[2,52]),t(_e,[2,53]),t(_e,[2,54]),t(_e,[2,55]),t(_e,[2,56]),t(_e,[2,57]),t(_e,[2,58]),t(_e,[2,60]),t(_e,[2,61]),t(_e,[2,62]),t(_e,[2,63]),t(_e,[2,64]),t(_e,[2,65]),t(_e,[2,66]),t(_e,[2,67]),t(_e,[2,68]),t(_e,[2,69]),t(_e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Q,[2,18]),t(oe,[2,38]),t($e,[2,72]),t(Fe,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(he,[2,25]),t(he,[2,26],{12:[1,138]}),t(he,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:w(function(Me,je){if(je.recoverable)this.trace(Me);else{var le=new Error(Me);throw le.hash=je,le}},"parseError"),parse:w(function(Me){var je=this,le=[0],pe=[],Ce=[null],ne=[],j=this.table,J="",ue=0,X=0,fe=2,ee=1,Ae=ne.slice.call(arguments,1),Re=Object.create(this.lexer),Xe={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(Xe.yy[Ne]=this.yy[Ne]);Re.setInput(Me,Xe.yy),Xe.yy.lexer=Re,Xe.yy.parser=this,typeof Re.yylloc>"u"&&(Re.yylloc={});var qe=Re.yylloc;ne.push(qe);var De=Re.options&&Re.options.ranges;typeof Xe.yy.parseError=="function"?this.parseError=Xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ke(xe){le.length=le.length-2*xe,Ce.length=Ce.length-xe,ne.length=ne.length-xe}w(Ke,"popStack");function ze(){var xe;return xe=pe.pop()||Re.lex()||ee,typeof xe!="number"&&(xe instanceof Array&&(pe=xe,xe=pe.pop()),xe=je.symbols_[xe]||xe),xe}w(ze,"lex");for(var st,Oe,mt,Le,St={},At,lt,zt,It;;){if(Oe=le[le.length-1],this.defaultActions[Oe]?mt=this.defaultActions[Oe]:((st===null||typeof st>"u")&&(st=ze()),mt=j[Oe]&&j[Oe][st]),typeof mt>"u"||!mt.length||!mt[0]){var ft="";It=[];for(At in j[Oe])this.terminals_[At]&&At>fe&&It.push("'"+this.terminals_[At]+"'");Re.showPosition?ft="Parse error on line "+(ue+1)+`: `+Re.showPosition()+` Expecting `+It.join(", ")+", got '"+(this.terminals_[st]||st)+"'":ft="Parse error on line "+(ue+1)+": Unexpected "+(st==ee?"end of input":"'"+(this.terminals_[st]||st)+"'"),this.parseError(ft,{text:Re.match,token:this.terminals_[st]||st,line:Re.yylineno,loc:qe,expected:It})}if(mt[0]instanceof Array&&mt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Oe+", token: "+st);switch(mt[0]){case 1:le.push(st),Ce.push(Re.yytext),ne.push(Re.yylloc),le.push(mt[1]),st=null,X=Re.yyleng,J=Re.yytext,ue=Re.yylineno,qe=Re.yylloc;break;case 2:if(lt=this.productions_[mt[1]][1],St.$=Ce[Ce.length-lt],St._$={first_line:ne[ne.length-(lt||1)].first_line,last_line:ne[ne.length-1].last_line,first_column:ne[ne.length-(lt||1)].first_column,last_column:ne[ne.length-1].last_column},De&&(St._$.range=[ne[ne.length-(lt||1)].range[0],ne[ne.length-1].range[1]]),Le=this.performAction.apply(St,[J,X,ue,Xe.yy,mt[1],Ce,ne].concat(Ae)),typeof Le<"u")return Le;lt&&(le=le.slice(0,-1*lt*2),Ce=Ce.slice(0,-1*lt),ne=ne.slice(0,-1*lt)),le.push(this.productions_[mt[1]][0]),Ce.push(St.$),ne.push(St._$),zt=j[le[le.length-2]][le[le.length-1]],le.push(zt);break;case 3:return!0}}return!0},"parse")},ge=(function(){var we={EOF:1,parseError:w(function(je,le){if(this.yy.parser)this.yy.parser.parseError(je,le);else throw new Error(je)},"parseError"),setInput:w(function(Me,je){return this.yy=je||this.yy||{},this._input=Me,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 Me=this._input[0];this.yytext+=Me,this.yyleng++,this.offset++,this.match+=Me,this.matched+=Me;var je=Me.match(/(?:\r\n?|\n).*/g);return je?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Me},"input"),unput:w(function(Me){var je=Me.length,le=Me.split(/(?:\r\n?|\n)/g);this._input=Me+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-je),this.offset-=je;var pe=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),le.length-1&&(this.yylineno-=le.length-1);var Ce=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:le?(le.length===pe.length?this.yylloc.first_column:0)+pe[pe.length-le.length].length-le[0].length:this.yylloc.first_column-je},this.options.ranges&&(this.yylloc.range=[Ce[0],Ce[0]+this.yyleng-je]),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(Me){this.unput(this.match.slice(Me))},"less"),pastInput:w(function(){var Me=this.matched.substr(0,this.matched.length-this.match.length);return(Me.length>20?"...":"")+Me.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Me=this.match;return Me.length<20&&(Me+=this._input.substr(0,20-Me.length)),(Me.substr(0,20)+(Me.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Me=this.pastInput(),je=new Array(Me.length+1).join("-");return Me+this.upcomingInput()+` `+je+"^"},"showPosition"),test_match:w(function(Me,je){var le,pe,Ce;if(this.options.backtrack_lexer&&(Ce={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&&(Ce.yylloc.range=this.yylloc.range.slice(0))),pe=Me[0].match(/(?:\r\n?|\n).*/g),pe&&(this.yylineno+=pe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:pe?pe[pe.length-1].length-pe[pe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Me[0].length},this.yytext+=Me[0],this.match+=Me[0],this.matches=Me,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(Me[0].length),this.matched+=Me[0],le=this.performAction.call(this,this.yy,this,je,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),le)return le;if(this._backtrack){for(var ne in Ce)this[ne]=Ce[ne];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Me,je,le,pe;this._more||(this.yytext="",this.match="");for(var Ce=this._currentRules(),ne=0;neje[0].length)){if(je=le,pe=ne,this.options.backtrack_lexer){if(Me=this.test_match(le,Ce[ne]),Me!==!1)return Me;if(this._backtrack){je=!1;continue}else return!1}else if(!this.options.flex)break}return je?(Me=this.test_match(je,Ce[pe]),Me!==!1?Me:!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 je=this.next();return je||this.lex()},"lex"),begin:w(function(je){this.conditionStack.push(je)},"begin"),popState:w(function(){var je=this.conditionStack.length-1;return je>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(je){return je=this.conditionStack.length-1-Math.abs(je||0),je>=0?this.conditionStack[je]:"INITIAL"},"topState"),pushState:w(function(je){this.begin(je)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(je,le,pe,Ce){switch(pe){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return we})();Te.lexer=ge;function He(){this.yy={}}return w(He,"Parser"),He.prototype=Te,Te.Parser=He,new He})();VL.parser=VL;var wXt=VL,Eh=[],rg=[""],kl="global",yh="",Pd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],X6=[],uee="",hee=!1,HL=4,GL=2,aIe,TXt=w(function(){return aIe},"getC4Type"),CXt=w(function(t){aIe=Ln(t,Ve())},"setC4Type"),kXt=w(function(t,e,r,n,i,s,a,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=X6.find(d=>d.from===e&&d.to===r);if(h?u=h:X6.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(s==null)u.descr={text:""};else if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]={text:f}}else u.descr={text:s};if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]=f}else u.sprite=a;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=am()},"addRel"),SXt=w(function(t,e,r,n,i,s,a){if(e===null||r===null)return;let o={};const l=Eh.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Eh.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.tags=s;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.link=a;o.typeC4Shape={text:t},o.parentBoundary=kl,o.wrap=am()},"addPersonOrSystem"),EXt=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Eh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Eh.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.sprite=s;if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=am(),l.typeC4Shape={text:t},l.parentBoundary=kl},"addContainer"),AXt=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Eh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Eh.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.sprite=s;if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=am(),l.typeC4Shape={text:t},l.parentBoundary=kl},"addComponent"),MXt=w(function(t,e,r,n,i){if(t===null||e===null)return;let s={};const a=Pd.find(o=>o.alias===t);if(a&&t===a.alias?s=a:(s.alias=t,Pd.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];s[o]={text:l}}else s.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];s[o]=l}else s.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];s[o]=l}else s.link=i;s.parentBoundary=kl,s.wrap=am(),yh=kl,kl=t,rg.push(yh)},"addPersonOrSystemBoundary"),RXt=w(function(t,e,r,n,i){if(t===null||e===null)return;let s={};const a=Pd.find(o=>o.alias===t);if(a&&t===a.alias?s=a:(s.alias=t,Pd.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];s[o]={text:l}}else s.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];s[o]=l}else s.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];s[o]=l}else s.link=i;s.parentBoundary=kl,s.wrap=am(),yh=kl,kl=t,rg.push(yh)},"addContainerBoundary"),_Xt=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Pd.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Pd.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=kl,l.wrap=am(),yh=kl,kl=e,rg.push(yh)},"addDeploymentNode"),LXt=w(function(){kl=yh,rg.pop(),yh=rg.pop(),rg.push(yh)},"popBoundaryParseStack"),IXt=w(function(t,e,r,n,i,s,a,o,l,u,h){let d=Eh.find(f=>f.alias===e);if(!(d===void 0&&(d=Pd.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shadowing=s;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shape=a;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),NXt=w(function(t,e,r,n,i,s,a){const o=X6.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(s);if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(a)}},"updateRelStyle"),DXt=w(function(t,e,r){let n=HL,i=GL;if(typeof e=="object"){const s=Object.values(e)[0];n=parseInt(s)}else n=parseInt(e);if(typeof r=="object"){const s=Object.values(r)[0];i=parseInt(s)}else i=parseInt(r);n>=1&&(HL=n),i>=1&&(GL=i)},"updateLayoutConfig"),OXt=w(function(){return HL},"getC4ShapeInRow"),PXt=w(function(){return GL},"getC4BoundaryInRow"),$Xt=w(function(){return kl},"getCurrentBoundaryParse"),BXt=w(function(){return yh},"getParentBoundaryParse"),oIe=w(function(t){return t==null?Eh:Eh.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),FXt=w(function(t){return Eh.find(e=>e.alias===t)},"getC4Shape"),zXt=w(function(t){return Object.keys(oIe(t))},"getC4ShapeKeys"),lIe=w(function(t){return t==null?Pd:Pd.filter(e=>e.parentBoundary===t)},"getBoundaries"),VXt=lIe,HXt=w(function(){return X6},"getRels"),GXt=w(function(){return uee},"getTitle"),WXt=w(function(t){hee=t},"setWrap"),am=w(function(){return hee},"autoWrap"),qXt=w(function(){Eh=[],Pd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],yh="",kl="global",rg=[""],X6=[],rg=[""],uee="",hee=!1,HL=4,GL=2},"clear"),UXt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},YXt={FILLED:0,OPEN:1},jXt={LEFTOF:0,RIGHTOF:1,OVER:2},XXt=w(function(t){uee=Ln(t,Ve())},"setTitle"),Yq={addPersonOrSystem:SXt,addPersonOrSystemBoundary:MXt,addContainer:EXt,addContainerBoundary:RXt,addComponent:AXt,addDeploymentNode:_Xt,popBoundaryParseStack:LXt,addRel:kXt,updateElStyle:IXt,updateRelStyle:NXt,updateLayoutConfig:DXt,autoWrap:am,setWrap:WXt,getC4ShapeArray:oIe,getC4Shape:FXt,getC4ShapeKeys:zXt,getBoundaries:lIe,getBoundarys:VXt,getCurrentBoundaryParse:$Xt,getParentBoundaryParse:BXt,getRels:HXt,getTitle:GXt,getC4Type:TXt,getC4ShapeInRow:OXt,getC4BoundaryInRow:PXt,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,getConfig:w(()=>Ve().c4,"getConfig"),clear:qXt,LINETYPE:UXt,ARROWTYPE:YXt,PLACEMENT:jXt,setTitle:XXt,setC4Type:CXt},dee=w(function(t,e){return hO(t,e)},"drawRect"),cIe=w(function(t,e,r,n,i,s){const a=t.append("image");a.attr("width",e),a.attr("height",r),a.attr("x",n),a.attr("y",i);let o=s.startsWith("data:image/png;base64")?s:Xy.sanitizeUrl(s);a.attr("xlink:href",o)},"drawImage"),KXt=w((t,e,r,n)=>{const i=t.append("g");let s=0;for(let a of e){let o=a.textColor?a.textColor:"#444444",l=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,h=a.offsetY?parseInt(a.offsetY):0,d="";if(s===0){let p=i.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),s=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();Hf(r)(a.label.text,i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+h,a.label.width,a.label.height,{fill:o},f),a.techn&&a.techn.text!==""&&(f=r.messageFont(),Hf(r)("["+a.techn.text+"]",i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+r.messageFontSize+5+h,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),ZXt=w(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",s=e.borderColor?e.borderColor:"#444444",a=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:s,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};dee(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Hf(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=a,Hf(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Hf(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),QXt=w(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],s=e.fontColor?e.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=jc();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},dee(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=aKt(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",s).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":cIe(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,a);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=s,Hf(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:s},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=s,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?Hf(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:s,"font-style":"italic"},h):e.type&&e.type.text!==""&&Hf(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:s,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=s,Hf(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:s},h)),e.height},"drawC4Shape"),JXt=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),eKt=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),tKt=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),rKt=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),nKt=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),iKt=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),sKt=w(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),aKt=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),Hf=(function(){function t(i,s,a,o,l,u,h){const d=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Vt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>uIe)&&(r=this.nextData.startx+e.margin+Sr.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=s=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",s,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",s,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Xq(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(lx,"Bounds"),lx),Xq=w(function(t){sa(Sr,t),t.fontFamily&&(Sr.personFontFamily=Sr.systemFontFamily=Sr.messageFontFamily=t.fontFamily),t.fontSize&&(Sr.personFontSize=Sr.systemFontSize=Sr.messageFontSize=t.fontSize),t.fontWeight&&(Sr.personFontWeight=Sr.systemFontWeight=Sr.messageFontWeight=t.fontWeight)},"setConf"),vC=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),lR=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),oKt=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function bu(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Xk(e[t].text,i,n),e[t].textLines=e[t].text.split(Vt.lineBreakRegex).length,e[t].width=i,e[t].height=e_(e[t].text,n);else{let s=e[t].text.split(Vt.lineBreakRegex);e[t].textLines=s.length;let a=0;e[t].height=0,e[t].width=0;for(const o of s)e[t].width=Math.max(Cl(o,n),e[t].width),a=e_(o,n),e[t].height=e[t].height+a}}w(bu,"calcC4ShapeTextWH");var dIe=w(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Sr.c4ShapeMargin-35;let n=e.wrap&&Sr.wrap,i=lR(Sr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let s=Cl(e.label.text,i);bu("label",e,n,i,s),nd.drawBoundary(t,e,Sr)},"drawBoundary"),fIe=w(function(t,e,r,n){let i=0;for(const s of n){i=0;const a=r[s];let o=vC(Sr,a.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,a.typeC4Shape.width=Cl("«"+a.typeC4Shape.text+"»",o),a.typeC4Shape.height=o.fontSize+2,a.typeC4Shape.Y=Sr.c4ShapePadding,i=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=i,i=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=i,i=a.image.Y+a.image.height);let l=a.wrap&&Sr.wrap,u=Sr.width-Sr.c4ShapePadding*2,h=vC(Sr,a.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",bu("label",a,l,h,u),a.label.Y=i+8,i=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let p=vC(Sr,a.typeC4Shape.text);bu("type",a,l,p,u),a.type.Y=i+5,i=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let p=vC(Sr,a.techn.text);bu("techn",a,l,p,u),a.techn.Y=i+5,i=a.techn.Y+a.techn.height}let d=i,f=a.label.width;if(a.descr&&a.descr.text!==""){let p=vC(Sr,a.typeC4Shape.text);bu("descr",a,l,p,u),a.descr.Y=i+20,i=a.descr.Y+a.descr.height,f=Math.max(a.label.width,a.descr.width),d=i-a.descr.textLines*5}f=f+Sr.c4ShapePadding,a.width=Math.max(a.width||Sr.width,f,Sr.width),a.height=Math.max(a.height||Sr.height,d,Sr.height),a.margin=a.margin||Sr.c4ShapeMargin,t.insert(a),nd.drawC4Shape(e,a,Sr)}t.bumpLastMargin(Sr.c4ShapeMargin)},"drawC4ShapeArray"),cx,ru=(cx=class{constructor(e,r){this.x=e,this.y=r}},w(cx,"Point"),cx),jpe=w(function(t,e){let r=t.x,n=t.y,i=e.x,s=e.y,a=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-s),h=u/l,d=t.height/t.width,f=null;return n==s&&ri?f=new ru(r,o):r==i&&ns&&(f=new ru(a,n)),r>i&&n=h?f=new ru(r,o+h*t.width/2):f=new ru(a-l/u*t.height/2,n+t.height):r=h?f=new ru(r+t.width,o+h*t.width/2):f=new ru(a+l/u*t.height/2,n+t.height):rs?d>=h?f=new ru(r+t.width,o-h*t.width/2):f=new ru(a+t.height/2*l/u,n):r>i&&n>s&&(d>=h?f=new ru(r,o-t.width/2*h):f=new ru(a-t.height/2*l/u,n)),f},"getIntersectPoint"),lKt=w(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=jpe(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=jpe(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),cKt=w(function(t,e,r,n,i){let s=0;for(let a of e){s=s+1;let o=a.wrap&&Sr.wrap,l=oKt(Sr);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=s+": "+a.label.text);let h=Cl(a.label.text,l);bu("label",a,o,l,h),a.techn&&a.techn.text!==""&&(h=Cl(a.techn.text,l),bu("techn",a,o,l,h)),a.descr&&a.descr.text!==""&&(h=Cl(a.descr.text,l),bu("descr",a,o,l,h));let d=r(a.from),f=r(a.to),p=lKt(d,f);a.startPoint=p.startPoint,a.endPoint=p.endPoint}nd.drawRels(t,e,Sr,i)},"drawRels");function fee(t,e,r,n,i){let s=new hIe(i);s.data.widthLimit=r.data.widthLimit/Math.min(jq,n.length);for(let[a,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Sr.wrap,h=lR(Sr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",bu("label",o,u,h,s.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=lR(Sr);bu("type",o,u,g,s.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=lR(Sr);g.fontSize=g.fontSize-2,bu("descr",o,u,g,s.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(a==0||a%jq===0){let g=r.data.startx+Sr.diagramMarginX,m=r.data.stopy+Sr.diagramMarginY+l;s.setData(g,g,m,m)}else{let g=s.data.stopx!==s.data.startx?s.data.stopx+Sr.diagramMarginX:s.data.startx,m=s.data.starty;s.setData(g,g,m,m)}s.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&fIe(s,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&fee(t,e,s,p,i),o.alias!=="global"&&dIe(t,o,s),r.data.stopy=Math.max(s.data.stopy+Sr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(s.data.stopx+Sr.c4ShapeMargin,r.data.stopx),WL=Math.max(WL,r.data.stopx),qL=Math.max(qL,r.data.stopy)}}w(fee,"drawInsideBoundary");var uKt=w(function(t,e,r,n){Sr=Ve().c4;const i=Ve().securityLevel;let s;i==="sandbox"&&(s=wt("#i"+e));const a=wt(i==="sandbox"?s.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Sr.wrap),uIe=o.getC4ShapeInRow(),jq=o.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(Sr,null,2)}`);const l=i==="sandbox"?a.select(`[id="${e}"]`):wt(`[id="${e}"]`);nd.insertComputerIcon(l,e),nd.insertDatabaseIcon(l,e),nd.insertClockIcon(l,e);let u=new hIe(n);u.setData(Sr.diagramMarginX,Sr.diagramMarginX,Sr.diagramMarginY,Sr.diagramMarginY),u.data.widthLimit=screen.availWidth,WL=Sr.diagramMarginX,qL=Sr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");fee(l,"",u,d,n),nd.insertArrowHead(l,e),nd.insertArrowEnd(l,e),nd.insertArrowCrossHead(l,e),nd.insertArrowFilledHead(l,e),cKt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=WL,u.data.stopy=qL;const f=u.data;let g=f.stopy-f.starty+2*Sr.diagramMarginY;const y=f.stopx-f.startx+2*Sr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Sr.diagramMarginX).attr("y",f.starty+Sr.diagramMarginY),Fs(l,g,y,Sr.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-Sr.diagramMarginX+" -"+(Sr.diagramMarginY+v)+" "+y+" "+(g+v)),de.debug("models:",f)},"draw"),Xpe={drawPersonOrSystemArray:fIe,drawBoundary:dIe,setConf:Xq,draw:uKt},hKt=w(t=>`.person { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var je=this.next();return je||this.lex()},"lex"),begin:w(function(je){this.conditionStack.push(je)},"begin"),popState:w(function(){var je=this.conditionStack.length-1;return je>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(je){return je=this.conditionStack.length-1-Math.abs(je||0),je>=0?this.conditionStack[je]:"INITIAL"},"topState"),pushState:w(function(je){this.begin(je)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(je,le,pe,Ce){switch(pe){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return we})();Te.lexer=ge;function He(){this.yy={}}return w(He,"Parser"),He.prototype=Te,Te.Parser=He,new He})();WL.parser=WL;var $Xt=WL,Rh=[],sg=[""],El="global",xh="",Fd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Q6=[],pee="",gee=!1,qL=4,UL=2,dIe,BXt=w(function(){return dIe},"getC4Type"),FXt=w(function(t){dIe=Ln(t,Ve())},"setC4Type"),zXt=w(function(t,e,r,n,i,s,a,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=Q6.find(d=>d.from===e&&d.to===r);if(h?u=h:Q6.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(s==null)u.descr={text:""};else if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]={text:f}}else u.descr={text:s};if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]=f}else u.sprite=a;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=cm()},"addRel"),VXt=w(function(t,e,r,n,i,s,a){if(e===null||r===null)return;let o={};const l=Rh.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Rh.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.tags=s;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.link=a;o.typeC4Shape={text:t},o.parentBoundary=El,o.wrap=cm()},"addPersonOrSystem"),HXt=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Rh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Rh.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.sprite=s;if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=cm(),l.typeC4Shape={text:t},l.parentBoundary=El},"addContainer"),GXt=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Rh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Rh.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.sprite=s;if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=cm(),l.typeC4Shape={text:t},l.parentBoundary=El},"addComponent"),WXt=w(function(t,e,r,n,i){if(t===null||e===null)return;let s={};const a=Fd.find(o=>o.alias===t);if(a&&t===a.alias?s=a:(s.alias=t,Fd.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];s[o]={text:l}}else s.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];s[o]=l}else s.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];s[o]=l}else s.link=i;s.parentBoundary=El,s.wrap=cm(),xh=El,El=t,sg.push(xh)},"addPersonOrSystemBoundary"),qXt=w(function(t,e,r,n,i){if(t===null||e===null)return;let s={};const a=Fd.find(o=>o.alias===t);if(a&&t===a.alias?s=a:(s.alias=t,Fd.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];s[o]={text:l}}else s.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];s[o]=l}else s.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];s[o]=l}else s.link=i;s.parentBoundary=El,s.wrap=cm(),xh=El,El=t,sg.push(xh)},"addContainerBoundary"),UXt=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Fd.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Fd.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=El,l.wrap=cm(),xh=El,El=e,sg.push(xh)},"addDeploymentNode"),YXt=w(function(){El=xh,sg.pop(),xh=sg.pop(),sg.push(xh)},"popBoundaryParseStack"),jXt=w(function(t,e,r,n,i,s,a,o,l,u,h){let d=Rh.find(f=>f.alias===e);if(!(d===void 0&&(d=Fd.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shadowing=s;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shape=a;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),XXt=w(function(t,e,r,n,i,s,a){const o=Q6.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(s);if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(a)}},"updateRelStyle"),KXt=w(function(t,e,r){let n=qL,i=UL;if(typeof e=="object"){const s=Object.values(e)[0];n=parseInt(s)}else n=parseInt(e);if(typeof r=="object"){const s=Object.values(r)[0];i=parseInt(s)}else i=parseInt(r);n>=1&&(qL=n),i>=1&&(UL=i)},"updateLayoutConfig"),ZXt=w(function(){return qL},"getC4ShapeInRow"),QXt=w(function(){return UL},"getC4BoundaryInRow"),JXt=w(function(){return El},"getCurrentBoundaryParse"),eKt=w(function(){return xh},"getParentBoundaryParse"),fIe=w(function(t){return t==null?Rh:Rh.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),tKt=w(function(t){return Rh.find(e=>e.alias===t)},"getC4Shape"),rKt=w(function(t){return Object.keys(fIe(t))},"getC4ShapeKeys"),pIe=w(function(t){return t==null?Fd:Fd.filter(e=>e.parentBoundary===t)},"getBoundaries"),nKt=pIe,iKt=w(function(){return Q6},"getRels"),sKt=w(function(){return pee},"getTitle"),aKt=w(function(t){gee=t},"setWrap"),cm=w(function(){return gee},"autoWrap"),oKt=w(function(){Rh=[],Fd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],xh="",El="global",sg=[""],Q6=[],sg=[""],pee="",gee=!1,qL=4,UL=2},"clear"),lKt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},cKt={FILLED:0,OPEN:1},uKt={LEFTOF:0,RIGHTOF:1,OVER:2},hKt=w(function(t){pee=Ln(t,Ve())},"setTitle"),Zq={addPersonOrSystem:VXt,addPersonOrSystemBoundary:WXt,addContainer:HXt,addContainerBoundary:qXt,addComponent:GXt,addDeploymentNode:UXt,popBoundaryParseStack:YXt,addRel:zXt,updateElStyle:jXt,updateRelStyle:XXt,updateLayoutConfig:KXt,autoWrap:cm,setWrap:aKt,getC4ShapeArray:fIe,getC4Shape:tKt,getC4ShapeKeys:rKt,getBoundaries:pIe,getBoundarys:nKt,getCurrentBoundaryParse:JXt,getParentBoundaryParse:eKt,getRels:iKt,getTitle:sKt,getC4Type:BXt,getC4ShapeInRow:ZXt,getC4BoundaryInRow:QXt,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,getConfig:w(()=>Ve().c4,"getConfig"),clear:oKt,LINETYPE:lKt,ARROWTYPE:cKt,PLACEMENT:uKt,setTitle:hKt,setC4Type:FXt},mee=w(function(t,e){return pO(t,e)},"drawRect"),gIe=w(function(t,e,r,n,i,s){const a=t.append("image");a.attr("width",e),a.attr("height",r),a.attr("x",n),a.attr("y",i);let o=s.startsWith("data:image/png;base64")?s:Zy.sanitizeUrl(s);a.attr("xlink:href",o)},"drawImage"),dKt=w((t,e,r,n)=>{const i=t.append("g");let s=0;for(let a of e){let o=a.textColor?a.textColor:"#444444",l=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,h=a.offsetY?parseInt(a.offsetY):0,d="";if(s===0){let p=i.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),s=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();Uf(r)(a.label.text,i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+h,a.label.width,a.label.height,{fill:o},f),a.techn&&a.techn.text!==""&&(f=r.messageFont(),Uf(r)("["+a.techn.text+"]",i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+r.messageFontSize+5+h,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),fKt=w(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",s=e.borderColor?e.borderColor:"#444444",a=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:s,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};mee(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Uf(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=a,Uf(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Uf(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),pKt=w(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],s=e.fontColor?e.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Zc();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},mee(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=TKt(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",s).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":gIe(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,a);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=s,Uf(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:s},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=s,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?Uf(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:s,"font-style":"italic"},h):e.type&&e.type.text!==""&&Uf(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:s,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=s,Uf(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:s},h)),e.height},"drawC4Shape"),gKt=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),mKt=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),yKt=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),vKt=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),bKt=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),xKt=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),wKt=w(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),TKt=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),Uf=(function(){function t(i,s,a,o,l,u,h){const d=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Vt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>mIe)&&(r=this.nextData.startx+e.margin+Sr.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=s=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",s,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",s,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Jq(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(ux,"Bounds"),ux),Jq=w(function(t){sa(Sr,t),t.fontFamily&&(Sr.personFontFamily=Sr.systemFontFamily=Sr.messageFontFamily=t.fontFamily),t.fontSize&&(Sr.personFontSize=Sr.systemFontSize=Sr.messageFontSize=t.fontSize),t.fontWeight&&(Sr.personFontWeight=Sr.systemFontWeight=Sr.messageFontWeight=t.fontWeight)},"setConf"),wC=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),dR=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),CKt=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function Tu(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Qk(e[t].text,i,n),e[t].textLines=e[t].text.split(Vt.lineBreakRegex).length,e[t].width=i,e[t].height=i_(e[t].text,n);else{let s=e[t].text.split(Vt.lineBreakRegex);e[t].textLines=s.length;let a=0;e[t].height=0,e[t].width=0;for(const o of s)e[t].width=Math.max(Sl(o,n),e[t].width),a=i_(o,n),e[t].height=e[t].height+a}}w(Tu,"calcC4ShapeTextWH");var vIe=w(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Sr.c4ShapeMargin-35;let n=e.wrap&&Sr.wrap,i=dR(Sr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let s=Sl(e.label.text,i);Tu("label",e,n,i,s),ad.drawBoundary(t,e,Sr)},"drawBoundary"),bIe=w(function(t,e,r,n){let i=0;for(const s of n){i=0;const a=r[s];let o=wC(Sr,a.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,a.typeC4Shape.width=Sl("«"+a.typeC4Shape.text+"»",o),a.typeC4Shape.height=o.fontSize+2,a.typeC4Shape.Y=Sr.c4ShapePadding,i=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=i,i=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=i,i=a.image.Y+a.image.height);let l=a.wrap&&Sr.wrap,u=Sr.width-Sr.c4ShapePadding*2,h=wC(Sr,a.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Tu("label",a,l,h,u),a.label.Y=i+8,i=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let p=wC(Sr,a.typeC4Shape.text);Tu("type",a,l,p,u),a.type.Y=i+5,i=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let p=wC(Sr,a.techn.text);Tu("techn",a,l,p,u),a.techn.Y=i+5,i=a.techn.Y+a.techn.height}let d=i,f=a.label.width;if(a.descr&&a.descr.text!==""){let p=wC(Sr,a.typeC4Shape.text);Tu("descr",a,l,p,u),a.descr.Y=i+20,i=a.descr.Y+a.descr.height,f=Math.max(a.label.width,a.descr.width),d=i-a.descr.textLines*5}f=f+Sr.c4ShapePadding,a.width=Math.max(a.width||Sr.width,f,Sr.width),a.height=Math.max(a.height||Sr.height,d,Sr.height),a.margin=a.margin||Sr.c4ShapeMargin,t.insert(a),ad.drawC4Shape(e,a,Sr)}t.bumpLastMargin(Sr.c4ShapeMargin)},"drawC4ShapeArray"),hx,su=(hx=class{constructor(e,r){this.x=e,this.y=r}},w(hx,"Point"),hx),ege=w(function(t,e){let r=t.x,n=t.y,i=e.x,s=e.y,a=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-s),h=u/l,d=t.height/t.width,f=null;return n==s&&ri?f=new su(r,o):r==i&&ns&&(f=new su(a,n)),r>i&&n=h?f=new su(r,o+h*t.width/2):f=new su(a-l/u*t.height/2,n+t.height):r=h?f=new su(r+t.width,o+h*t.width/2):f=new su(a+l/u*t.height/2,n+t.height):rs?d>=h?f=new su(r+t.width,o-h*t.width/2):f=new su(a+t.height/2*l/u,n):r>i&&n>s&&(d>=h?f=new su(r,o-t.width/2*h):f=new su(a-t.height/2*l/u,n)),f},"getIntersectPoint"),kKt=w(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=ege(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=ege(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),SKt=w(function(t,e,r,n,i){let s=0;for(let a of e){s=s+1;let o=a.wrap&&Sr.wrap,l=CKt(Sr);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=s+": "+a.label.text);let h=Sl(a.label.text,l);Tu("label",a,o,l,h),a.techn&&a.techn.text!==""&&(h=Sl(a.techn.text,l),Tu("techn",a,o,l,h)),a.descr&&a.descr.text!==""&&(h=Sl(a.descr.text,l),Tu("descr",a,o,l,h));let d=r(a.from),f=r(a.to),p=kKt(d,f);a.startPoint=p.startPoint,a.endPoint=p.endPoint}ad.drawRels(t,e,Sr,i)},"drawRels");function yee(t,e,r,n,i){let s=new yIe(i);s.data.widthLimit=r.data.widthLimit/Math.min(Qq,n.length);for(let[a,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Sr.wrap,h=dR(Sr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Tu("label",o,u,h,s.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=dR(Sr);Tu("type",o,u,g,s.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=dR(Sr);g.fontSize=g.fontSize-2,Tu("descr",o,u,g,s.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(a==0||a%Qq===0){let g=r.data.startx+Sr.diagramMarginX,m=r.data.stopy+Sr.diagramMarginY+l;s.setData(g,g,m,m)}else{let g=s.data.stopx!==s.data.startx?s.data.stopx+Sr.diagramMarginX:s.data.startx,m=s.data.starty;s.setData(g,g,m,m)}s.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&bIe(s,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&yee(t,e,s,p,i),o.alias!=="global"&&vIe(t,o,s),r.data.stopy=Math.max(s.data.stopy+Sr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(s.data.stopx+Sr.c4ShapeMargin,r.data.stopx),YL=Math.max(YL,r.data.stopx),jL=Math.max(jL,r.data.stopy)}}w(yee,"drawInsideBoundary");var EKt=w(function(t,e,r,n){Sr=Ve().c4;const i=Ve().securityLevel;let s;i==="sandbox"&&(s=wt("#i"+e));const a=wt(i==="sandbox"?s.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Sr.wrap),mIe=o.getC4ShapeInRow(),Qq=o.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(Sr,null,2)}`);const l=i==="sandbox"?a.select(`[id="${e}"]`):wt(`[id="${e}"]`);ad.insertComputerIcon(l,e),ad.insertDatabaseIcon(l,e),ad.insertClockIcon(l,e);let u=new yIe(n);u.setData(Sr.diagramMarginX,Sr.diagramMarginX,Sr.diagramMarginY,Sr.diagramMarginY),u.data.widthLimit=screen.availWidth,YL=Sr.diagramMarginX,jL=Sr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");yee(l,"",u,d,n),ad.insertArrowHead(l,e),ad.insertArrowEnd(l,e),ad.insertArrowCrossHead(l,e),ad.insertArrowFilledHead(l,e),SKt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=YL,u.data.stopy=jL;const f=u.data;let g=f.stopy-f.starty+2*Sr.diagramMarginY;const y=f.stopx-f.startx+2*Sr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Sr.diagramMarginX).attr("y",f.starty+Sr.diagramMarginY),Fs(l,g,y,Sr.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-Sr.diagramMarginX+" -"+(Sr.diagramMarginY+v)+" "+y+" "+(g+v)),de.debug("models:",f)},"draw"),tge={drawPersonOrSystemArray:bIe,drawBoundary:vIe,setConf:Jq,draw:EKt},AKt=w(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),dKt=hKt,fKt={parser:wXt,db:Yq,renderer:Xpe,styles:dKt,init:w(({c4:t,wrap:e})=>{Xpe.setConf(t),Yq.setWrap(e)},"init")};const pKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:fKt},Symbol.toStringTag,{value:"Module"}));var S7=w(()=>` +`,"getStyles"),MKt=AKt,RKt={parser:$Xt,db:Zq,renderer:tge,styles:MKt,init:w(({c4:t,wrap:e})=>{tge.setConf(t),Zq.setWrap(e)},"init")};const _Kt=Object.freeze(Object.defineProperty({__proto__:null,diagram:RKt},Symbol.toStringTag,{value:"Module"}));var M7=w(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -3159,21 +3166,21 @@ Expecting `+It.join(", ")+", got '"+(this.terminals_[st]||st)+"'":ft="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),S3=w((t,e)=>{let r;return e==="sandbox"&&(r=wt("#i"+t)),wt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),sv=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:s,x:a,y:o}=gKt(t,e);Fs(t,s,i,n);const l=mKt(a,o,i,s,e);t.attr("viewBox",l),de.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),gKt=w((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),mKt=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),yKt="flowchart-",ux,vKt=(ux=class{constructor(){this.vertexCounter=0,this.config=Ve(),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=Hi,this.setAccDescription=rs,this.setDiagramTitle=Ji,this.getAccTitle=ts,this.getAccDescription=ns,this.getDiagramTitle=qi,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Vt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,s,a,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),M3=w((t,e)=>{let r;return e==="sandbox"&&(r=wt("#i"+t)),wt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),ov=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:s,x:a,y:o}=LKt(t,e);Fs(t,s,i,n);const l=IKt(a,o,i,s,e);t.attr("viewBox",l),de.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),LKt=w((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),IKt=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),NKt="flowchart-",dx,DKt=(dx=class{constructor(){this.vertexCounter=0,this.config=Ve(),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=Hi,this.setAccDescription=rs,this.setDiagramTitle=Ji,this.getAccTitle=ts,this.getAccDescription=ns,this.getDiagramTitle=qi,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Vt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,s,a,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` `)?m=l+` `:m=`{ `+l+` -}`,u=KN(m,{schema:XN})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&de.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:yKt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ve(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),s!=null&&s.forEach(m=>{f.classes.push(m)}),a!==void 0&&(f.dir=a),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!WSe(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};de.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=Mb(o.start,o.end,{counter:0,prefix:"L"}):o.id=Mb(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))de.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,u=JN(m,{schema:QN})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&de.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:NKt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ve(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),s!=null&&s.forEach(m=>{f.classes.push(m)}),a!==void 0&&(f.dir=a),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!KSe(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};de.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=_b(o.start,o.end,{counter:0,prefix:"L"}):o.id=_b(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))de.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;de.info("addLink",e,r,i);for(const s of e)for(const a of r){const o=s===e[e.length-1],l=a===r[0];o&&l?this.addSingleLink(s,a,n,i):this.addSingleLink(s,a,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,s,a,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((s=(i=this.edges[n])==null?void 0:i.style)==null?void 0:s.length)??0)>0&&!((o=(a=this.edges[n])==null?void 0:a.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let s=this.classes.get(i);s===void 0&&(s={id:i,styles:[],textStyles:[]},this.classes.set(i,s)),n!=null&&n.forEach(a=>{if(/color/.exec(a)){const o=a.replace("fill","bgFill");s.textStyles.push(o)}s.styles.push(a)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const s=this.edges.find(o=>o.id===n);s&&s.classes.push(r);const a=this.subGraphLookup.get(n);a&&a.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Ve().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{const a=this.lookUpDomId(e),o=document.querySelector(`[id="${a}"]`);o!==null&&o.addEventListener("click",()=>{Kr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const s=this.vertices.get(i);s!==void 0&&(s.link=Kr.formatUrl(r,this.config),s.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=cee();wt(e).select("svg").selectAll("g.node").on("mouseover",s=>{var u;const a=wt(s.currentTarget),o=a.attr("title");if(o===null)return;const l=(u=s.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(a.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(o0.sanitize(o)),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),wt(s.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Ve(),Ri()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),s=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=w(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const T=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:T in m?m[T].hasOwnProperty(b)?!1:m[T][b]=!0:y.includes(b)?!1:y.push(b)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=Ve().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Ve().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,s=1;for(;i=0){const o=this.indexNodes2(e,a);if(o.result)return{result:!0,count:s+o.count};s=s+o.count}i=i+1}return{result:!1,count:s}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let s=0;s":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let s="normal",a=n.length-1;n.startsWith("=")&&(s="thick"),n.startsWith("~")&&(s="invisible");const o=this.countChar(".",n);return o&&(s="dotted",a=o),{type:i,stroke:s,length:a}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,s)=>{this.exists(r,i)||n.push(e.nodes[s])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,s,a){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=s.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(s=>s.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(s=>s.trim()))}return r}getData(){const e=Ve(),r=[],n=[],i=this.getSubGraphs(),s=new Map,a=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&a.set(h.id,!0);for(const d of h.nodes)s.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:s.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,s,a,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:Mb(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return hTe.flowchart}},w(ux,"FlowDB"),ux),bKt=w(function(t,e){return e.db.getClasses()},"getClasses"),xKt=w(async function(t,e,r,n,i){var f;de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:s,flowchart:a,layout:o}=Ve();n.db.setDiagramId(e),de.debug("Before getData: ");const l=n.db.getData();de.debug("Data: ",l);const u=S3(e,s),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=n7(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&de.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,l.rankSpacing=(a==null?void 0:a.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,de.debug("REF1:",l),await o3(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Kr.insertTitle(u,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),sv(u,d,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),wKt={getClasses:bKt,draw:xKt},Kq=(function(){var t=w(function(cn,kt,bt,Pt){for(bt=bt||{},Pt=cn.length;Pt--;bt[cn[Pt]]=kt);return bt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],s=[2,2],a=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],x=[1,31],b=[1,32],T=[1,33],C=[1,45],S=[1,47],k=[1,43],E=[1,48],A=[1,44],R=[1,51],_=[1,46],P=[1,52],N=[1,53],L=[1,34],I=[1,35],$=[1,36],O=[1,37],D=[1,38],F=[1,58],z=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],B=[1,61],H=[1,63],G=[8,9,11,75,77,78],W=[1,79],K=[1,92],q=[1,97],oe=[1,96],Q=[1,93],Z=[1,89],re=[1,95],ie=[1,91],me=[1,98],te=[1,94],_e=[1,99],$e=[1,90],Fe=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],he=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ge=[44,60,89,102,105,106,109,111,114,115,116],He=[1,122],we=[1,123],Me=[1,125],je=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],pe=[1,134],Ce=[1,148],ne=[1,149],j=[1,150],J=[1,151],ue=[1,136],X=[1,138],fe=[1,142],ee=[1,143],Ae=[1,144],Re=[1,145],Xe=[1,146],Ne=[1,147],qe=[1,152],De=[1,153],Ke=[1,132],ze=[1,133],st=[1,140],Oe=[1,135],mt=[1,139],Le=[1,137],St=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],At=[1,155],lt=[1,157],zt=[8,9,11],It=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ft=[1,177],xe=[1,173],Nt=[1,174],Tt=[1,178],yt=[1,175],Rt=[1,176],Or=[77,116,119],Ee=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],it=[10,106],gt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],xt=[1,248],nr=[1,246],$r=[1,250],Cr=[1,244],Ur=[1,245],Er=[1,247],nn=[1,249],Tr=[1,251],Yr=[1,269],wn=[8,9,11,106],ht=[8,9,10,11,60,84,105,106,109,110,111,112],vt={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:w(function(kt,bt,Pt,pt,ar,Ie,si){var Be=Ie.length-1;switch(ar){case 2:this.$=[];break;case 3:(!Array.isArray(Ie[Be])||Ie[Be].length>0)&&Ie[Be-1].push(Ie[Be]),this.$=Ie[Be-1];break;case 4:case 183:this.$=Ie[Be];break;case 11:pt.setDirection("TB"),this.$="TB";break;case 12:pt.setDirection(Ie[Be-1]),this.$=Ie[Be-1];break;case 27:this.$=Ie[Be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=pt.addSubGraph(Ie[Be-6],Ie[Be-1],Ie[Be-4]);break;case 34:this.$=pt.addSubGraph(Ie[Be-3],Ie[Be-1],Ie[Be-3]);break;case 35:this.$=pt.addSubGraph(void 0,Ie[Be-1],void 0);break;case 37:this.$=Ie[Be].trim(),pt.setAccTitle(this.$);break;case 38:case 39:this.$=Ie[Be].trim(),pt.setAccDescription(this.$);break;case 43:this.$=Ie[Be-1]+Ie[Be];break;case 44:this.$=Ie[Be];break;case 45:pt.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),pt.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 46:pt.addLink(Ie[Be-2].stmt,Ie[Be],Ie[Be-1]),this.$={stmt:Ie[Be],nodes:Ie[Be].concat(Ie[Be-2].nodes)};break;case 47:pt.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 48:this.$={stmt:Ie[Be-1],nodes:Ie[Be-1]};break;case 49:pt.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1],shapeData:Ie[Be]};break;case 50:this.$={stmt:Ie[Be],nodes:Ie[Be]};break;case 51:this.$=[Ie[Be]];break;case 52:pt.addVertex(Ie[Be-5][Ie[Be-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be-4]),this.$=Ie[Be-5].concat(Ie[Be]);break;case 53:this.$=Ie[Be-4].concat(Ie[Be]);break;case 54:this.$=Ie[Be];break;case 55:this.$=Ie[Be-2],pt.setClass(Ie[Be-2],Ie[Be]);break;case 56:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"square");break;case 57:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"doublecircle");break;case 58:this.$=Ie[Be-5],pt.addVertex(Ie[Be-5],Ie[Be-2],"circle");break;case 59:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"ellipse");break;case 60:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"stadium");break;case 61:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"subroutine");break;case 62:this.$=Ie[Be-7],pt.addVertex(Ie[Be-7],Ie[Be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ie[Be-5],Ie[Be-3]]]));break;case 63:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"cylinder");break;case 64:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"round");break;case 65:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"diamond");break;case 66:this.$=Ie[Be-5],pt.addVertex(Ie[Be-5],Ie[Be-2],"hexagon");break;case 67:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"odd");break;case 68:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"trapezoid");break;case 69:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"inv_trapezoid");break;case 70:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"lean_right");break;case 71:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"lean_left");break;case 72:this.$=Ie[Be],pt.addVertex(Ie[Be]);break;case 73:Ie[Be-1].text=Ie[Be],this.$=Ie[Be-1];break;case 74:case 75:Ie[Be-2].text=Ie[Be-1],this.$=Ie[Be-2];break;case 76:this.$=Ie[Be];break;case 77:var un=pt.destructLink(Ie[Be],Ie[Be-2]);this.$={type:un.type,stroke:un.stroke,length:un.length,text:Ie[Be-1]};break;case 78:var un=pt.destructLink(Ie[Be],Ie[Be-2]);this.$={type:un.type,stroke:un.stroke,length:un.length,text:Ie[Be-1],id:Ie[Be-3]};break;case 79:this.$={text:Ie[Be],type:"text"};break;case 80:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 81:this.$={text:Ie[Be],type:"string"};break;case 82:this.$={text:Ie[Be],type:"markdown"};break;case 83:var un=pt.destructLink(Ie[Be]);this.$={type:un.type,stroke:un.stroke,length:un.length};break;case 84:var un=pt.destructLink(Ie[Be]);this.$={type:un.type,stroke:un.stroke,length:un.length,id:Ie[Be-1]};break;case 85:this.$=Ie[Be-1];break;case 86:this.$={text:Ie[Be],type:"text"};break;case 87:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 88:this.$={text:Ie[Be],type:"string"};break;case 89:case 104:this.$={text:Ie[Be],type:"markdown"};break;case 101:this.$={text:Ie[Be],type:"text"};break;case 102:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 103:this.$={text:Ie[Be],type:"text"};break;case 105:this.$=Ie[Be-4],pt.addClass(Ie[Be-2],Ie[Be]);break;case 106:this.$=Ie[Be-4],pt.setClass(Ie[Be-2],Ie[Be]);break;case 107:case 115:this.$=Ie[Be-1],pt.setClickEvent(Ie[Be-1],Ie[Be]);break;case 108:case 116:this.$=Ie[Be-3],pt.setClickEvent(Ie[Be-3],Ie[Be-2]),pt.setTooltip(Ie[Be-3],Ie[Be]);break;case 109:this.$=Ie[Be-2],pt.setClickEvent(Ie[Be-2],Ie[Be-1],Ie[Be]);break;case 110:this.$=Ie[Be-4],pt.setClickEvent(Ie[Be-4],Ie[Be-3],Ie[Be-2]),pt.setTooltip(Ie[Be-4],Ie[Be]);break;case 111:this.$=Ie[Be-2],pt.setLink(Ie[Be-2],Ie[Be]);break;case 112:this.$=Ie[Be-4],pt.setLink(Ie[Be-4],Ie[Be-2]),pt.setTooltip(Ie[Be-4],Ie[Be]);break;case 113:this.$=Ie[Be-4],pt.setLink(Ie[Be-4],Ie[Be-2],Ie[Be]);break;case 114:this.$=Ie[Be-6],pt.setLink(Ie[Be-6],Ie[Be-4],Ie[Be]),pt.setTooltip(Ie[Be-6],Ie[Be-2]);break;case 117:this.$=Ie[Be-1],pt.setLink(Ie[Be-1],Ie[Be]);break;case 118:this.$=Ie[Be-3],pt.setLink(Ie[Be-3],Ie[Be-2]),pt.setTooltip(Ie[Be-3],Ie[Be]);break;case 119:this.$=Ie[Be-3],pt.setLink(Ie[Be-3],Ie[Be-2],Ie[Be]);break;case 120:this.$=Ie[Be-5],pt.setLink(Ie[Be-5],Ie[Be-4],Ie[Be]),pt.setTooltip(Ie[Be-5],Ie[Be-2]);break;case 121:this.$=Ie[Be-4],pt.addVertex(Ie[Be-2],void 0,void 0,Ie[Be]);break;case 122:this.$=Ie[Be-4],pt.updateLink([Ie[Be-2]],Ie[Be]);break;case 123:this.$=Ie[Be-4],pt.updateLink(Ie[Be-2],Ie[Be]);break;case 124:this.$=Ie[Be-8],pt.updateLinkInterpolate([Ie[Be-6]],Ie[Be-2]),pt.updateLink([Ie[Be-6]],Ie[Be]);break;case 125:this.$=Ie[Be-8],pt.updateLinkInterpolate(Ie[Be-6],Ie[Be-2]),pt.updateLink(Ie[Be-6],Ie[Be]);break;case 126:this.$=Ie[Be-6],pt.updateLinkInterpolate([Ie[Be-4]],Ie[Be]);break;case 127:this.$=Ie[Be-6],pt.updateLinkInterpolate(Ie[Be-4],Ie[Be]);break;case 128:case 130:this.$=[Ie[Be]];break;case 129:case 131:Ie[Be-2].push(Ie[Be]),this.$=Ie[Be-2];break;case 133:this.$=Ie[Be-1]+Ie[Be];break;case 181:this.$=Ie[Be];break;case 182:this.$=Ie[Be-1]+""+Ie[Be];break;case 184:this.$=Ie[Be-1]+""+Ie[Be];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,s,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),{8:V,9:B,11:H,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:B,11:H,21:68},{8:V,9:B,11:H,21:69},{8:V,9:B,11:H,21:70},{8:V,9:B,11:H,21:71},{8:V,9:B,11:H,21:72},{8:V,9:B,10:[1,73],11:H,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(G,[2,50],{18:77,39:78,10:F,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:K,44:q,60:oe,80:[1,87],89:Q,95:[1,84],97:[1,85],101:86,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(Fe,[2,51]),t(Fe,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:S,105:k,106:E,109:A,111:R,114:_,115:P,116:N}),t(he,[2,181]),t(he,[2,142]),t(he,[2,143]),t(he,[2,144]),t(he,[2,145]),t(he,[2,146]),t(he,[2,147]),t(he,[2,148]),t(he,[2,149]),t(he,[2,150]),t(he,[2,151]),t(he,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Te,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:He,81:we,116:Me,119:je},{75:[1,126],77:[1,127]},t(le,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:pe,12:Ce,14:ne,27:j,28:128,32:J,44:ue,60:X,75:fe,80:[1,130],81:[1,131],83:141,84:ee,85:Ae,86:Re,87:Xe,88:Ne,89:qe,90:De,91:129,105:Ke,109:ze,111:st,114:Oe,115:mt,116:Le},t(St,s,{5:154}),t(z,[2,37]),t(z,[2,38]),t(G,[2,48],{44:At}),t(G,[2,49],{18:156,10:F,40:lt}),t(Fe,[2,44]),{44:g,47:158,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{44:g,47:163,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(zt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(zt,[2,115],{120:168,10:[1,167],14:K,44:q,60:oe,89:Q,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e}),t(zt,[2,117],{10:[1,169]}),t(It,[2,183]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),t(It,[2,179]),t(It,[2,180]),{44:g,47:170,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{30:171,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:179,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:181,50:[1,180],67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:182,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:183,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:184,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{109:[1,185]},{30:186,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:187,65:[1,188],67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:189,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:190,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:191,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},t(he,[2,182]),t(i,[2,20]),t(Te,[2,25]),t(G,[2,46],{39:192,18:193,10:F,40:W}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{77:[1,197],79:198,116:Me,119:je},t(Or,[2,79]),t(Or,[2,81]),t(Or,[2,82]),t(Or,[2,168]),t(Or,[2,169]),{76:199,79:121,80:He,81:we,116:Me,119:je},t(le,[2,84]),{8:V,9:B,10:pe,11:H,12:Ce,14:ne,21:201,27:j,29:[1,200],32:J,44:ue,60:X,75:fe,83:141,84:ee,85:Ae,86:Re,87:Xe,88:Ne,89:qe,90:De,91:202,105:Ke,109:ze,111:st,114:Oe,115:mt,116:Le},t(Ee,[2,101]),t(Ee,[2,103]),t(Ee,[2,104]),t(Ee,[2,157]),t(Ee,[2,158]),t(Ee,[2,159]),t(Ee,[2,160]),t(Ee,[2,161]),t(Ee,[2,162]),t(Ee,[2,163]),t(Ee,[2,164]),t(Ee,[2,165]),t(Ee,[2,166]),t(Ee,[2,167]),t(Ee,[2,90]),t(Ee,[2,91]),t(Ee,[2,92]),t(Ee,[2,93]),t(Ee,[2,94]),t(Ee,[2,95]),t(Ee,[2,96]),t(Ee,[2,97]),t(Ee,[2,98]),t(Ee,[2,99]),t(Ee,[2,100]),{6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},{10:F,18:204},{44:[1,205]},t(Fe,[2,43]),{10:[1,206],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:113,114:_,115:P,116:N},{10:[1,207]},{10:[1,208],106:[1,209]},t(it,[2,128]),{10:[1,210],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:113,114:_,115:P,116:N},{10:[1,211],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:113,114:_,115:P,116:N},{80:[1,212]},t(zt,[2,109],{10:[1,213]}),t(zt,[2,111],{10:[1,214]}),{80:[1,215]},t(It,[2,184]),{80:[1,216],98:[1,217]},t(Fe,[2,55],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,114:_,115:P,116:N}),{31:[1,218],67:ft,82:219,116:Tt,117:yt,118:Rt},t(gt,[2,86]),t(gt,[2,88]),t(gt,[2,89]),t(gt,[2,153]),t(gt,[2,154]),t(gt,[2,155]),t(gt,[2,156]),{49:[1,220],67:ft,82:219,116:Tt,117:yt,118:Rt},{30:221,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{51:[1,222],67:ft,82:219,116:Tt,117:yt,118:Rt},{53:[1,223],67:ft,82:219,116:Tt,117:yt,118:Rt},{55:[1,224],67:ft,82:219,116:Tt,117:yt,118:Rt},{57:[1,225],67:ft,82:219,116:Tt,117:yt,118:Rt},{60:[1,226]},{64:[1,227],67:ft,82:219,116:Tt,117:yt,118:Rt},{66:[1,228],67:ft,82:219,116:Tt,117:yt,118:Rt},{30:229,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{31:[1,230],67:ft,82:219,116:Tt,117:yt,118:Rt},{67:ft,69:[1,231],71:[1,232],82:219,116:Tt,117:yt,118:Rt},{67:ft,69:[1,234],71:[1,233],82:219,116:Tt,117:yt,118:Rt},t(G,[2,45],{18:156,10:F,40:lt}),t(G,[2,47],{44:At}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:ft,82:219,116:Tt,117:yt,118:Rt},t(ge,[2,77]),t(Or,[2,80]),{77:[1,236],79:198,116:Me,119:je},{30:237,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},t(St,s,{5:238}),t(Ee,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{10:F,18:240},{10:xt,60:nr,84:$r,92:241,105:Cr,107:242,108:243,109:Ur,110:Er,111:nn,112:Tr},{10:xt,60:nr,84:$r,92:252,104:[1,253],105:Cr,107:242,108:243,109:Ur,110:Er,111:nn,112:Tr},{10:xt,60:nr,84:$r,92:254,104:[1,255],105:Cr,107:242,108:243,109:Ur,110:Er,111:nn,112:Tr},{105:[1,256]},{10:xt,60:nr,84:$r,92:257,105:Cr,107:242,108:243,109:Ur,110:Er,111:nn,112:Tr},{44:g,47:258,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(zt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(zt,[2,116]),t(zt,[2,118],{10:[1,262]}),t(zt,[2,119]),t(ce,[2,56]),t(gt,[2,87]),t(ce,[2,57]),{51:[1,263],67:ft,82:219,116:Tt,117:yt,118:Rt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:ft,82:219,116:Tt,117:yt,118:Rt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:ft,82:219,116:Tt,117:yt,118:Rt},{6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},t(Fe,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(zt,[2,121],{106:Yr}),t(wn,[2,130],{108:270,10:xt,60:nr,84:$r,105:Cr,109:Ur,110:Er,111:nn,112:Tr}),t(ht,[2,132]),t(ht,[2,134]),t(ht,[2,135]),t(ht,[2,136]),t(ht,[2,137]),t(ht,[2,138]),t(ht,[2,139]),t(ht,[2,140]),t(ht,[2,141]),t(zt,[2,122],{106:Yr}),{10:[1,271]},t(zt,[2,123],{106:Yr}),{10:[1,272]},t(it,[2,129]),t(zt,[2,105],{106:Yr}),t(zt,[2,106],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,114:_,115:P,116:N}),t(zt,[2,110]),t(zt,[2,112],{10:[1,273]}),t(zt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:B,11:H,21:278},t(z,[2,34]),t(Fe,[2,52]),{10:xt,60:nr,84:$r,105:Cr,107:279,108:243,109:Ur,110:Er,111:nn,112:Tr},t(ht,[2,133]),{14:K,44:q,60:oe,89:Q,101:280,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e,120:88},{14:K,44:q,60:oe,89:Q,101:281,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e,120:88},{98:[1,282]},t(zt,[2,120]),t(ce,[2,58]),{30:283,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},t(ce,[2,66]),t(St,s,{5:284}),t(wn,[2,131],{108:270,10:xt,60:nr,84:$r,105:Cr,109:Ur,110:Er,111:nn,112:Tr}),t(zt,[2,126],{120:168,10:[1,285],14:K,44:q,60:oe,89:Q,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e}),t(zt,[2,127],{120:168,10:[1,286],14:K,44:q,60:oe,89:Q,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e}),t(zt,[2,114]),{31:[1,287],67:ft,82:219,116:Tt,117:yt,118:Rt},{6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},{10:xt,60:nr,84:$r,92:289,105:Cr,107:242,108:243,109:Ur,110:Er,111:nn,112:Tr},{10:xt,60:nr,84:$r,92:290,105:Cr,107:242,108:243,109:Ur,110:Er,111:nn,112:Tr},t(ce,[2,62]),t(z,[2,33]),t(zt,[2,124],{106:Yr}),t(zt,[2,125],{106:Yr})],defaultActions:{},parseError:w(function(kt,bt){if(bt.recoverable)this.trace(kt);else{var Pt=new Error(kt);throw Pt.hash=bt,Pt}},"parseError"),parse:w(function(kt){var bt=this,Pt=[0],pt=[],ar=[null],Ie=[],si=this.table,Be="",un=0,En=0,gs=2,mn=1,mi=Ie.slice.call(arguments,1),An=Object.create(this.lexer),Lo={yy:{}};for(var Bu in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bu)&&(Lo.yy[Bu]=this.yy[Bu]);An.setInput(kt,Lo.yy),Lo.yy.lexer=An,Lo.yy.parser=this,typeof An.yylloc>"u"&&(An.yylloc={});var Ph=An.yylloc;Ie.push(Ph);var pm=An.options&&An.options.ranges;typeof Lo.yy.parseError=="function"?this.parseError=Lo.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gm(jt){Pt.length=Pt.length-2*jt,ar.length=ar.length-jt,Ie.length=Ie.length-jt}w(gm,"popStack");function mm(){var jt;return jt=pt.pop()||An.lex()||mn,typeof jt!="number"&&(jt instanceof Array&&(pt=jt,jt=pt.pop()),jt=bt.symbols_[jt]||jt),jt}w(mm,"lex");for(var ga,Gl,ao,Js,xc={},ep,$t,Pe,nt;;){if(Gl=Pt[Pt.length-1],this.defaultActions[Gl]?ao=this.defaultActions[Gl]:((ga===null||typeof ga>"u")&&(ga=mm()),ao=si[Gl]&&si[Gl][ga]),typeof ao>"u"||!ao.length||!ao[0]){var _t="";nt=[];for(ep in si[Gl])this.terminals_[ep]&&ep>gs&&nt.push("'"+this.terminals_[ep]+"'");An.showPosition?_t="Parse error on line "+(un+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;de.info("addLink",e,r,i);for(const s of e)for(const a of r){const o=s===e[e.length-1],l=a===r[0];o&&l?this.addSingleLink(s,a,n,i):this.addSingleLink(s,a,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,s,a,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((s=(i=this.edges[n])==null?void 0:i.style)==null?void 0:s.length)??0)>0&&!((o=(a=this.edges[n])==null?void 0:a.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let s=this.classes.get(i);s===void 0&&(s={id:i,styles:[],textStyles:[]},this.classes.set(i,s)),n!=null&&n.forEach(a=>{if(/color/.exec(a)){const o=a.replace("fill","bgFill");s.textStyles.push(o)}s.styles.push(a)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const s=this.edges.find(o=>o.id===n);s&&s.classes.push(r);const a=this.subGraphLookup.get(n);a&&a.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Ve().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{const a=this.lookUpDomId(e),o=document.querySelector(`[id="${a}"]`);o!==null&&o.addEventListener("click",()=>{Kr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const s=this.vertices.get(i);s!==void 0&&(s.link=Kr.formatUrl(r,this.config),s.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=fee();wt(e).select("svg").selectAll("g.node").on("mouseover",s=>{var u;const a=wt(s.currentTarget),o=a.attr("title");if(o===null)return;const l=(u=s.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(a.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(h0.sanitize(o)),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),wt(s.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Ve(),Ri()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),s=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=w(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const T=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:T in m?m[T].hasOwnProperty(b)?!1:m[T][b]=!0:y.includes(b)?!1:y.push(b)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=Ve().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Ve().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,s=1;for(;i=0){const o=this.indexNodes2(e,a);if(o.result)return{result:!0,count:s+o.count};s=s+o.count}i=i+1}return{result:!1,count:s}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let s=0;s":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let s="normal",a=n.length-1;n.startsWith("=")&&(s="thick"),n.startsWith("~")&&(s="invisible");const o=this.countChar(".",n);return o&&(s="dotted",a=o),{type:i,stroke:s,length:a}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,s)=>{this.exists(r,i)||n.push(e.nodes[s])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,s,a){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=s.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(s=>s.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(s=>s.trim()))}return r}getData(){const e=Ve(),r=[],n=[],i=this.getSubGraphs(),s=new Map,a=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&a.set(h.id,!0);for(const d of h.nodes)s.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:s.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,s,a,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:_b(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return yTe.flowchart}},w(dx,"FlowDB"),dx),OKt=w(function(t,e){return e.db.getClasses()},"getClasses"),PKt=w(async function(t,e,r,n,i){var f;de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:s,flowchart:a,layout:o}=Ve();n.db.setDiagramId(e),de.debug("Before getData: ");const l=n.db.getData();de.debug("Data: ",l);const u=M3(e,s),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=a7(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&de.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,l.rankSpacing=(a==null?void 0:a.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,de.debug("REF1:",l),await u3(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Kr.insertTitle(u,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),ov(u,d,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),$Kt={getClasses:OKt,draw:PKt},eU=(function(){var t=w(function(cn,kt,bt,Pt){for(bt=bt||{},Pt=cn.length;Pt--;bt[cn[Pt]]=kt);return bt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],s=[2,2],a=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],x=[1,31],b=[1,32],T=[1,33],C=[1,45],S=[1,47],k=[1,43],E=[1,48],A=[1,44],R=[1,51],_=[1,46],P=[1,52],N=[1,53],L=[1,34],I=[1,35],$=[1,36],O=[1,37],D=[1,38],F=[1,58],z=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],B=[1,61],H=[1,63],G=[8,9,11,75,77,78],W=[1,79],K=[1,92],q=[1,97],oe=[1,96],Q=[1,93],Z=[1,89],re=[1,95],ie=[1,91],me=[1,98],te=[1,94],_e=[1,99],$e=[1,90],Fe=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],he=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ge=[44,60,89,102,105,106,109,111,114,115,116],He=[1,122],we=[1,123],Me=[1,125],je=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],pe=[1,134],Ce=[1,148],ne=[1,149],j=[1,150],J=[1,151],ue=[1,136],X=[1,138],fe=[1,142],ee=[1,143],Ae=[1,144],Re=[1,145],Xe=[1,146],Ne=[1,147],qe=[1,152],De=[1,153],Ke=[1,132],ze=[1,133],st=[1,140],Oe=[1,135],mt=[1,139],Le=[1,137],St=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],At=[1,155],lt=[1,157],zt=[8,9,11],It=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ft=[1,177],xe=[1,173],Nt=[1,174],Tt=[1,178],yt=[1,175],Rt=[1,176],Or=[77,116,119],Ee=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],it=[10,106],gt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],xt=[1,248],nr=[1,246],$r=[1,250],kr=[1,244],Ur=[1,245],Er=[1,247],nn=[1,249],Cr=[1,251],Yr=[1,269],wn=[8,9,11,106],ht=[8,9,10,11,60,84,105,106,109,110,111,112],vt={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:w(function(kt,bt,Pt,pt,ar,Ie,ai){var Be=Ie.length-1;switch(ar){case 2:this.$=[];break;case 3:(!Array.isArray(Ie[Be])||Ie[Be].length>0)&&Ie[Be-1].push(Ie[Be]),this.$=Ie[Be-1];break;case 4:case 183:this.$=Ie[Be];break;case 11:pt.setDirection("TB"),this.$="TB";break;case 12:pt.setDirection(Ie[Be-1]),this.$=Ie[Be-1];break;case 27:this.$=Ie[Be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=pt.addSubGraph(Ie[Be-6],Ie[Be-1],Ie[Be-4]);break;case 34:this.$=pt.addSubGraph(Ie[Be-3],Ie[Be-1],Ie[Be-3]);break;case 35:this.$=pt.addSubGraph(void 0,Ie[Be-1],void 0);break;case 37:this.$=Ie[Be].trim(),pt.setAccTitle(this.$);break;case 38:case 39:this.$=Ie[Be].trim(),pt.setAccDescription(this.$);break;case 43:this.$=Ie[Be-1]+Ie[Be];break;case 44:this.$=Ie[Be];break;case 45:pt.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),pt.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 46:pt.addLink(Ie[Be-2].stmt,Ie[Be],Ie[Be-1]),this.$={stmt:Ie[Be],nodes:Ie[Be].concat(Ie[Be-2].nodes)};break;case 47:pt.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 48:this.$={stmt:Ie[Be-1],nodes:Ie[Be-1]};break;case 49:pt.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1],shapeData:Ie[Be]};break;case 50:this.$={stmt:Ie[Be],nodes:Ie[Be]};break;case 51:this.$=[Ie[Be]];break;case 52:pt.addVertex(Ie[Be-5][Ie[Be-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be-4]),this.$=Ie[Be-5].concat(Ie[Be]);break;case 53:this.$=Ie[Be-4].concat(Ie[Be]);break;case 54:this.$=Ie[Be];break;case 55:this.$=Ie[Be-2],pt.setClass(Ie[Be-2],Ie[Be]);break;case 56:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"square");break;case 57:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"doublecircle");break;case 58:this.$=Ie[Be-5],pt.addVertex(Ie[Be-5],Ie[Be-2],"circle");break;case 59:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"ellipse");break;case 60:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"stadium");break;case 61:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"subroutine");break;case 62:this.$=Ie[Be-7],pt.addVertex(Ie[Be-7],Ie[Be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ie[Be-5],Ie[Be-3]]]));break;case 63:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"cylinder");break;case 64:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"round");break;case 65:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"diamond");break;case 66:this.$=Ie[Be-5],pt.addVertex(Ie[Be-5],Ie[Be-2],"hexagon");break;case 67:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"odd");break;case 68:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"trapezoid");break;case 69:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"inv_trapezoid");break;case 70:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"lean_right");break;case 71:this.$=Ie[Be-3],pt.addVertex(Ie[Be-3],Ie[Be-1],"lean_left");break;case 72:this.$=Ie[Be],pt.addVertex(Ie[Be]);break;case 73:Ie[Be-1].text=Ie[Be],this.$=Ie[Be-1];break;case 74:case 75:Ie[Be-2].text=Ie[Be-1],this.$=Ie[Be-2];break;case 76:this.$=Ie[Be];break;case 77:var un=pt.destructLink(Ie[Be],Ie[Be-2]);this.$={type:un.type,stroke:un.stroke,length:un.length,text:Ie[Be-1]};break;case 78:var un=pt.destructLink(Ie[Be],Ie[Be-2]);this.$={type:un.type,stroke:un.stroke,length:un.length,text:Ie[Be-1],id:Ie[Be-3]};break;case 79:this.$={text:Ie[Be],type:"text"};break;case 80:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 81:this.$={text:Ie[Be],type:"string"};break;case 82:this.$={text:Ie[Be],type:"markdown"};break;case 83:var un=pt.destructLink(Ie[Be]);this.$={type:un.type,stroke:un.stroke,length:un.length};break;case 84:var un=pt.destructLink(Ie[Be]);this.$={type:un.type,stroke:un.stroke,length:un.length,id:Ie[Be-1]};break;case 85:this.$=Ie[Be-1];break;case 86:this.$={text:Ie[Be],type:"text"};break;case 87:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 88:this.$={text:Ie[Be],type:"string"};break;case 89:case 104:this.$={text:Ie[Be],type:"markdown"};break;case 101:this.$={text:Ie[Be],type:"text"};break;case 102:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 103:this.$={text:Ie[Be],type:"text"};break;case 105:this.$=Ie[Be-4],pt.addClass(Ie[Be-2],Ie[Be]);break;case 106:this.$=Ie[Be-4],pt.setClass(Ie[Be-2],Ie[Be]);break;case 107:case 115:this.$=Ie[Be-1],pt.setClickEvent(Ie[Be-1],Ie[Be]);break;case 108:case 116:this.$=Ie[Be-3],pt.setClickEvent(Ie[Be-3],Ie[Be-2]),pt.setTooltip(Ie[Be-3],Ie[Be]);break;case 109:this.$=Ie[Be-2],pt.setClickEvent(Ie[Be-2],Ie[Be-1],Ie[Be]);break;case 110:this.$=Ie[Be-4],pt.setClickEvent(Ie[Be-4],Ie[Be-3],Ie[Be-2]),pt.setTooltip(Ie[Be-4],Ie[Be]);break;case 111:this.$=Ie[Be-2],pt.setLink(Ie[Be-2],Ie[Be]);break;case 112:this.$=Ie[Be-4],pt.setLink(Ie[Be-4],Ie[Be-2]),pt.setTooltip(Ie[Be-4],Ie[Be]);break;case 113:this.$=Ie[Be-4],pt.setLink(Ie[Be-4],Ie[Be-2],Ie[Be]);break;case 114:this.$=Ie[Be-6],pt.setLink(Ie[Be-6],Ie[Be-4],Ie[Be]),pt.setTooltip(Ie[Be-6],Ie[Be-2]);break;case 117:this.$=Ie[Be-1],pt.setLink(Ie[Be-1],Ie[Be]);break;case 118:this.$=Ie[Be-3],pt.setLink(Ie[Be-3],Ie[Be-2]),pt.setTooltip(Ie[Be-3],Ie[Be]);break;case 119:this.$=Ie[Be-3],pt.setLink(Ie[Be-3],Ie[Be-2],Ie[Be]);break;case 120:this.$=Ie[Be-5],pt.setLink(Ie[Be-5],Ie[Be-4],Ie[Be]),pt.setTooltip(Ie[Be-5],Ie[Be-2]);break;case 121:this.$=Ie[Be-4],pt.addVertex(Ie[Be-2],void 0,void 0,Ie[Be]);break;case 122:this.$=Ie[Be-4],pt.updateLink([Ie[Be-2]],Ie[Be]);break;case 123:this.$=Ie[Be-4],pt.updateLink(Ie[Be-2],Ie[Be]);break;case 124:this.$=Ie[Be-8],pt.updateLinkInterpolate([Ie[Be-6]],Ie[Be-2]),pt.updateLink([Ie[Be-6]],Ie[Be]);break;case 125:this.$=Ie[Be-8],pt.updateLinkInterpolate(Ie[Be-6],Ie[Be-2]),pt.updateLink(Ie[Be-6],Ie[Be]);break;case 126:this.$=Ie[Be-6],pt.updateLinkInterpolate([Ie[Be-4]],Ie[Be]);break;case 127:this.$=Ie[Be-6],pt.updateLinkInterpolate(Ie[Be-4],Ie[Be]);break;case 128:case 130:this.$=[Ie[Be]];break;case 129:case 131:Ie[Be-2].push(Ie[Be]),this.$=Ie[Be-2];break;case 133:this.$=Ie[Be-1]+Ie[Be];break;case 181:this.$=Ie[Be];break;case 182:this.$=Ie[Be-1]+""+Ie[Be];break;case 184:this.$=Ie[Be-1]+""+Ie[Be];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,s,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),{8:V,9:B,11:H,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:B,11:H,21:68},{8:V,9:B,11:H,21:69},{8:V,9:B,11:H,21:70},{8:V,9:B,11:H,21:71},{8:V,9:B,11:H,21:72},{8:V,9:B,10:[1,73],11:H,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(G,[2,50],{18:77,39:78,10:F,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:K,44:q,60:oe,80:[1,87],89:Q,95:[1,84],97:[1,85],101:86,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(Fe,[2,51]),t(Fe,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:S,105:k,106:E,109:A,111:R,114:_,115:P,116:N}),t(he,[2,181]),t(he,[2,142]),t(he,[2,143]),t(he,[2,144]),t(he,[2,145]),t(he,[2,146]),t(he,[2,147]),t(he,[2,148]),t(he,[2,149]),t(he,[2,150]),t(he,[2,151]),t(he,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Te,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:He,81:we,116:Me,119:je},{75:[1,126],77:[1,127]},t(le,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:pe,12:Ce,14:ne,27:j,28:128,32:J,44:ue,60:X,75:fe,80:[1,130],81:[1,131],83:141,84:ee,85:Ae,86:Re,87:Xe,88:Ne,89:qe,90:De,91:129,105:Ke,109:ze,111:st,114:Oe,115:mt,116:Le},t(St,s,{5:154}),t(z,[2,37]),t(z,[2,38]),t(G,[2,48],{44:At}),t(G,[2,49],{18:156,10:F,40:lt}),t(Fe,[2,44]),{44:g,47:158,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{44:g,47:163,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(zt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(zt,[2,115],{120:168,10:[1,167],14:K,44:q,60:oe,89:Q,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e}),t(zt,[2,117],{10:[1,169]}),t(It,[2,183]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),t(It,[2,179]),t(It,[2,180]),{44:g,47:170,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{30:171,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:179,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:181,50:[1,180],67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:182,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:183,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:184,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{109:[1,185]},{30:186,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:187,65:[1,188],67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:189,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:190,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{30:191,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},t(he,[2,182]),t(i,[2,20]),t(Te,[2,25]),t(G,[2,46],{39:192,18:193,10:F,40:W}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{77:[1,197],79:198,116:Me,119:je},t(Or,[2,79]),t(Or,[2,81]),t(Or,[2,82]),t(Or,[2,168]),t(Or,[2,169]),{76:199,79:121,80:He,81:we,116:Me,119:je},t(le,[2,84]),{8:V,9:B,10:pe,11:H,12:Ce,14:ne,21:201,27:j,29:[1,200],32:J,44:ue,60:X,75:fe,83:141,84:ee,85:Ae,86:Re,87:Xe,88:Ne,89:qe,90:De,91:202,105:Ke,109:ze,111:st,114:Oe,115:mt,116:Le},t(Ee,[2,101]),t(Ee,[2,103]),t(Ee,[2,104]),t(Ee,[2,157]),t(Ee,[2,158]),t(Ee,[2,159]),t(Ee,[2,160]),t(Ee,[2,161]),t(Ee,[2,162]),t(Ee,[2,163]),t(Ee,[2,164]),t(Ee,[2,165]),t(Ee,[2,166]),t(Ee,[2,167]),t(Ee,[2,90]),t(Ee,[2,91]),t(Ee,[2,92]),t(Ee,[2,93]),t(Ee,[2,94]),t(Ee,[2,95]),t(Ee,[2,96]),t(Ee,[2,97]),t(Ee,[2,98]),t(Ee,[2,99]),t(Ee,[2,100]),{6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},{10:F,18:204},{44:[1,205]},t(Fe,[2,43]),{10:[1,206],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:113,114:_,115:P,116:N},{10:[1,207]},{10:[1,208],106:[1,209]},t(it,[2,128]),{10:[1,210],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:113,114:_,115:P,116:N},{10:[1,211],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:113,114:_,115:P,116:N},{80:[1,212]},t(zt,[2,109],{10:[1,213]}),t(zt,[2,111],{10:[1,214]}),{80:[1,215]},t(It,[2,184]),{80:[1,216],98:[1,217]},t(Fe,[2,55],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,114:_,115:P,116:N}),{31:[1,218],67:ft,82:219,116:Tt,117:yt,118:Rt},t(gt,[2,86]),t(gt,[2,88]),t(gt,[2,89]),t(gt,[2,153]),t(gt,[2,154]),t(gt,[2,155]),t(gt,[2,156]),{49:[1,220],67:ft,82:219,116:Tt,117:yt,118:Rt},{30:221,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{51:[1,222],67:ft,82:219,116:Tt,117:yt,118:Rt},{53:[1,223],67:ft,82:219,116:Tt,117:yt,118:Rt},{55:[1,224],67:ft,82:219,116:Tt,117:yt,118:Rt},{57:[1,225],67:ft,82:219,116:Tt,117:yt,118:Rt},{60:[1,226]},{64:[1,227],67:ft,82:219,116:Tt,117:yt,118:Rt},{66:[1,228],67:ft,82:219,116:Tt,117:yt,118:Rt},{30:229,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},{31:[1,230],67:ft,82:219,116:Tt,117:yt,118:Rt},{67:ft,69:[1,231],71:[1,232],82:219,116:Tt,117:yt,118:Rt},{67:ft,69:[1,234],71:[1,233],82:219,116:Tt,117:yt,118:Rt},t(G,[2,45],{18:156,10:F,40:lt}),t(G,[2,47],{44:At}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:ft,82:219,116:Tt,117:yt,118:Rt},t(ge,[2,77]),t(Or,[2,80]),{77:[1,236],79:198,116:Me,119:je},{30:237,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},t(St,s,{5:238}),t(Ee,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},{10:F,18:240},{10:xt,60:nr,84:$r,92:241,105:kr,107:242,108:243,109:Ur,110:Er,111:nn,112:Cr},{10:xt,60:nr,84:$r,92:252,104:[1,253],105:kr,107:242,108:243,109:Ur,110:Er,111:nn,112:Cr},{10:xt,60:nr,84:$r,92:254,104:[1,255],105:kr,107:242,108:243,109:Ur,110:Er,111:nn,112:Cr},{105:[1,256]},{10:xt,60:nr,84:$r,92:257,105:kr,107:242,108:243,109:Ur,110:Er,111:nn,112:Cr},{44:g,47:258,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(zt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(zt,[2,116]),t(zt,[2,118],{10:[1,262]}),t(zt,[2,119]),t(ce,[2,56]),t(gt,[2,87]),t(ce,[2,57]),{51:[1,263],67:ft,82:219,116:Tt,117:yt,118:Rt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:ft,82:219,116:Tt,117:yt,118:Rt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:ft,82:219,116:Tt,117:yt,118:Rt},{6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},t(Fe,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N},t(zt,[2,121],{106:Yr}),t(wn,[2,130],{108:270,10:xt,60:nr,84:$r,105:kr,109:Ur,110:Er,111:nn,112:Cr}),t(ht,[2,132]),t(ht,[2,134]),t(ht,[2,135]),t(ht,[2,136]),t(ht,[2,137]),t(ht,[2,138]),t(ht,[2,139]),t(ht,[2,140]),t(ht,[2,141]),t(zt,[2,122],{106:Yr}),{10:[1,271]},t(zt,[2,123],{106:Yr}),{10:[1,272]},t(it,[2,129]),t(zt,[2,105],{106:Yr}),t(zt,[2,106],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:R,114:_,115:P,116:N}),t(zt,[2,110]),t(zt,[2,112],{10:[1,273]}),t(zt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:B,11:H,21:278},t(z,[2,34]),t(Fe,[2,52]),{10:xt,60:nr,84:$r,105:kr,107:279,108:243,109:Ur,110:Er,111:nn,112:Cr},t(ht,[2,133]),{14:K,44:q,60:oe,89:Q,101:280,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e,120:88},{14:K,44:q,60:oe,89:Q,101:281,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e,120:88},{98:[1,282]},t(zt,[2,120]),t(ce,[2,58]),{30:283,67:ft,80:xe,81:Nt,82:172,116:Tt,117:yt,118:Rt},t(ce,[2,66]),t(St,s,{5:284}),t(wn,[2,131],{108:270,10:xt,60:nr,84:$r,105:kr,109:Ur,110:Er,111:nn,112:Cr}),t(zt,[2,126],{120:168,10:[1,285],14:K,44:q,60:oe,89:Q,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e}),t(zt,[2,127],{120:168,10:[1,286],14:K,44:q,60:oe,89:Q,105:Z,106:re,109:ie,111:me,114:te,115:_e,116:$e}),t(zt,[2,114]),{31:[1,287],67:ft,82:219,116:Tt,117:yt,118:Rt},{6:11,7:12,8:a,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:x,87:b,88:T,89:C,102:S,105:k,106:E,109:A,111:R,113:42,114:_,115:P,116:N,121:L,122:I,123:$,124:O,125:D},{10:xt,60:nr,84:$r,92:289,105:kr,107:242,108:243,109:Ur,110:Er,111:nn,112:Cr},{10:xt,60:nr,84:$r,92:290,105:kr,107:242,108:243,109:Ur,110:Er,111:nn,112:Cr},t(ce,[2,62]),t(z,[2,33]),t(zt,[2,124],{106:Yr}),t(zt,[2,125],{106:Yr})],defaultActions:{},parseError:w(function(kt,bt){if(bt.recoverable)this.trace(kt);else{var Pt=new Error(kt);throw Pt.hash=bt,Pt}},"parseError"),parse:w(function(kt){var bt=this,Pt=[0],pt=[],ar=[null],Ie=[],ai=this.table,Be="",un=0,En=0,gs=2,mn=1,mi=Ie.slice.call(arguments,1),An=Object.create(this.lexer),Lo={yy:{}};for(var Vu in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Vu)&&(Lo.yy[Vu]=this.yy[Vu]);An.setInput(kt,Lo.yy),Lo.yy.lexer=An,Lo.yy.parser=this,typeof An.yylloc>"u"&&(An.yylloc={});var Fh=An.yylloc;Ie.push(Fh);var ym=An.options&&An.options.ranges;typeof Lo.yy.parseError=="function"?this.parseError=Lo.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vm(jt){Pt.length=Pt.length-2*jt,ar.length=ar.length-jt,Ie.length=Ie.length-jt}w(vm,"popStack");function bm(){var jt;return jt=pt.pop()||An.lex()||mn,typeof jt!="number"&&(jt instanceof Array&&(pt=jt,jt=pt.pop()),jt=bt.symbols_[jt]||jt),jt}w(bm,"lex");for(var ga,ql,ao,Js,Cc={},ip,$t,Pe,nt;;){if(ql=Pt[Pt.length-1],this.defaultActions[ql]?ao=this.defaultActions[ql]:((ga===null||typeof ga>"u")&&(ga=bm()),ao=ai[ql]&&ai[ql][ga]),typeof ao>"u"||!ao.length||!ao[0]){var _t="";nt=[];for(ip in ai[ql])this.terminals_[ip]&&ip>gs&&nt.push("'"+this.terminals_[ip]+"'");An.showPosition?_t="Parse error on line "+(un+1)+`: `+An.showPosition()+` -Expecting `+nt.join(", ")+", got '"+(this.terminals_[ga]||ga)+"'":_t="Parse error on line "+(un+1)+": Unexpected "+(ga==mn?"end of input":"'"+(this.terminals_[ga]||ga)+"'"),this.parseError(_t,{text:An.match,token:this.terminals_[ga]||ga,line:An.yylineno,loc:Ph,expected:nt})}if(ao[0]instanceof Array&&ao.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Gl+", token: "+ga);switch(ao[0]){case 1:Pt.push(ga),ar.push(An.yytext),Ie.push(An.yylloc),Pt.push(ao[1]),ga=null,En=An.yyleng,Be=An.yytext,un=An.yylineno,Ph=An.yylloc;break;case 2:if($t=this.productions_[ao[1]][1],xc.$=ar[ar.length-$t],xc._$={first_line:Ie[Ie.length-($t||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-($t||1)].first_column,last_column:Ie[Ie.length-1].last_column},pm&&(xc._$.range=[Ie[Ie.length-($t||1)].range[0],Ie[Ie.length-1].range[1]]),Js=this.performAction.apply(xc,[Be,En,un,Lo.yy,ao[1],ar,Ie].concat(mi)),typeof Js<"u")return Js;$t&&(Pt=Pt.slice(0,-1*$t*2),ar=ar.slice(0,-1*$t),Ie=Ie.slice(0,-1*$t)),Pt.push(this.productions_[ao[1]][0]),ar.push(xc.$),Ie.push(xc._$),Pe=si[Pt[Pt.length-2]][Pt[Pt.length-1]],Pt.push(Pe);break;case 3:return!0}}return!0},"parse")},Kt=(function(){var cn={EOF:1,parseError:w(function(bt,Pt){if(this.yy.parser)this.yy.parser.parseError(bt,Pt);else throw new Error(bt)},"parseError"),setInput:w(function(kt,bt){return this.yy=bt||this.yy||{},this._input=kt,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 kt=this._input[0];this.yytext+=kt,this.yyleng++,this.offset++,this.match+=kt,this.matched+=kt;var bt=kt.match(/(?:\r\n?|\n).*/g);return bt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),kt},"input"),unput:w(function(kt){var bt=kt.length,Pt=kt.split(/(?:\r\n?|\n)/g);this._input=kt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-bt),this.offset-=bt;var pt=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),Pt.length-1&&(this.yylineno-=Pt.length-1);var ar=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:Pt?(Pt.length===pt.length?this.yylloc.first_column:0)+pt[pt.length-Pt.length].length-Pt[0].length:this.yylloc.first_column-bt},this.options.ranges&&(this.yylloc.range=[ar[0],ar[0]+this.yyleng-bt]),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). +Expecting `+nt.join(", ")+", got '"+(this.terminals_[ga]||ga)+"'":_t="Parse error on line "+(un+1)+": Unexpected "+(ga==mn?"end of input":"'"+(this.terminals_[ga]||ga)+"'"),this.parseError(_t,{text:An.match,token:this.terminals_[ga]||ga,line:An.yylineno,loc:Fh,expected:nt})}if(ao[0]instanceof Array&&ao.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ql+", token: "+ga);switch(ao[0]){case 1:Pt.push(ga),ar.push(An.yytext),Ie.push(An.yylloc),Pt.push(ao[1]),ga=null,En=An.yyleng,Be=An.yytext,un=An.yylineno,Fh=An.yylloc;break;case 2:if($t=this.productions_[ao[1]][1],Cc.$=ar[ar.length-$t],Cc._$={first_line:Ie[Ie.length-($t||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-($t||1)].first_column,last_column:Ie[Ie.length-1].last_column},ym&&(Cc._$.range=[Ie[Ie.length-($t||1)].range[0],Ie[Ie.length-1].range[1]]),Js=this.performAction.apply(Cc,[Be,En,un,Lo.yy,ao[1],ar,Ie].concat(mi)),typeof Js<"u")return Js;$t&&(Pt=Pt.slice(0,-1*$t*2),ar=ar.slice(0,-1*$t),Ie=Ie.slice(0,-1*$t)),Pt.push(this.productions_[ao[1]][0]),ar.push(Cc.$),Ie.push(Cc._$),Pe=ai[Pt[Pt.length-2]][Pt[Pt.length-1]],Pt.push(Pe);break;case 3:return!0}}return!0},"parse")},Kt=(function(){var cn={EOF:1,parseError:w(function(bt,Pt){if(this.yy.parser)this.yy.parser.parseError(bt,Pt);else throw new Error(bt)},"parseError"),setInput:w(function(kt,bt){return this.yy=bt||this.yy||{},this._input=kt,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 kt=this._input[0];this.yytext+=kt,this.yyleng++,this.offset++,this.match+=kt,this.matched+=kt;var bt=kt.match(/(?:\r\n?|\n).*/g);return bt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),kt},"input"),unput:w(function(kt){var bt=kt.length,Pt=kt.split(/(?:\r\n?|\n)/g);this._input=kt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-bt),this.offset-=bt;var pt=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),Pt.length-1&&(this.yylineno-=Pt.length-1);var ar=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:Pt?(Pt.length===pt.length?this.yylloc.first_column:0)+pt[pt.length-Pt.length].length-Pt[0].length:this.yylloc.first_column-bt},this.options.ranges&&(this.yylloc.range=[ar[0],ar[0]+this.yyleng-bt]),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(kt){this.unput(this.match.slice(kt))},"less"),pastInput:w(function(){var kt=this.matched.substr(0,this.matched.length-this.match.length);return(kt.length>20?"...":"")+kt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var kt=this.match;return kt.length<20&&(kt+=this._input.substr(0,20-kt.length)),(kt.substr(0,20)+(kt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var kt=this.pastInput(),bt=new Array(kt.length+1).join("-");return kt+this.upcomingInput()+` `+bt+"^"},"showPosition"),test_match:w(function(kt,bt){var Pt,pt,ar;if(this.options.backtrack_lexer&&(ar={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&&(ar.yylloc.range=this.yylloc.range.slice(0))),pt=kt[0].match(/(?:\r\n?|\n).*/g),pt&&(this.yylineno+=pt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:pt?pt[pt.length-1].length-pt[pt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+kt[0].length},this.yytext+=kt[0],this.match+=kt[0],this.matches=kt,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(kt[0].length),this.matched+=kt[0],Pt=this.performAction.call(this,this.yy,this,bt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Pt)return Pt;if(this._backtrack){for(var Ie in ar)this[Ie]=ar[Ie];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var kt,bt,Pt,pt;this._more||(this.yytext="",this.match="");for(var ar=this._currentRules(),Ie=0;Iebt[0].length)){if(bt=Pt,pt=Ie,this.options.backtrack_lexer){if(kt=this.test_match(Pt,ar[Ie]),kt!==!1)return kt;if(this._backtrack){bt=!1;continue}else return!1}else if(!this.options.flex)break}return bt?(kt=this.test_match(bt,ar[pt]),kt!==!1?kt:!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 bt=this.next();return bt||this.lex()},"lex"),begin:w(function(bt){this.conditionStack.push(bt)},"begin"),popState:w(function(){var bt=this.conditionStack.length-1;return bt>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(bt){return bt=this.conditionStack.length-1-Math.abs(bt||0),bt>=0?this.conditionStack[bt]:"INITIAL"},"topState"),pushState:w(function(bt){this.begin(bt)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(bt,Pt,pt,ar){switch(pt){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"),Pt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ie=/\n\s*/g;return Pt.yytext=Pt.yytext.replace(Ie,"
    "),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 bt.lex.firstGraph()&&this.begin("dir"),12;case 36:return bt.lex.firstGraph()&&this.begin("dir"),12;case 37:return bt.lex.firstGraph()&&this.begin("dir"),12;case 38:return bt.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return cn})();vt.lexer=Kt;function Br(){this.yy={}}return w(Br,"Parser"),Br.prototype=vt,vt.Parser=Br,new Br})();Kq.parser=Kq;var pIe=Kq,gIe=Object.assign({},pIe);gIe.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return pIe.parse(e)};var TKt=gIe,CKt=w((t,e)=>{const r=yK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return dh(n,i,s,e)},"fade"),kKt=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var bt=this.next();return bt||this.lex()},"lex"),begin:w(function(bt){this.conditionStack.push(bt)},"begin"),popState:w(function(){var bt=this.conditionStack.length-1;return bt>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(bt){return bt=this.conditionStack.length-1-Math.abs(bt||0),bt>=0?this.conditionStack[bt]:"INITIAL"},"topState"),pushState:w(function(bt){this.begin(bt)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(bt,Pt,pt,ar){switch(pt){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"),Pt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ie=/\n\s*/g;return Pt.yytext=Pt.yytext.replace(Ie,"
    "),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 bt.lex.firstGraph()&&this.begin("dir"),12;case 36:return bt.lex.firstGraph()&&this.begin("dir"),12;case 37:return bt.lex.firstGraph()&&this.begin("dir"),12;case 38:return bt.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return cn})();vt.lexer=Kt;function Br(){this.yy={}}return w(Br,"Parser"),Br.prototype=vt,vt.Parser=Br,new Br})();eU.parser=eU;var xIe=eU,wIe=Object.assign({},xIe);wIe.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return xIe.parse(e)};var BKt=wIe,FKt=w((t,e)=>{const r=wK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),zKt=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3254,7 +3261,7 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[ga]||ga)+"'":_t="Parse erro /* For html labels only */ .labelBkg { - background-color: ${CKt(t.edgeLabelBackground,.5)}; + background-color: ${FKt(t.edgeLabelBackground,.5)}; // background-color: } @@ -3313,20 +3320,20 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[ga]||ga)+"'":_t="Parse erro } text-align: center; } - ${S7()} -`,"getStyles"),mIe=kKt,pee=w(({defaultLayout:t,styles:e=mIe}={})=>({parser:TKt,get db(){return new vKt},renderer:wKt,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=iTe().layout??t??r.layout;n&&$H({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,$H({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),SKt=pee();const gee=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:pee,diagram:SKt},Symbol.toStringTag,{value:"Module"}));var EKt=w(t=>`${mIe(t)} + ${M7()} +`,"getStyles"),TIe=zKt,vee=w(({defaultLayout:t,styles:e=TIe}={})=>({parser:BKt,get db(){return new DKt},renderer:$Kt,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=uTe().layout??t??r.layout;n&&VH({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,VH({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),VKt=vee();const bee=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:vee,diagram:VKt},Symbol.toStringTag,{value:"Module"}));var HKt=w(t=>`${TIe(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),AKt=EKt,MKt=pee({defaultLayout:"swimlane",styles:AKt});const RKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:MKt},Symbol.toStringTag,{value:"Module"}));var Zq=(function(){var t=w(function(_e,$e,Fe,ce){for(Fe=Fe||{},ce=_e.length;ce--;Fe[_e[ce]]=$e);return Fe},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],s=[1,13],a=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],x=[1,36],b=[1,37],T=[1,38],C=[1,39],S=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],A=[1,46],R=[1,55],_=[40,48,50,51,52,71,72],P=[1,66],N=[1,64],L=[1,61],I=[1,65],$=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],D=[66,67,68,69,70],F=[1,85],z=[1,84],V=[1,82],B=[1,83],H=[6,10,42,47],G=[6,10,13,41,42,47,48,49],W=[1,93],K=[1,92],q=[1,91],oe=[19,58],Q=[1,102],Z=[1,101],re=[19,58,61,63],ie={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:w(function($e,Fe,ce,he,Te,ge,He){var we=ge.length-1;switch(Te){case 1:break;case 2:this.$=[];break;case 3:ge[we-1].push(ge[we]),this.$=ge[we-1];break;case 4:case 5:this.$=ge[we];break;case 6:case 7:this.$=[];break;case 8:he.addEntity(ge[we-4]),he.addEntity(ge[we-2]),he.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:he.addEntity(ge[we-8]),he.addEntity(ge[we-4]),he.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),he.setClass([ge[we-8]],ge[we-6]),he.setClass([ge[we-4]],ge[we-2]);break;case 10:he.addEntity(ge[we-6]),he.addEntity(ge[we-2]),he.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),he.setClass([ge[we-6]],ge[we-4]);break;case 11:he.addEntity(ge[we-6]),he.addEntity(ge[we-4]),he.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),he.setClass([ge[we-4]],ge[we-2]);break;case 12:he.addEntity(ge[we-3]),he.addAttributes(ge[we-3],ge[we-1]);break;case 13:he.addEntity(ge[we-5]),he.addAttributes(ge[we-5],ge[we-1]),he.setClass([ge[we-5]],ge[we-3]);break;case 14:he.addEntity(ge[we-2]);break;case 15:he.addEntity(ge[we-4]),he.setClass([ge[we-4]],ge[we-2]);break;case 16:he.addEntity(ge[we]);break;case 17:he.addEntity(ge[we-2]),he.setClass([ge[we-2]],ge[we]);break;case 18:he.addEntity(ge[we-6],ge[we-4]),he.addAttributes(ge[we-6],ge[we-1]);break;case 19:he.addEntity(ge[we-8],ge[we-6]),he.addAttributes(ge[we-8],ge[we-1]),he.setClass([ge[we-8]],ge[we-3]);break;case 20:he.addEntity(ge[we-5],ge[we-3]);break;case 21:he.addEntity(ge[we-7],ge[we-5]),he.setClass([ge[we-7]],ge[we-2]);break;case 22:he.addEntity(ge[we-3],ge[we-1]);break;case 23:he.addEntity(ge[we-5],ge[we-3]),he.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),he.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),he.setAccDescription(this.$);break;case 32:he.setDirection("TB");break;case 33:he.setDirection("BT");break;case 34:he.setDirection("RL");break;case 35:he.setDirection("LR");break;case 36:this.$=ge[we-3],he.addClass(ge[we-2],ge[we-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[we]];break;case 39:case 40:this.$=ge[we-2].concat([ge[we]]);break;case 41:this.$=ge[we-2],he.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],he.addCssStyles(ge[we-2],ge[we-1]);break;case 43:this.$=[ge[we]];break;case 44:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 46:this.$=ge[we-1]+ge[we];break;case 54:case 80:case 81:this.$=ge[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[we];break;case 60:ge[we].push(ge[we-1]),this.$=ge[we];break;case 61:this.$={type:ge[we-1],name:ge[we]};break;case 62:this.$={type:ge[we-2],name:ge[we-1],keys:ge[we]};break;case 63:this.$={type:ge[we-2],name:ge[we-1],comment:ge[we]};break;case 64:this.$={type:ge[we-3],name:ge[we-2],keys:ge[we-1],comment:ge[we]};break;case 65:case 67:case 70:this.$=ge[we];break;case 66:this.$=ge[we-1]+ge[we];break;case 69:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 71:this.$=ge[we].replace(/"/g,"");break;case 72:this.$={cardA:ge[we],relType:ge[we-1],cardB:ge[we-2]};break;case 73:this.$=he.Cardinality.ZERO_OR_ONE;break;case 74:this.$=he.Cardinality.ZERO_OR_MORE;break;case 75:this.$=he.Cardinality.ONE_OR_MORE;break;case 76:this.$=he.Cardinality.ONLY_ONE;break;case 77:this.$=he.Cardinality.MD_PARENT;break;case 78:this.$=he.Identification.NON_IDENTIFYING;break;case 79:this.$=he.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:s,29:14,30:15,31:16,32:17,33:a,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:s,29:14,30:15,31:16,32:17,33:a,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:x,67:b,68:T,69:C,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:A},{16:47,40:E,41:A},{16:48,40:E,41:A},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:A},{18:51,19:[1,52],53:53,54:54,58:R},{11:56,40:d,48:g,50:m,51:y,52:v},{65:57,71:[1,58],72:[1,59]},t(_,[2,73]),t(_,[2,74]),t(_,[2,75]),t(_,[2,76]),t(_,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:N,42:L,45:62,46:63,48:I,49:$},t(O,[2,37]),t(O,[2,38]),{16:68,40:E,41:A,42:L},{13:P,38:69,41:N,42:L,45:62,46:63,48:I,49:$},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:L,66:x,67:b,68:T,69:C,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:R},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:x,67:b,68:T,69:C,70:S},t(D,[2,78]),t(D,[2,79]),{6:F,10:z,39:81,42:V,47:B},{40:[1,86],41:[1,87]},t(H,[2,43],{46:88,13:P,41:N,48:I,49:$}),t(G,[2,45]),t(G,[2,50]),t(G,[2,51]),t(G,[2,52]),t(G,[2,53]),t(e,[2,41],{42:L}),{6:F,10:z,39:89,42:V,47:B},{14:90,40:W,50:K,73:q},{16:94,40:E,41:A},{11:95,40:d,48:g,50:m,51:y,52:v},{18:96,19:[1,97],53:53,54:54,58:R},t(e,[2,12]),{19:[2,60]},t(oe,[2,61],{56:98,57:99,60:100,62:Q,63:Z}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:N,45:105,46:63,48:I,49:$},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(G,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:L},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(oe,[2,62],{57:110,61:[1,111],63:Z}),t(oe,[2,63]),t(re,[2,68]),t(oe,[2,71]),t(re,[2,70]),{18:112,19:[1,113],53:53,54:54,58:R},{16:114,40:E,41:A},t(H,[2,44],{46:88,13:P,41:N,48:I,49:$}),{14:115,40:W,50:K,73:q},{16:116,40:E,41:A},{14:117,40:W,50:K,73:q},t(e,[2,13]),t(oe,[2,64]),{60:118,62:Q},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:L}),t(e,[2,11]),{13:[1,121],42:L},t(e,[2,10]),t(re,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:R},{14:124,40:W,50:K,73:q},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:w(function($e,Fe){if(Fe.recoverable)this.trace($e);else{var ce=new Error($e);throw ce.hash=Fe,ce}},"parseError"),parse:w(function($e){var Fe=this,ce=[0],he=[],Te=[null],ge=[],He=this.table,we="",Me=0,je=0,le=2,pe=1,Ce=ge.slice.call(arguments,1),ne=Object.create(this.lexer),j={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(j.yy[J]=this.yy[J]);ne.setInput($e,j.yy),j.yy.lexer=ne,j.yy.parser=this,typeof ne.yylloc>"u"&&(ne.yylloc={});var ue=ne.yylloc;ge.push(ue);var X=ne.options&&ne.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(mt){ce.length=ce.length-2*mt,Te.length=Te.length-mt,ge.length=ge.length-mt}w(fe,"popStack");function ee(){var mt;return mt=he.pop()||ne.lex()||pe,typeof mt!="number"&&(mt instanceof Array&&(he=mt,mt=he.pop()),mt=Fe.symbols_[mt]||mt),mt}w(ee,"lex");for(var Ae,Re,Xe,Ne,qe={},De,Ke,ze,st;;){if(Re=ce[ce.length-1],this.defaultActions[Re]?Xe=this.defaultActions[Re]:((Ae===null||typeof Ae>"u")&&(Ae=ee()),Xe=He[Re]&&He[Re][Ae]),typeof Xe>"u"||!Xe.length||!Xe[0]){var Oe="";st=[];for(De in He[Re])this.terminals_[De]&&De>le&&st.push("'"+this.terminals_[De]+"'");ne.showPosition?Oe="Parse error on line "+(Me+1)+`: +`,"getStyles"),GKt=HKt,WKt=vee({defaultLayout:"swimlane",styles:GKt});const qKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:WKt},Symbol.toStringTag,{value:"Module"}));var tU=(function(){var t=w(function(_e,$e,Fe,ce){for(Fe=Fe||{},ce=_e.length;ce--;Fe[_e[ce]]=$e);return Fe},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],s=[1,13],a=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],x=[1,36],b=[1,37],T=[1,38],C=[1,39],S=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],A=[1,46],R=[1,55],_=[40,48,50,51,52,71,72],P=[1,66],N=[1,64],L=[1,61],I=[1,65],$=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],D=[66,67,68,69,70],F=[1,85],z=[1,84],V=[1,82],B=[1,83],H=[6,10,42,47],G=[6,10,13,41,42,47,48,49],W=[1,93],K=[1,92],q=[1,91],oe=[19,58],Q=[1,102],Z=[1,101],re=[19,58,61,63],ie={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:w(function($e,Fe,ce,he,Te,ge,He){var we=ge.length-1;switch(Te){case 1:break;case 2:this.$=[];break;case 3:ge[we-1].push(ge[we]),this.$=ge[we-1];break;case 4:case 5:this.$=ge[we];break;case 6:case 7:this.$=[];break;case 8:he.addEntity(ge[we-4]),he.addEntity(ge[we-2]),he.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:he.addEntity(ge[we-8]),he.addEntity(ge[we-4]),he.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),he.setClass([ge[we-8]],ge[we-6]),he.setClass([ge[we-4]],ge[we-2]);break;case 10:he.addEntity(ge[we-6]),he.addEntity(ge[we-2]),he.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),he.setClass([ge[we-6]],ge[we-4]);break;case 11:he.addEntity(ge[we-6]),he.addEntity(ge[we-4]),he.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),he.setClass([ge[we-4]],ge[we-2]);break;case 12:he.addEntity(ge[we-3]),he.addAttributes(ge[we-3],ge[we-1]);break;case 13:he.addEntity(ge[we-5]),he.addAttributes(ge[we-5],ge[we-1]),he.setClass([ge[we-5]],ge[we-3]);break;case 14:he.addEntity(ge[we-2]);break;case 15:he.addEntity(ge[we-4]),he.setClass([ge[we-4]],ge[we-2]);break;case 16:he.addEntity(ge[we]);break;case 17:he.addEntity(ge[we-2]),he.setClass([ge[we-2]],ge[we]);break;case 18:he.addEntity(ge[we-6],ge[we-4]),he.addAttributes(ge[we-6],ge[we-1]);break;case 19:he.addEntity(ge[we-8],ge[we-6]),he.addAttributes(ge[we-8],ge[we-1]),he.setClass([ge[we-8]],ge[we-3]);break;case 20:he.addEntity(ge[we-5],ge[we-3]);break;case 21:he.addEntity(ge[we-7],ge[we-5]),he.setClass([ge[we-7]],ge[we-2]);break;case 22:he.addEntity(ge[we-3],ge[we-1]);break;case 23:he.addEntity(ge[we-5],ge[we-3]),he.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),he.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),he.setAccDescription(this.$);break;case 32:he.setDirection("TB");break;case 33:he.setDirection("BT");break;case 34:he.setDirection("RL");break;case 35:he.setDirection("LR");break;case 36:this.$=ge[we-3],he.addClass(ge[we-2],ge[we-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[we]];break;case 39:case 40:this.$=ge[we-2].concat([ge[we]]);break;case 41:this.$=ge[we-2],he.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],he.addCssStyles(ge[we-2],ge[we-1]);break;case 43:this.$=[ge[we]];break;case 44:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 46:this.$=ge[we-1]+ge[we];break;case 54:case 80:case 81:this.$=ge[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[we];break;case 60:ge[we].push(ge[we-1]),this.$=ge[we];break;case 61:this.$={type:ge[we-1],name:ge[we]};break;case 62:this.$={type:ge[we-2],name:ge[we-1],keys:ge[we]};break;case 63:this.$={type:ge[we-2],name:ge[we-1],comment:ge[we]};break;case 64:this.$={type:ge[we-3],name:ge[we-2],keys:ge[we-1],comment:ge[we]};break;case 65:case 67:case 70:this.$=ge[we];break;case 66:this.$=ge[we-1]+ge[we];break;case 69:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 71:this.$=ge[we].replace(/"/g,"");break;case 72:this.$={cardA:ge[we],relType:ge[we-1],cardB:ge[we-2]};break;case 73:this.$=he.Cardinality.ZERO_OR_ONE;break;case 74:this.$=he.Cardinality.ZERO_OR_MORE;break;case 75:this.$=he.Cardinality.ONE_OR_MORE;break;case 76:this.$=he.Cardinality.ONLY_ONE;break;case 77:this.$=he.Cardinality.MD_PARENT;break;case 78:this.$=he.Identification.NON_IDENTIFYING;break;case 79:this.$=he.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:s,29:14,30:15,31:16,32:17,33:a,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:s,29:14,30:15,31:16,32:17,33:a,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:x,67:b,68:T,69:C,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:A},{16:47,40:E,41:A},{16:48,40:E,41:A},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:A},{18:51,19:[1,52],53:53,54:54,58:R},{11:56,40:d,48:g,50:m,51:y,52:v},{65:57,71:[1,58],72:[1,59]},t(_,[2,73]),t(_,[2,74]),t(_,[2,75]),t(_,[2,76]),t(_,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:N,42:L,45:62,46:63,48:I,49:$},t(O,[2,37]),t(O,[2,38]),{16:68,40:E,41:A,42:L},{13:P,38:69,41:N,42:L,45:62,46:63,48:I,49:$},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:L,66:x,67:b,68:T,69:C,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:R},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:x,67:b,68:T,69:C,70:S},t(D,[2,78]),t(D,[2,79]),{6:F,10:z,39:81,42:V,47:B},{40:[1,86],41:[1,87]},t(H,[2,43],{46:88,13:P,41:N,48:I,49:$}),t(G,[2,45]),t(G,[2,50]),t(G,[2,51]),t(G,[2,52]),t(G,[2,53]),t(e,[2,41],{42:L}),{6:F,10:z,39:89,42:V,47:B},{14:90,40:W,50:K,73:q},{16:94,40:E,41:A},{11:95,40:d,48:g,50:m,51:y,52:v},{18:96,19:[1,97],53:53,54:54,58:R},t(e,[2,12]),{19:[2,60]},t(oe,[2,61],{56:98,57:99,60:100,62:Q,63:Z}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:N,45:105,46:63,48:I,49:$},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(G,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:L},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(oe,[2,62],{57:110,61:[1,111],63:Z}),t(oe,[2,63]),t(re,[2,68]),t(oe,[2,71]),t(re,[2,70]),{18:112,19:[1,113],53:53,54:54,58:R},{16:114,40:E,41:A},t(H,[2,44],{46:88,13:P,41:N,48:I,49:$}),{14:115,40:W,50:K,73:q},{16:116,40:E,41:A},{14:117,40:W,50:K,73:q},t(e,[2,13]),t(oe,[2,64]),{60:118,62:Q},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:L}),t(e,[2,11]),{13:[1,121],42:L},t(e,[2,10]),t(re,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:R},{14:124,40:W,50:K,73:q},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:w(function($e,Fe){if(Fe.recoverable)this.trace($e);else{var ce=new Error($e);throw ce.hash=Fe,ce}},"parseError"),parse:w(function($e){var Fe=this,ce=[0],he=[],Te=[null],ge=[],He=this.table,we="",Me=0,je=0,le=2,pe=1,Ce=ge.slice.call(arguments,1),ne=Object.create(this.lexer),j={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(j.yy[J]=this.yy[J]);ne.setInput($e,j.yy),j.yy.lexer=ne,j.yy.parser=this,typeof ne.yylloc>"u"&&(ne.yylloc={});var ue=ne.yylloc;ge.push(ue);var X=ne.options&&ne.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(mt){ce.length=ce.length-2*mt,Te.length=Te.length-mt,ge.length=ge.length-mt}w(fe,"popStack");function ee(){var mt;return mt=he.pop()||ne.lex()||pe,typeof mt!="number"&&(mt instanceof Array&&(he=mt,mt=he.pop()),mt=Fe.symbols_[mt]||mt),mt}w(ee,"lex");for(var Ae,Re,Xe,Ne,qe={},De,Ke,ze,st;;){if(Re=ce[ce.length-1],this.defaultActions[Re]?Xe=this.defaultActions[Re]:((Ae===null||typeof Ae>"u")&&(Ae=ee()),Xe=He[Re]&&He[Re][Ae]),typeof Xe>"u"||!Xe.length||!Xe[0]){var Oe="";st=[];for(De in He[Re])this.terminals_[De]&&De>le&&st.push("'"+this.terminals_[De]+"'");ne.showPosition?Oe="Parse error on line "+(Me+1)+`: `+ne.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse error on line "+(Me+1)+": Unexpected "+(Ae==pe?"end of input":"'"+(this.terminals_[Ae]||Ae)+"'"),this.parseError(Oe,{text:ne.match,token:this.terminals_[Ae]||Ae,line:ne.yylineno,loc:ue,expected:st})}if(Xe[0]instanceof Array&&Xe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Re+", token: "+Ae);switch(Xe[0]){case 1:ce.push(Ae),Te.push(ne.yytext),ge.push(ne.yylloc),ce.push(Xe[1]),Ae=null,je=ne.yyleng,we=ne.yytext,Me=ne.yylineno,ue=ne.yylloc;break;case 2:if(Ke=this.productions_[Xe[1]][1],qe.$=Te[Te.length-Ke],qe._$={first_line:ge[ge.length-(Ke||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Ke||1)].first_column,last_column:ge[ge.length-1].last_column},X&&(qe._$.range=[ge[ge.length-(Ke||1)].range[0],ge[ge.length-1].range[1]]),Ne=this.performAction.apply(qe,[we,je,Me,j.yy,Xe[1],Te,ge].concat(Ce)),typeof Ne<"u")return Ne;Ke&&(ce=ce.slice(0,-1*Ke*2),Te=Te.slice(0,-1*Ke),ge=ge.slice(0,-1*Ke)),ce.push(this.productions_[Xe[1]][0]),Te.push(qe.$),ge.push(qe._$),ze=He[ce[ce.length-2]][ce[ce.length-1]],ce.push(ze);break;case 3:return!0}}return!0},"parse")},me=(function(){var _e={EOF:1,parseError:w(function(Fe,ce){if(this.yy.parser)this.yy.parser.parseError(Fe,ce);else throw new Error(Fe)},"parseError"),setInput:w(function($e,Fe){return this.yy=Fe||this.yy||{},this._input=$e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var $e=this._input[0];this.yytext+=$e,this.yyleng++,this.offset++,this.match+=$e,this.matched+=$e;var Fe=$e.match(/(?:\r\n?|\n).*/g);return Fe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$e},"input"),unput:w(function($e){var Fe=$e.length,ce=$e.split(/(?:\r\n?|\n)/g);this._input=$e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Fe),this.offset-=Fe;var he=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var Te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===he.length?this.yylloc.first_column:0)+he[he.length-ce.length].length-ce[0].length:this.yylloc.first_column-Fe},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-Fe]),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($e){this.unput(this.match.slice($e))},"less"),pastInput:w(function(){var $e=this.matched.substr(0,this.matched.length-this.match.length);return($e.length>20?"...":"")+$e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var $e=this.match;return $e.length<20&&($e+=this._input.substr(0,20-$e.length)),($e.substr(0,20)+($e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var $e=this.pastInput(),Fe=new Array($e.length+1).join("-");return $e+this.upcomingInput()+` `+Fe+"^"},"showPosition"),test_match:w(function($e,Fe){var ce,he,Te;if(this.options.backtrack_lexer&&(Te={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Te.yylloc.range=this.yylloc.range.slice(0))),he=$e[0].match(/(?:\r\n?|\n).*/g),he&&(this.yylineno+=he.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:he?he[he.length-1].length-he[he.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+$e[0].length},this.yytext+=$e[0],this.match+=$e[0],this.matches=$e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice($e[0].length),this.matched+=$e[0],ce=this.performAction.call(this,this.yy,this,Fe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var ge in Te)this[ge]=Te[ge];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var $e,Fe,ce,he;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ge=0;geFe[0].length)){if(Fe=ce,he=ge,this.options.backtrack_lexer){if($e=this.test_match(ce,Te[ge]),$e!==!1)return $e;if(this._backtrack){Fe=!1;continue}else return!1}else if(!this.options.flex)break}return Fe?($e=this.test_match(Fe,Te[he]),$e!==!1?$e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var Fe=this.next();return Fe||this.lex()},"lex"),begin:w(function(Fe){this.conditionStack.push(Fe)},"begin"),popState:w(function(){var Fe=this.conditionStack.length-1;return Fe>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(Fe){return Fe=this.conditionStack.length-1-Math.abs(Fe||0),Fe>=0?this.conditionStack[Fe]:"INITIAL"},"topState"),pushState:w(function(Fe){this.begin(Fe)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(Fe,ce,he,Te){switch(he){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return _e})();ie.lexer=me;function te(){this.yy={}}return w(te,"Parser"),te.prototype=ie,ie.Parser=te,new te})();Zq.parser=Zq;var _Kt=Zq,hx,LKt=(hx=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Hi,this.getAccTitle=ts,this.setAccDescription=rs,this.getAccDescription=ns,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getConfig=w(()=>Ve().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,de.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Ve().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),de.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),de.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const s=this.entities.get(e),a=this.entities.get(n);if(!s||!a)return;const o={entityA:s.id,roleA:r,entityB:a.id,relSpec:i};this.relationships.push(o),de.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(s=>s.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(s=>s.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const s of r)i.cssStyles.push(s)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(s){if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const s of r)i.cssClasses+=" "+s}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ri()}getData(){const e=[],r=[],n=Ve();let i=0;for(const a of this.entities.keys()){const o=this.entities.get(a);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let s=0;for(const a of this.relationships){const o={id:Mb(a.entityA,a.entityB,{prefix:"id",counter:s++}),type:"normal",curve:"basis",start:a.entityA,end:a.entityB,label:a.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:a.relSpec.cardB.toLowerCase(),arrowTypeEnd:a.relSpec.cardA.toLowerCase(),pattern:a.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},w(hx,"ErDB"),hx),yIe={};ON(yIe,{draw:()=>IKt});var IKt=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:s,layout:a}=Ve(),o=n.db.getData(),l=S3(e,i);o.type=n.type,o.layoutAlgorithm=n7(a),o.config.flowchart.nodeSpacing=(s==null?void 0:s.nodeSpacing)||140,o.config.flowchart.rankSpacing=(s==null?void 0:s.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await o3(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=wt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Kr.insertTitle(l,"erDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),sv(l,f,"erDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),Kpe=w((t,e)=>{const r=yK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return dh(n,i,s,e)},"fade"),cR=new Set(["redux-color","redux-dark-color"]),NKt=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!cR.has(e))return"";const s=(n==null?void 0:n.length)>0;let a="";for(let o=0;o0?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(Fe){return Fe=this.conditionStack.length-1-Math.abs(Fe||0),Fe>=0?this.conditionStack[Fe]:"INITIAL"},"topState"),pushState:w(function(Fe){this.begin(Fe)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(Fe,ce,he,Te){switch(he){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return _e})();ie.lexer=me;function te(){this.yy={}}return w(te,"Parser"),te.prototype=ie,ie.Parser=te,new te})();tU.parser=tU;var UKt=tU,fx,YKt=(fx=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Hi,this.getAccTitle=ts,this.setAccDescription=rs,this.getAccDescription=ns,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getConfig=w(()=>Ve().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,de.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Ve().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),de.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),de.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const s=this.entities.get(e),a=this.entities.get(n);if(!s||!a)return;const o={entityA:s.id,roleA:r,entityB:a.id,relSpec:i};this.relationships.push(o),de.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(s=>s.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(s=>s.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const s of r)i.cssStyles.push(s)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(s){if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const s of r)i.cssClasses+=" "+s}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ri()}getData(){const e=[],r=[],n=Ve();let i=0;for(const a of this.entities.keys()){const o=this.entities.get(a);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let s=0;for(const a of this.relationships){const o={id:_b(a.entityA,a.entityB,{prefix:"id",counter:s++}),type:"normal",curve:"basis",start:a.entityA,end:a.entityB,label:a.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:a.relSpec.cardB.toLowerCase(),arrowTypeEnd:a.relSpec.cardA.toLowerCase(),pattern:a.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},w(fx,"ErDB"),fx),CIe={};BN(CIe,{draw:()=>jKt});var jKt=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:s,layout:a}=Ve(),o=n.db.getData(),l=M3(e,i);o.type=n.type,o.layoutAlgorithm=a7(a),o.config.flowchart.nodeSpacing=(s==null?void 0:s.nodeSpacing)||140,o.config.flowchart.rankSpacing=(s==null?void 0:s.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await u3(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=wt(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;Kr.insertTitle(l,"erDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),ov(l,f,"erDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),rge=w((t,e)=>{const r=wK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),fR=new Set(["redux-color","redux-dark-color"]),XKt=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!fR.has(e))return"";const s=(n==null?void 0:n.length)>0;let a="";for(let o=0;o{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` - ${NKt(t)} + `;return a},"genColor"),KKt=w(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${XKt(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -3354,14 +3361,14 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse erro } .labelBkg { - background-color: ${cR.has(r)&&n?n:Kpe(t.tertiaryColor,.5)}; + background-color: ${fR.has(r)&&n?n:rge(t.tertiaryColor,.5)}; } .edgeLabel { - background-color: ${cR.has(r)&&n?n:t.edgeLabelBackground}; + background-color: ${fR.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { - fill: ${cR.has(r)&&n?n:t.edgeLabelBackground}; + fill: ${fR.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; @@ -3403,17 +3410,17 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${Kpe(t.tertiaryColor,.5)}; + background-color: ${rge(t.tertiaryColor,.5)}; } -`},"getStyles"),OKt=DKt,PKt={parser:_Kt,get db(){return new LKt},renderer:yIe,styles:OKt};const $Kt=Object.freeze(Object.defineProperty({__proto__:null,diagram:PKt},Symbol.toStringTag,{value:"Module"}));var dx,mee=(dx=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(dx,"ImperativeState"),dx);function Fl(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}w(Fl,"populateCommonDb");var BKt=Object.create,E7=Object.defineProperty,FKt=Object.getOwnPropertyDescriptor,yee=Object.getOwnPropertyNames,zKt=Object.getPrototypeOf,VKt=Object.prototype.hasOwnProperty,M=(t,e)=>E7(t,"name",{value:e,configurable:!0}),HKt=(t,e)=>function(){return t&&(e=(0,t[yee(t)[0]])(t=0)),e},pn=(t,e)=>function(){return e||(0,t[yee(t)[0]])((e={exports:{}}).exports,e),e.exports},om=(t,e)=>{for(var r in e)E7(t,r,{get:e[r],enumerable:!0})},vee=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yee(e))!VKt.call(t,i)&&i!==r&&E7(t,i,{get:()=>e[i],enumerable:!(n=FKt(e,i))||n.enumerable});return t},dO=(t,e,r)=>(vee(t,e,"default"),r),bee=(t,e,r)=>(r=t!=null?BKt(zKt(t)):{},vee(E7(r,"default",{value:t,enumerable:!0}),t)),xee=t=>vee(E7({},"__esModule",{value:!0}),t),fO={};om(fO,{AnnotatedTextEdit:()=>wf,ChangeAnnotation:()=>Km,ChangeAnnotationIdentifier:()=>uo,CodeAction:()=>LU,CodeActionContext:()=>_U,CodeActionKind:()=>RU,CodeActionTriggerKind:()=>yk,CodeDescription:()=>oU,CodeLens:()=>IU,Color:()=>hR,ColorInformation:()=>tU,ColorPresentation:()=>rU,Command:()=>Xm,CompletionItem:()=>yU,CompletionItemKind:()=>hU,CompletionItemLabelDetails:()=>mU,CompletionItemTag:()=>fU,CompletionList:()=>vU,CreateFile:()=>E2,DeleteFile:()=>M2,Diagnostic:()=>fk,DiagnosticRelatedInformation:()=>dR,DiagnosticSeverity:()=>sU,DiagnosticTag:()=>aU,DocumentHighlight:()=>CU,DocumentHighlightKind:()=>TU,DocumentLink:()=>DU,DocumentSymbol:()=>MU,DocumentUri:()=>Qq,EOL:()=>bIe,FoldingRange:()=>iU,FoldingRangeKind:()=>nU,FormattingOptions:()=>NU,Hover:()=>bU,InlayHint:()=>GU,InlayHintKind:()=>gR,InlayHintLabelPart:()=>mR,InlineCompletionContext:()=>XU,InlineCompletionItem:()=>qU,InlineCompletionList:()=>UU,InlineCompletionTriggerKind:()=>YU,InlineValueContext:()=>HU,InlineValueEvaluatableExpression:()=>VU,InlineValueText:()=>FU,InlineValueVariableLookup:()=>zU,InsertReplaceEdit:()=>pU,InsertTextFormat:()=>dU,InsertTextMode:()=>gU,Location:()=>dk,LocationLink:()=>eU,MarkedString:()=>mk,MarkupContent:()=>R2,MarkupKind:()=>pR,OptionalVersionedTextDocumentIdentifier:()=>gk,ParameterInformation:()=>xU,Position:()=>ai,Range:()=>$n,RenameFile:()=>A2,SelectedCompletionInfo:()=>jU,SelectionRange:()=>OU,SemanticTokenModifiers:()=>$U,SemanticTokenTypes:()=>PU,SemanticTokens:()=>BU,SignatureInformation:()=>wU,StringValue:()=>WU,SymbolInformation:()=>EU,SymbolKind:()=>kU,SymbolTag:()=>SU,TextDocument:()=>ZU,TextDocumentEdit:()=>pk,TextDocumentIdentifier:()=>lU,TextDocumentItem:()=>uU,TextEdit:()=>Uh,URI:()=>uR,VersionedTextDocumentIdentifier:()=>cU,WorkspaceChange:()=>vIe,WorkspaceEdit:()=>fR,WorkspaceFolder:()=>KU,WorkspaceSymbol:()=>AU,integer:()=>Jq,uinteger:()=>hk});var Qq,uR,Jq,hk,ai,$n,dk,eU,hR,tU,rU,nU,iU,dR,sU,aU,oU,fk,Xm,Uh,Km,uo,wf,pk,E2,A2,M2,fR,bC,$z,vIe,lU,cU,gk,uU,pR,R2,hU,dU,fU,pU,gU,mU,yU,vU,mk,bU,xU,wU,TU,CU,kU,SU,EU,AU,MU,RU,yk,_U,LU,IU,NU,DU,OU,PU,$U,BU,FU,zU,VU,HU,gR,mR,GU,WU,qU,UU,YU,jU,XU,KU,bIe,ZU,Zpe,ot,A7=HKt({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function s(a){return typeof a=="string"}M(s,"is"),i.is=s})(Qq||(Qq={})),(function(i){function s(a){return typeof a=="string"}M(s,"is"),i.is=s})(uR||(uR={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function s(a){return typeof a=="number"&&i.MIN_VALUE<=a&&a<=i.MAX_VALUE}M(s,"is"),i.is=s})(Jq||(Jq={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function s(a){return typeof a=="number"&&i.MIN_VALUE<=a&&a<=i.MAX_VALUE}M(s,"is"),i.is=s})(hk||(hk={})),(function(i){function s(o,l){return o===Number.MAX_VALUE&&(o=hk.MAX_VALUE),l===Number.MAX_VALUE&&(l=hk.MAX_VALUE),{line:o,character:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&ot.uinteger(l.line)&&ot.uinteger(l.character)}M(a,"is"),i.is=a})(ai||(ai={})),(function(i){function s(o,l,u,h){if(ot.uinteger(o)&&ot.uinteger(l)&&ot.uinteger(u)&&ot.uinteger(h))return{start:ai.create(o,l),end:ai.create(u,h)};if(ai.is(o)&&ai.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&ai.is(l.start)&&ai.is(l.end)}M(a,"is"),i.is=a})($n||($n={})),(function(i){function s(o,l){return{uri:o,range:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&$n.is(l.range)&&(ot.string(l.uri)||ot.undefined(l.uri))}M(a,"is"),i.is=a})(dk||(dk={})),(function(i){function s(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&$n.is(l.targetRange)&&ot.string(l.targetUri)&&$n.is(l.targetSelectionRange)&&($n.is(l.originSelectionRange)||ot.undefined(l.originSelectionRange))}M(a,"is"),i.is=a})(eU||(eU={})),(function(i){function s(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.numberRange(l.red,0,1)&&ot.numberRange(l.green,0,1)&&ot.numberRange(l.blue,0,1)&&ot.numberRange(l.alpha,0,1)}M(a,"is"),i.is=a})(hR||(hR={})),(function(i){function s(o,l){return{range:o,color:l}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&$n.is(l.range)&&hR.is(l.color)}M(a,"is"),i.is=a})(tU||(tU={})),(function(i){function s(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.string(l.label)&&(ot.undefined(l.textEdit)||Uh.is(l))&&(ot.undefined(l.additionalTextEdits)||ot.typedArray(l.additionalTextEdits,Uh.is))}M(a,"is"),i.is=a})(rU||(rU={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(nU||(nU={})),(function(i){function s(o,l,u,h,d,f){const p={startLine:o,endLine:l};return ot.defined(u)&&(p.startCharacter=u),ot.defined(h)&&(p.endCharacter=h),ot.defined(d)&&(p.kind=d),ot.defined(f)&&(p.collapsedText=f),p}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.uinteger(l.startLine)&&ot.uinteger(l.startLine)&&(ot.undefined(l.startCharacter)||ot.uinteger(l.startCharacter))&&(ot.undefined(l.endCharacter)||ot.uinteger(l.endCharacter))&&(ot.undefined(l.kind)||ot.string(l.kind))}M(a,"is"),i.is=a})(iU||(iU={})),(function(i){function s(o,l){return{location:o,message:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&dk.is(l.location)&&ot.string(l.message)}M(a,"is"),i.is=a})(dR||(dR={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(sU||(sU={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(aU||(aU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&ot.string(o.href)}M(s,"is"),i.is=s})(oU||(oU={})),(function(i){function s(o,l,u,h,d,f){let p={range:o,message:l};return ot.defined(u)&&(p.severity=u),ot.defined(h)&&(p.code=h),ot.defined(d)&&(p.source=d),ot.defined(f)&&(p.relatedInformation=f),p}M(s,"create"),i.create=s;function a(o){var l;let u=o;return ot.defined(u)&&$n.is(u.range)&&ot.string(u.message)&&(ot.number(u.severity)||ot.undefined(u.severity))&&(ot.integer(u.code)||ot.string(u.code)||ot.undefined(u.code))&&(ot.undefined(u.codeDescription)||ot.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(ot.string(u.source)||ot.undefined(u.source))&&(ot.undefined(u.relatedInformation)||ot.typedArray(u.relatedInformation,dR.is))}M(a,"is"),i.is=a})(fk||(fk={})),(function(i){function s(o,l,...u){let h={title:o,command:l};return ot.defined(u)&&u.length>0&&(h.arguments=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.title)&&ot.string(l.command)}M(a,"is"),i.is=a})(Xm||(Xm={})),(function(i){function s(u,h){return{range:u,newText:h}}M(s,"replace"),i.replace=s;function a(u,h){return{range:{start:u,end:u},newText:h}}M(a,"insert"),i.insert=a;function o(u){return{range:u,newText:""}}M(o,"del"),i.del=o;function l(u){const h=u;return ot.objectLiteral(h)&&ot.string(h.newText)&&$n.is(h.range)}M(l,"is"),i.is=l})(Uh||(Uh={})),(function(i){function s(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.string(l.label)&&(ot.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(ot.string(l.description)||l.description===void 0)}M(a,"is"),i.is=a})(Km||(Km={})),(function(i){function s(a){const o=a;return ot.string(o)}M(s,"is"),i.is=s})(uo||(uo={})),(function(i){function s(u,h,d){return{range:u,newText:h,annotationId:d}}M(s,"replace"),i.replace=s;function a(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}M(a,"insert"),i.insert=a;function o(u,h){return{range:u,newText:"",annotationId:h}}M(o,"del"),i.del=o;function l(u){const h=u;return Uh.is(h)&&(Km.is(h.annotationId)||uo.is(h.annotationId))}M(l,"is"),i.is=l})(wf||(wf={})),(function(i){function s(o,l){return{textDocument:o,edits:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&gk.is(l.textDocument)&&Array.isArray(l.edits)}M(a,"is"),i.is=a})(pk||(pk={})),(function(i){function s(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return l&&l.kind==="create"&&ot.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||ot.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ot.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||uo.is(l.annotationId))}M(a,"is"),i.is=a})(E2||(E2={})),(function(i){function s(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}M(s,"create"),i.create=s;function a(o){let l=o;return l&&l.kind==="rename"&&ot.string(l.oldUri)&&ot.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||ot.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ot.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||uo.is(l.annotationId))}M(a,"is"),i.is=a})(A2||(A2={})),(function(i){function s(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return l&&l.kind==="delete"&&ot.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||ot.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||ot.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||uo.is(l.annotationId))}M(a,"is"),i.is=a})(M2||(M2={})),(function(i){function s(a){let o=a;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>ot.string(l.kind)?E2.is(l)||A2.is(l)||M2.is(l):pk.is(l)))}M(s,"is"),i.is=s})(fR||(fR={})),bC=(t=class{constructor(s,a){this.edits=s,this.changeAnnotations=a}insert(s,a,o){let l,u;if(o===void 0?l=Uh.insert(s,a):uo.is(o)?(u=o,l=wf.insert(s,a,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=wf.insert(s,a,u)),this.edits.push(l),u!==void 0)return u}replace(s,a,o){let l,u;if(o===void 0?l=Uh.replace(s,a):uo.is(o)?(u=o,l=wf.replace(s,a,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=wf.replace(s,a,u)),this.edits.push(l),u!==void 0)return u}delete(s,a){let o,l;if(a===void 0?o=Uh.del(s):uo.is(a)?(l=a,o=wf.del(s,a)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(a),o=wf.del(s,l)),this.edits.push(o),l!==void 0)return l}add(s){this.edits.push(s)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(s){if(s===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},M(t,"TextEditChangeImpl"),t),$z=(e=class{constructor(s){this._annotations=s===void 0?Object.create(null):s,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(s,a){let o;if(uo.is(s)?o=s:(o=this.nextId(),a=s),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(a===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=a,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},M(e,"ChangeAnnotations"),e),vIe=(r=class{constructor(s){this._textEditChanges=Object.create(null),s!==void 0?(this._workspaceEdit=s,s.documentChanges?(this._changeAnnotations=new $z(s.changeAnnotations),s.changeAnnotations=this._changeAnnotations.all(),s.documentChanges.forEach(a=>{if(pk.is(a)){const o=new bC(a.edits,this._changeAnnotations);this._textEditChanges[a.textDocument.uri]=o}})):s.changes&&Object.keys(s.changes).forEach(a=>{const o=new bC(s.changes[a]);this._textEditChanges[a]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(s){if(gk.is(s)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const a={uri:s.uri,version:s.version};let o=this._textEditChanges[a.uri];if(!o){const l=[],u={textDocument:a,edits:l};this._workspaceEdit.documentChanges.push(u),o=new bC(l,this._changeAnnotations),this._textEditChanges[a.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let a=this._textEditChanges[s];if(!a){let o=[];this._workspaceEdit.changes[s]=o,a=new bC(o),this._textEditChanges[s]=a}return a}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new $z,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(s,a,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Km.is(a)||uo.is(a)?l=a:o=a;let u,h;if(l===void 0?u=E2.create(s,o):(h=uo.is(l)?l:this._changeAnnotations.manage(l),u=E2.create(s,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(s,a,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Km.is(o)||uo.is(o)?u=o:l=o;let h,d;if(u===void 0?h=A2.create(s,a,l):(d=uo.is(u)?u:this._changeAnnotations.manage(u),h=A2.create(s,a,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(s,a,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Km.is(a)||uo.is(a)?l=a:o=a;let u,h;if(l===void 0?u=M2.create(s,o):(h=uo.is(l)?l:this._changeAnnotations.manage(l),u=M2.create(s,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},M(r,"WorkspaceChange"),r),(function(i){function s(o){return{uri:o}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)}M(a,"is"),i.is=a})(lU||(lU={})),(function(i){function s(o,l){return{uri:o,version:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)&&ot.integer(l.version)}M(a,"is"),i.is=a})(cU||(cU={})),(function(i){function s(o,l){return{uri:o,version:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)&&(l.version===null||ot.integer(l.version))}M(a,"is"),i.is=a})(gk||(gk={})),(function(i){function s(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)&&ot.string(l.languageId)&&ot.integer(l.version)&&ot.string(l.text)}M(a,"is"),i.is=a})(uU||(uU={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function s(a){const o=a;return o===i.PlainText||o===i.Markdown}M(s,"is"),i.is=s})(pR||(pR={})),(function(i){function s(a){const o=a;return ot.objectLiteral(a)&&pR.is(o.kind)&&ot.string(o.value)}M(s,"is"),i.is=s})(R2||(R2={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(hU||(hU={})),(function(i){i.PlainText=1,i.Snippet=2})(dU||(dU={})),(function(i){i.Deprecated=1})(fU||(fU={})),(function(i){function s(o,l,u){return{newText:o,insert:l,replace:u}}M(s,"create"),i.create=s;function a(o){const l=o;return l&&ot.string(l.newText)&&$n.is(l.insert)&&$n.is(l.replace)}M(a,"is"),i.is=a})(pU||(pU={})),(function(i){i.asIs=1,i.adjustIndentation=2})(gU||(gU={})),(function(i){function s(a){const o=a;return o&&(ot.string(o.detail)||o.detail===void 0)&&(ot.string(o.description)||o.description===void 0)}M(s,"is"),i.is=s})(mU||(mU={})),(function(i){function s(a){return{label:a}}M(s,"create"),i.create=s})(yU||(yU={})),(function(i){function s(a,o){return{items:a||[],isIncomplete:!!o}}M(s,"create"),i.create=s})(vU||(vU={})),(function(i){function s(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}M(s,"fromPlainText"),i.fromPlainText=s;function a(o){const l=o;return ot.string(l)||ot.objectLiteral(l)&&ot.string(l.language)&&ot.string(l.value)}M(a,"is"),i.is=a})(mk||(mk={})),(function(i){function s(a){let o=a;return!!o&&ot.objectLiteral(o)&&(R2.is(o.contents)||mk.is(o.contents)||ot.typedArray(o.contents,mk.is))&&(a.range===void 0||$n.is(a.range))}M(s,"is"),i.is=s})(bU||(bU={})),(function(i){function s(a,o){return o?{label:a,documentation:o}:{label:a}}M(s,"create"),i.create=s})(xU||(xU={})),(function(i){function s(a,o,...l){let u={label:a};return ot.defined(o)&&(u.documentation=o),ot.defined(l)?u.parameters=l:u.parameters=[],u}M(s,"create"),i.create=s})(wU||(wU={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(TU||(TU={})),(function(i){function s(a,o){let l={range:a};return ot.number(o)&&(l.kind=o),l}M(s,"create"),i.create=s})(CU||(CU={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(kU||(kU={})),(function(i){i.Deprecated=1})(SU||(SU={})),(function(i){function s(a,o,l,u,h){let d={name:a,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}M(s,"create"),i.create=s})(EU||(EU={})),(function(i){function s(a,o,l,u){return u!==void 0?{name:a,kind:o,location:{uri:l,range:u}}:{name:a,kind:o,location:{uri:l}}}M(s,"create"),i.create=s})(AU||(AU={})),(function(i){function s(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}M(s,"create"),i.create=s;function a(o){let l=o;return l&&ot.string(l.name)&&ot.number(l.kind)&&$n.is(l.range)&&$n.is(l.selectionRange)&&(l.detail===void 0||ot.string(l.detail))&&(l.deprecated===void 0||ot.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}M(a,"is"),i.is=a})(MU||(MU={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(RU||(RU={})),(function(i){i.Invoked=1,i.Automatic=2})(yk||(yk={})),(function(i){function s(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.typedArray(l.diagnostics,fk.is)&&(l.only===void 0||ot.typedArray(l.only,ot.string))&&(l.triggerKind===void 0||l.triggerKind===yk.Invoked||l.triggerKind===yk.Automatic)}M(a,"is"),i.is=a})(_U||(_U={})),(function(i){function s(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Xm.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return l&&ot.string(l.title)&&(l.diagnostics===void 0||ot.typedArray(l.diagnostics,fk.is))&&(l.kind===void 0||ot.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Xm.is(l.command))&&(l.isPreferred===void 0||ot.boolean(l.isPreferred))&&(l.edit===void 0||fR.is(l.edit))}M(a,"is"),i.is=a})(LU||(LU={})),(function(i){function s(o,l){let u={range:o};return ot.defined(l)&&(u.data=l),u}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&$n.is(l.range)&&(ot.undefined(l.command)||Xm.is(l.command))}M(a,"is"),i.is=a})(IU||(IU={})),(function(i){function s(o,l){return{tabSize:o,insertSpaces:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.uinteger(l.tabSize)&&ot.boolean(l.insertSpaces)}M(a,"is"),i.is=a})(NU||(NU={})),(function(i){function s(o,l,u){return{range:o,target:l,data:u}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&$n.is(l.range)&&(ot.undefined(l.target)||ot.string(l.target))}M(a,"is"),i.is=a})(DU||(DU={})),(function(i){function s(o,l){return{range:o,parent:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&$n.is(l.range)&&(l.parent===void 0||i.is(l.parent))}M(a,"is"),i.is=a})(OU||(OU={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(PU||(PU={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})($U||($U={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}M(s,"is"),i.is=s})(BU||(BU={})),(function(i){function s(o,l){return{range:o,text:l}}M(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&$n.is(l.range)&&ot.string(l.text)}M(a,"is"),i.is=a})(FU||(FU={})),(function(i){function s(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}M(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&$n.is(l.range)&&ot.boolean(l.caseSensitiveLookup)&&(ot.string(l.variableName)||l.variableName===void 0)}M(a,"is"),i.is=a})(zU||(zU={})),(function(i){function s(o,l){return{range:o,expression:l}}M(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&$n.is(l.range)&&(ot.string(l.expression)||l.expression===void 0)}M(a,"is"),i.is=a})(VU||(VU={})),(function(i){function s(o,l){return{frameId:o,stoppedLocation:l}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.defined(l)&&$n.is(o.stoppedLocation)}M(a,"is"),i.is=a})(HU||(HU={})),(function(i){i.Type=1,i.Parameter=2;function s(a){return a===1||a===2}M(s,"is"),i.is=s})(gR||(gR={})),(function(i){function s(o){return{value:o}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&(l.tooltip===void 0||ot.string(l.tooltip)||R2.is(l.tooltip))&&(l.location===void 0||dk.is(l.location))&&(l.command===void 0||Xm.is(l.command))}M(a,"is"),i.is=a})(mR||(mR={})),(function(i){function s(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ai.is(l.position)&&(ot.string(l.label)||ot.typedArray(l.label,mR.is))&&(l.kind===void 0||gR.is(l.kind))&&l.textEdits===void 0||ot.typedArray(l.textEdits,Uh.is)&&(l.tooltip===void 0||ot.string(l.tooltip)||R2.is(l.tooltip))&&(l.paddingLeft===void 0||ot.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ot.boolean(l.paddingRight))}M(a,"is"),i.is=a})(GU||(GU={})),(function(i){function s(a){return{kind:"snippet",value:a}}M(s,"createSnippet"),i.createSnippet=s})(WU||(WU={})),(function(i){function s(a,o,l,u){return{insertText:a,filterText:o,range:l,command:u}}M(s,"create"),i.create=s})(qU||(qU={})),(function(i){function s(a){return{items:a}}M(s,"create"),i.create=s})(UU||(UU={})),(function(i){i.Invoked=0,i.Automatic=1})(YU||(YU={})),(function(i){function s(a,o){return{range:a,text:o}}M(s,"create"),i.create=s})(jU||(jU={})),(function(i){function s(a,o){return{triggerKind:a,selectedCompletionInfo:o}}M(s,"create"),i.create=s})(XU||(XU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&uR.is(o.uri)&&ot.string(o.name)}M(s,"is"),i.is=s})(KU||(KU={})),bIe=[` +`},"getStyles"),ZKt=KKt,QKt={parser:UKt,get db(){return new YKt},renderer:CIe,styles:ZKt};const JKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:QKt},Symbol.toStringTag,{value:"Module"}));var px,xee=(px=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(px,"ImperativeState"),px);function Vl(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}w(Vl,"populateCommonDb");var eZt=Object.create,R7=Object.defineProperty,tZt=Object.getOwnPropertyDescriptor,wee=Object.getOwnPropertyNames,rZt=Object.getPrototypeOf,nZt=Object.prototype.hasOwnProperty,M=(t,e)=>R7(t,"name",{value:e,configurable:!0}),iZt=(t,e)=>function(){return t&&(e=(0,t[wee(t)[0]])(t=0)),e},pn=(t,e)=>function(){return e||(0,t[wee(t)[0]])((e={exports:{}}).exports,e),e.exports},um=(t,e)=>{for(var r in e)R7(t,r,{get:e[r],enumerable:!0})},Tee=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wee(e))!nZt.call(t,i)&&i!==r&&R7(t,i,{get:()=>e[i],enumerable:!(n=tZt(e,i))||n.enumerable});return t},gO=(t,e,r)=>(Tee(t,e,"default"),r),Cee=(t,e,r)=>(r=t!=null?eZt(rZt(t)):{},Tee(R7(r,"default",{value:t,enumerable:!0}),t)),kee=t=>Tee(R7({},"__esModule",{value:!0}),t),mO={};um(mO,{AnnotatedTextEdit:()=>kf,ChangeAnnotation:()=>Jm,ChangeAnnotationIdentifier:()=>uo,CodeAction:()=>OU,CodeActionContext:()=>DU,CodeActionKind:()=>NU,CodeActionTriggerKind:()=>xk,CodeDescription:()=>hU,CodeLens:()=>PU,Color:()=>gR,ColorInformation:()=>sU,ColorPresentation:()=>aU,Command:()=>Qm,CompletionItem:()=>wU,CompletionItemKind:()=>gU,CompletionItemLabelDetails:()=>xU,CompletionItemTag:()=>yU,CompletionList:()=>TU,CreateFile:()=>M2,DeleteFile:()=>_2,Diagnostic:()=>mk,DiagnosticRelatedInformation:()=>mR,DiagnosticSeverity:()=>cU,DiagnosticTag:()=>uU,DocumentHighlight:()=>AU,DocumentHighlightKind:()=>EU,DocumentLink:()=>BU,DocumentSymbol:()=>IU,DocumentUri:()=>rU,EOL:()=>SIe,FoldingRange:()=>lU,FoldingRangeKind:()=>oU,FormattingOptions:()=>$U,Hover:()=>CU,InlayHint:()=>YU,InlayHintKind:()=>bR,InlayHintLabelPart:()=>xR,InlineCompletionContext:()=>JU,InlineCompletionItem:()=>XU,InlineCompletionList:()=>KU,InlineCompletionTriggerKind:()=>ZU,InlineValueContext:()=>UU,InlineValueEvaluatableExpression:()=>qU,InlineValueText:()=>GU,InlineValueVariableLookup:()=>WU,InsertReplaceEdit:()=>vU,InsertTextFormat:()=>mU,InsertTextMode:()=>bU,Location:()=>gk,LocationLink:()=>iU,MarkedString:()=>bk,MarkupContent:()=>L2,MarkupKind:()=>vR,OptionalVersionedTextDocumentIdentifier:()=>vk,ParameterInformation:()=>kU,Position:()=>oi,Range:()=>$n,RenameFile:()=>R2,SelectedCompletionInfo:()=>QU,SelectionRange:()=>FU,SemanticTokenModifiers:()=>VU,SemanticTokenTypes:()=>zU,SemanticTokens:()=>HU,SignatureInformation:()=>SU,StringValue:()=>jU,SymbolInformation:()=>_U,SymbolKind:()=>MU,SymbolTag:()=>RU,TextDocument:()=>tY,TextDocumentEdit:()=>yk,TextDocumentIdentifier:()=>dU,TextDocumentItem:()=>pU,TextEdit:()=>Xh,URI:()=>pR,VersionedTextDocumentIdentifier:()=>fU,WorkspaceChange:()=>kIe,WorkspaceEdit:()=>yR,WorkspaceFolder:()=>eY,WorkspaceSymbol:()=>LU,integer:()=>nU,uinteger:()=>pk});var rU,pR,nU,pk,oi,$n,gk,iU,gR,sU,aU,oU,lU,mR,cU,uU,hU,mk,Qm,Xh,Jm,uo,kf,yk,M2,R2,_2,yR,TC,Vz,kIe,dU,fU,vk,pU,vR,L2,gU,mU,yU,vU,bU,xU,wU,TU,bk,CU,kU,SU,EU,AU,MU,RU,_U,LU,IU,NU,xk,DU,OU,PU,$U,BU,FU,zU,VU,HU,GU,WU,qU,UU,bR,xR,YU,jU,XU,KU,ZU,QU,JU,eY,SIe,tY,nge,ot,_7=iZt({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function s(a){return typeof a=="string"}M(s,"is"),i.is=s})(rU||(rU={})),(function(i){function s(a){return typeof a=="string"}M(s,"is"),i.is=s})(pR||(pR={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function s(a){return typeof a=="number"&&i.MIN_VALUE<=a&&a<=i.MAX_VALUE}M(s,"is"),i.is=s})(nU||(nU={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function s(a){return typeof a=="number"&&i.MIN_VALUE<=a&&a<=i.MAX_VALUE}M(s,"is"),i.is=s})(pk||(pk={})),(function(i){function s(o,l){return o===Number.MAX_VALUE&&(o=pk.MAX_VALUE),l===Number.MAX_VALUE&&(l=pk.MAX_VALUE),{line:o,character:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&ot.uinteger(l.line)&&ot.uinteger(l.character)}M(a,"is"),i.is=a})(oi||(oi={})),(function(i){function s(o,l,u,h){if(ot.uinteger(o)&&ot.uinteger(l)&&ot.uinteger(u)&&ot.uinteger(h))return{start:oi.create(o,l),end:oi.create(u,h)};if(oi.is(o)&&oi.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&oi.is(l.start)&&oi.is(l.end)}M(a,"is"),i.is=a})($n||($n={})),(function(i){function s(o,l){return{uri:o,range:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&$n.is(l.range)&&(ot.string(l.uri)||ot.undefined(l.uri))}M(a,"is"),i.is=a})(gk||(gk={})),(function(i){function s(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&$n.is(l.targetRange)&&ot.string(l.targetUri)&&$n.is(l.targetSelectionRange)&&($n.is(l.originSelectionRange)||ot.undefined(l.originSelectionRange))}M(a,"is"),i.is=a})(iU||(iU={})),(function(i){function s(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.numberRange(l.red,0,1)&&ot.numberRange(l.green,0,1)&&ot.numberRange(l.blue,0,1)&&ot.numberRange(l.alpha,0,1)}M(a,"is"),i.is=a})(gR||(gR={})),(function(i){function s(o,l){return{range:o,color:l}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&$n.is(l.range)&&gR.is(l.color)}M(a,"is"),i.is=a})(sU||(sU={})),(function(i){function s(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.string(l.label)&&(ot.undefined(l.textEdit)||Xh.is(l))&&(ot.undefined(l.additionalTextEdits)||ot.typedArray(l.additionalTextEdits,Xh.is))}M(a,"is"),i.is=a})(aU||(aU={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(oU||(oU={})),(function(i){function s(o,l,u,h,d,f){const p={startLine:o,endLine:l};return ot.defined(u)&&(p.startCharacter=u),ot.defined(h)&&(p.endCharacter=h),ot.defined(d)&&(p.kind=d),ot.defined(f)&&(p.collapsedText=f),p}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.uinteger(l.startLine)&&ot.uinteger(l.startLine)&&(ot.undefined(l.startCharacter)||ot.uinteger(l.startCharacter))&&(ot.undefined(l.endCharacter)||ot.uinteger(l.endCharacter))&&(ot.undefined(l.kind)||ot.string(l.kind))}M(a,"is"),i.is=a})(lU||(lU={})),(function(i){function s(o,l){return{location:o,message:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&gk.is(l.location)&&ot.string(l.message)}M(a,"is"),i.is=a})(mR||(mR={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(cU||(cU={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(uU||(uU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&ot.string(o.href)}M(s,"is"),i.is=s})(hU||(hU={})),(function(i){function s(o,l,u,h,d,f){let p={range:o,message:l};return ot.defined(u)&&(p.severity=u),ot.defined(h)&&(p.code=h),ot.defined(d)&&(p.source=d),ot.defined(f)&&(p.relatedInformation=f),p}M(s,"create"),i.create=s;function a(o){var l;let u=o;return ot.defined(u)&&$n.is(u.range)&&ot.string(u.message)&&(ot.number(u.severity)||ot.undefined(u.severity))&&(ot.integer(u.code)||ot.string(u.code)||ot.undefined(u.code))&&(ot.undefined(u.codeDescription)||ot.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(ot.string(u.source)||ot.undefined(u.source))&&(ot.undefined(u.relatedInformation)||ot.typedArray(u.relatedInformation,mR.is))}M(a,"is"),i.is=a})(mk||(mk={})),(function(i){function s(o,l,...u){let h={title:o,command:l};return ot.defined(u)&&u.length>0&&(h.arguments=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.title)&&ot.string(l.command)}M(a,"is"),i.is=a})(Qm||(Qm={})),(function(i){function s(u,h){return{range:u,newText:h}}M(s,"replace"),i.replace=s;function a(u,h){return{range:{start:u,end:u},newText:h}}M(a,"insert"),i.insert=a;function o(u){return{range:u,newText:""}}M(o,"del"),i.del=o;function l(u){const h=u;return ot.objectLiteral(h)&&ot.string(h.newText)&&$n.is(h.range)}M(l,"is"),i.is=l})(Xh||(Xh={})),(function(i){function s(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&ot.string(l.label)&&(ot.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(ot.string(l.description)||l.description===void 0)}M(a,"is"),i.is=a})(Jm||(Jm={})),(function(i){function s(a){const o=a;return ot.string(o)}M(s,"is"),i.is=s})(uo||(uo={})),(function(i){function s(u,h,d){return{range:u,newText:h,annotationId:d}}M(s,"replace"),i.replace=s;function a(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}M(a,"insert"),i.insert=a;function o(u,h){return{range:u,newText:"",annotationId:h}}M(o,"del"),i.del=o;function l(u){const h=u;return Xh.is(h)&&(Jm.is(h.annotationId)||uo.is(h.annotationId))}M(l,"is"),i.is=l})(kf||(kf={})),(function(i){function s(o,l){return{textDocument:o,edits:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&vk.is(l.textDocument)&&Array.isArray(l.edits)}M(a,"is"),i.is=a})(yk||(yk={})),(function(i){function s(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return l&&l.kind==="create"&&ot.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||ot.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ot.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||uo.is(l.annotationId))}M(a,"is"),i.is=a})(M2||(M2={})),(function(i){function s(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}M(s,"create"),i.create=s;function a(o){let l=o;return l&&l.kind==="rename"&&ot.string(l.oldUri)&&ot.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||ot.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ot.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||uo.is(l.annotationId))}M(a,"is"),i.is=a})(R2||(R2={})),(function(i){function s(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return l&&l.kind==="delete"&&ot.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||ot.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||ot.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||uo.is(l.annotationId))}M(a,"is"),i.is=a})(_2||(_2={})),(function(i){function s(a){let o=a;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>ot.string(l.kind)?M2.is(l)||R2.is(l)||_2.is(l):yk.is(l)))}M(s,"is"),i.is=s})(yR||(yR={})),TC=(t=class{constructor(s,a){this.edits=s,this.changeAnnotations=a}insert(s,a,o){let l,u;if(o===void 0?l=Xh.insert(s,a):uo.is(o)?(u=o,l=kf.insert(s,a,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=kf.insert(s,a,u)),this.edits.push(l),u!==void 0)return u}replace(s,a,o){let l,u;if(o===void 0?l=Xh.replace(s,a):uo.is(o)?(u=o,l=kf.replace(s,a,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=kf.replace(s,a,u)),this.edits.push(l),u!==void 0)return u}delete(s,a){let o,l;if(a===void 0?o=Xh.del(s):uo.is(a)?(l=a,o=kf.del(s,a)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(a),o=kf.del(s,l)),this.edits.push(o),l!==void 0)return l}add(s){this.edits.push(s)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(s){if(s===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},M(t,"TextEditChangeImpl"),t),Vz=(e=class{constructor(s){this._annotations=s===void 0?Object.create(null):s,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(s,a){let o;if(uo.is(s)?o=s:(o=this.nextId(),a=s),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(a===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=a,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},M(e,"ChangeAnnotations"),e),kIe=(r=class{constructor(s){this._textEditChanges=Object.create(null),s!==void 0?(this._workspaceEdit=s,s.documentChanges?(this._changeAnnotations=new Vz(s.changeAnnotations),s.changeAnnotations=this._changeAnnotations.all(),s.documentChanges.forEach(a=>{if(yk.is(a)){const o=new TC(a.edits,this._changeAnnotations);this._textEditChanges[a.textDocument.uri]=o}})):s.changes&&Object.keys(s.changes).forEach(a=>{const o=new TC(s.changes[a]);this._textEditChanges[a]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(s){if(vk.is(s)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const a={uri:s.uri,version:s.version};let o=this._textEditChanges[a.uri];if(!o){const l=[],u={textDocument:a,edits:l};this._workspaceEdit.documentChanges.push(u),o=new TC(l,this._changeAnnotations),this._textEditChanges[a.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let a=this._textEditChanges[s];if(!a){let o=[];this._workspaceEdit.changes[s]=o,a=new TC(o),this._textEditChanges[s]=a}return a}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Vz,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(s,a,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Jm.is(a)||uo.is(a)?l=a:o=a;let u,h;if(l===void 0?u=M2.create(s,o):(h=uo.is(l)?l:this._changeAnnotations.manage(l),u=M2.create(s,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(s,a,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;Jm.is(o)||uo.is(o)?u=o:l=o;let h,d;if(u===void 0?h=R2.create(s,a,l):(d=uo.is(u)?u:this._changeAnnotations.manage(u),h=R2.create(s,a,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(s,a,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;Jm.is(a)||uo.is(a)?l=a:o=a;let u,h;if(l===void 0?u=_2.create(s,o):(h=uo.is(l)?l:this._changeAnnotations.manage(l),u=_2.create(s,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},M(r,"WorkspaceChange"),r),(function(i){function s(o){return{uri:o}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)}M(a,"is"),i.is=a})(dU||(dU={})),(function(i){function s(o,l){return{uri:o,version:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)&&ot.integer(l.version)}M(a,"is"),i.is=a})(fU||(fU={})),(function(i){function s(o,l){return{uri:o,version:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)&&(l.version===null||ot.integer(l.version))}M(a,"is"),i.is=a})(vk||(vk={})),(function(i){function s(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.string(l.uri)&&ot.string(l.languageId)&&ot.integer(l.version)&&ot.string(l.text)}M(a,"is"),i.is=a})(pU||(pU={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function s(a){const o=a;return o===i.PlainText||o===i.Markdown}M(s,"is"),i.is=s})(vR||(vR={})),(function(i){function s(a){const o=a;return ot.objectLiteral(a)&&vR.is(o.kind)&&ot.string(o.value)}M(s,"is"),i.is=s})(L2||(L2={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(gU||(gU={})),(function(i){i.PlainText=1,i.Snippet=2})(mU||(mU={})),(function(i){i.Deprecated=1})(yU||(yU={})),(function(i){function s(o,l,u){return{newText:o,insert:l,replace:u}}M(s,"create"),i.create=s;function a(o){const l=o;return l&&ot.string(l.newText)&&$n.is(l.insert)&&$n.is(l.replace)}M(a,"is"),i.is=a})(vU||(vU={})),(function(i){i.asIs=1,i.adjustIndentation=2})(bU||(bU={})),(function(i){function s(a){const o=a;return o&&(ot.string(o.detail)||o.detail===void 0)&&(ot.string(o.description)||o.description===void 0)}M(s,"is"),i.is=s})(xU||(xU={})),(function(i){function s(a){return{label:a}}M(s,"create"),i.create=s})(wU||(wU={})),(function(i){function s(a,o){return{items:a||[],isIncomplete:!!o}}M(s,"create"),i.create=s})(TU||(TU={})),(function(i){function s(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}M(s,"fromPlainText"),i.fromPlainText=s;function a(o){const l=o;return ot.string(l)||ot.objectLiteral(l)&&ot.string(l.language)&&ot.string(l.value)}M(a,"is"),i.is=a})(bk||(bk={})),(function(i){function s(a){let o=a;return!!o&&ot.objectLiteral(o)&&(L2.is(o.contents)||bk.is(o.contents)||ot.typedArray(o.contents,bk.is))&&(a.range===void 0||$n.is(a.range))}M(s,"is"),i.is=s})(CU||(CU={})),(function(i){function s(a,o){return o?{label:a,documentation:o}:{label:a}}M(s,"create"),i.create=s})(kU||(kU={})),(function(i){function s(a,o,...l){let u={label:a};return ot.defined(o)&&(u.documentation=o),ot.defined(l)?u.parameters=l:u.parameters=[],u}M(s,"create"),i.create=s})(SU||(SU={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(EU||(EU={})),(function(i){function s(a,o){let l={range:a};return ot.number(o)&&(l.kind=o),l}M(s,"create"),i.create=s})(AU||(AU={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(MU||(MU={})),(function(i){i.Deprecated=1})(RU||(RU={})),(function(i){function s(a,o,l,u,h){let d={name:a,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}M(s,"create"),i.create=s})(_U||(_U={})),(function(i){function s(a,o,l,u){return u!==void 0?{name:a,kind:o,location:{uri:l,range:u}}:{name:a,kind:o,location:{uri:l}}}M(s,"create"),i.create=s})(LU||(LU={})),(function(i){function s(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}M(s,"create"),i.create=s;function a(o){let l=o;return l&&ot.string(l.name)&&ot.number(l.kind)&&$n.is(l.range)&&$n.is(l.selectionRange)&&(l.detail===void 0||ot.string(l.detail))&&(l.deprecated===void 0||ot.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}M(a,"is"),i.is=a})(IU||(IU={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(NU||(NU={})),(function(i){i.Invoked=1,i.Automatic=2})(xk||(xk={})),(function(i){function s(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.typedArray(l.diagnostics,mk.is)&&(l.only===void 0||ot.typedArray(l.only,ot.string))&&(l.triggerKind===void 0||l.triggerKind===xk.Invoked||l.triggerKind===xk.Automatic)}M(a,"is"),i.is=a})(DU||(DU={})),(function(i){function s(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Qm.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}M(s,"create"),i.create=s;function a(o){let l=o;return l&&ot.string(l.title)&&(l.diagnostics===void 0||ot.typedArray(l.diagnostics,mk.is))&&(l.kind===void 0||ot.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Qm.is(l.command))&&(l.isPreferred===void 0||ot.boolean(l.isPreferred))&&(l.edit===void 0||yR.is(l.edit))}M(a,"is"),i.is=a})(OU||(OU={})),(function(i){function s(o,l){let u={range:o};return ot.defined(l)&&(u.data=l),u}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&$n.is(l.range)&&(ot.undefined(l.command)||Qm.is(l.command))}M(a,"is"),i.is=a})(PU||(PU={})),(function(i){function s(o,l){return{tabSize:o,insertSpaces:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&ot.uinteger(l.tabSize)&&ot.boolean(l.insertSpaces)}M(a,"is"),i.is=a})($U||($U={})),(function(i){function s(o,l,u){return{range:o,target:l,data:u}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.defined(l)&&$n.is(l.range)&&(ot.undefined(l.target)||ot.string(l.target))}M(a,"is"),i.is=a})(BU||(BU={})),(function(i){function s(o,l){return{range:o,parent:l}}M(s,"create"),i.create=s;function a(o){let l=o;return ot.objectLiteral(l)&&$n.is(l.range)&&(l.parent===void 0||i.is(l.parent))}M(a,"is"),i.is=a})(FU||(FU={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(zU||(zU={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(VU||(VU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}M(s,"is"),i.is=s})(HU||(HU={})),(function(i){function s(o,l){return{range:o,text:l}}M(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&$n.is(l.range)&&ot.string(l.text)}M(a,"is"),i.is=a})(GU||(GU={})),(function(i){function s(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}M(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&$n.is(l.range)&&ot.boolean(l.caseSensitiveLookup)&&(ot.string(l.variableName)||l.variableName===void 0)}M(a,"is"),i.is=a})(WU||(WU={})),(function(i){function s(o,l){return{range:o,expression:l}}M(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&$n.is(l.range)&&(ot.string(l.expression)||l.expression===void 0)}M(a,"is"),i.is=a})(qU||(qU={})),(function(i){function s(o,l){return{frameId:o,stoppedLocation:l}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.defined(l)&&$n.is(o.stoppedLocation)}M(a,"is"),i.is=a})(UU||(UU={})),(function(i){i.Type=1,i.Parameter=2;function s(a){return a===1||a===2}M(s,"is"),i.is=s})(bR||(bR={})),(function(i){function s(o){return{value:o}}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&(l.tooltip===void 0||ot.string(l.tooltip)||L2.is(l.tooltip))&&(l.location===void 0||gk.is(l.location))&&(l.command===void 0||Qm.is(l.command))}M(a,"is"),i.is=a})(xR||(xR={})),(function(i){function s(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}M(s,"create"),i.create=s;function a(o){const l=o;return ot.objectLiteral(l)&&oi.is(l.position)&&(ot.string(l.label)||ot.typedArray(l.label,xR.is))&&(l.kind===void 0||bR.is(l.kind))&&l.textEdits===void 0||ot.typedArray(l.textEdits,Xh.is)&&(l.tooltip===void 0||ot.string(l.tooltip)||L2.is(l.tooltip))&&(l.paddingLeft===void 0||ot.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ot.boolean(l.paddingRight))}M(a,"is"),i.is=a})(YU||(YU={})),(function(i){function s(a){return{kind:"snippet",value:a}}M(s,"createSnippet"),i.createSnippet=s})(jU||(jU={})),(function(i){function s(a,o,l,u){return{insertText:a,filterText:o,range:l,command:u}}M(s,"create"),i.create=s})(XU||(XU={})),(function(i){function s(a){return{items:a}}M(s,"create"),i.create=s})(KU||(KU={})),(function(i){i.Invoked=0,i.Automatic=1})(ZU||(ZU={})),(function(i){function s(a,o){return{range:a,text:o}}M(s,"create"),i.create=s})(QU||(QU={})),(function(i){function s(a,o){return{triggerKind:a,selectedCompletionInfo:o}}M(s,"create"),i.create=s})(JU||(JU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&pR.is(o.uri)&&ot.string(o.name)}M(s,"is"),i.is=s})(eY||(eY={})),SIe=[` `,`\r -`,"\r"],(function(i){function s(u,h,d,f){return new Zpe(u,h,d,f)}M(s,"create"),i.create=s;function a(u){let h=u;return!!(ot.defined(h)&&ot.string(h.uri)&&(ot.undefined(h.languageId)||ot.string(h.languageId))&&ot.uinteger(h.lineCount)&&ot.func(h.getText)&&ot.func(h.positionAt)&&ot.func(h.offsetAt))}M(a,"is"),i.is=a;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}M(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}M(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g0&&s.push(a.length),this._lineOffsets=s}return this._lineOffsets}positionAt(s){s=Math.max(Math.min(s,this._content.length),0);let a=this.getLineOffsets(),o=0,l=a.length;if(l===0)return ai.create(0,s);for(;os?l=h:o=h+1}let u=o-1;return ai.create(u,s-a[u])}offsetAt(s){let a=this.getLineOffsets();if(s.line>=a.length)return this._content.length;if(s.line<0)return 0;let o=a[s.line],l=s.line+1"u"}M(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}M(l,"boolean"),i.boolean=l;function u(v){return s.call(v)==="[object String]"}M(u,"string"),i.string=u;function h(v){return s.call(v)==="[object Number]"}M(h,"number"),i.number=h;function d(v,x,b){return s.call(v)==="[object Number]"&&x<=v&&v<=b}M(d,"numberRange"),i.numberRange=d;function f(v){return s.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}M(f,"integer"),i.integer=f;function p(v){return s.call(v)==="[object Number]"&&0<=v&&v<=2147483647}M(p,"uinteger"),i.uinteger=p;function g(v){return s.call(v)==="[object Function]"}M(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}M(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}M(y,"typedArray"),i.typedArray=y})(ot||(ot={}))}}),av=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}M(r,"RAL"),(function(n){function i(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");e=s}M(i,"install"),n.install=i})(r||(r={})),t.default=r}}),M7=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}M(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}M(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}M(n,"number"),t.number=n;function i(l){return l instanceof Error}M(i,"error"),t.error=i;function s(l){return typeof l=="function"}M(s,"func"),t.func=s;function a(l){return Array.isArray(l)}M(a,"array"),t.array=a;function o(l){return a(l)&&l.every(u=>r(u))}M(o,"stringArray"),t.stringArray=o}}),E3=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=av(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(s=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:M(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:M(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=a._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},M(a,"Emitter"),a);t.Emitter=i,i._noop=function(){}}}),pO=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=av(),r=M7(),n=E3(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}M(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var s=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),a=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},M(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=i.None}},M(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),xIe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me,te,_e,$e,Fe;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=M7(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(N=class extends Error{constructor(he,Te,ge){super(Te),this.code=e.number(he)?he:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,N.prototype)}toJson(){const he={code:this.code,message:this.message};return this.data!==void 0&&(he.data=this.data),he}},M(N,"ResponseError"),N);t.ResponseError=n;var i=(L=class{constructor(he){this.kind=he}static is(he){return he===L.auto||he===L.byName||he===L.byPosition}toString(){return this.kind}},M(L,"ParameterStructures"),L);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var s=(I=class{constructor(he,Te){this.method=he,this.numberOfParams=Te}get parameterStructures(){return i.auto}},M(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=s;var a=($=class extends s{constructor(he){super(he,0)}},M($,"RequestType0"),$);t.RequestType0=a;var o=(O=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(O,"RequestType"),O);t.RequestType=o;var l=(D=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(D,"RequestType1"),D);t.RequestType1=l;var u=(F=class extends s{constructor(he){super(he,2)}},M(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends s{constructor(he){super(he,3)}},M(z,"RequestType3"),z);t.RequestType3=h;var d=(V=class extends s{constructor(he){super(he,4)}},M(V,"RequestType4"),V);t.RequestType4=d;var f=(B=class extends s{constructor(he){super(he,5)}},M(B,"RequestType5"),B);t.RequestType5=f;var p=(H=class extends s{constructor(he){super(he,6)}},M(H,"RequestType6"),H);t.RequestType6=p;var g=(G=class extends s{constructor(he){super(he,7)}},M(G,"RequestType7"),G);t.RequestType7=g;var m=(W=class extends s{constructor(he){super(he,8)}},M(W,"RequestType8"),W);t.RequestType8=m;var y=(K=class extends s{constructor(he){super(he,9)}},M(K,"RequestType9"),K);t.RequestType9=y;var v=(q=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(q,"NotificationType"),q);t.NotificationType=v;var x=(oe=class extends s{constructor(he){super(he,0)}},M(oe,"NotificationType0"),oe);t.NotificationType0=x;var b=(Q=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(Q,"NotificationType1"),Q);t.NotificationType1=b;var T=(Z=class extends s{constructor(he){super(he,2)}},M(Z,"NotificationType2"),Z);t.NotificationType2=T;var C=(re=class extends s{constructor(he){super(he,3)}},M(re,"NotificationType3"),re);t.NotificationType3=C;var S=(ie=class extends s{constructor(he){super(he,4)}},M(ie,"NotificationType4"),ie);t.NotificationType4=S;var k=(me=class extends s{constructor(he){super(he,5)}},M(me,"NotificationType5"),me);t.NotificationType5=k;var E=(te=class extends s{constructor(he){super(he,6)}},M(te,"NotificationType6"),te);t.NotificationType6=E;var A=(_e=class extends s{constructor(he){super(he,7)}},M(_e,"NotificationType7"),_e);t.NotificationType7=A;var R=($e=class extends s{constructor(he){super(he,8)}},M($e,"NotificationType8"),$e);t.NotificationType8=R;var _=(Fe=class extends s{constructor(he){super(he,9)}},M(Fe,"NotificationType9"),Fe);t.NotificationType9=_;var P;(function(ce){function he(He){const we=He;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}M(he,"isRequest"),ce.isRequest=he;function Te(He){const we=He;return we&&e.string(we.method)&&He.id===void 0}M(Te,"isNotification"),ce.isNotification=Te;function ge(He){const we=He;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}M(ge,"isResponse"),ce.isResponse=ge})(P||(t.Message=P={}))}}),wIe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var s,a;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(s=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:M(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:M(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:M(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},M(s,"LinkedMap"),s);t.LinkedMap=n;var i=(a=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},M(a,"LRUCache"),a);t.LRUCache=i}}),GKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}M(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),WKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=pO(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},M(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},M(l,"SharedArrayBufferCancellationToken"),l),s=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},M(u,"SharedArrayBufferCancellationTokenSource"),u),a=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new s(p)}},M(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=a}}),TIe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=av(),r=(n=class{constructor(s=1){if(s<=0)throw new Error("Capacity must be greater than 0");this._capacity=s,this._active=0,this._waiting=[]}lock(s){return new Promise((a,o)=>{this._waiting.push({thunk:s,resolve:a,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const s=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=s.thunk();a instanceof Promise?a.then(o=>{this._active--,s.resolve(o),this.runNext()},o=>{this._active--,s.reject(o),this.runNext()}):(this._active--,s.resolve(a),this.runNext())}catch(a){this._active--,s.reject(a),this.runNext()}}},M(n,"Semaphore"),n);t.Semaphore=r}}),qKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=av(),r=M7(),n=E3(),i=TIe(),s;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}M(f,"is"),d.is=f})(s||(t.MessageReader=s={}));var a=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},M(u,"AbstractMessageReader"),u);t.AbstractMessageReader=a;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}M(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends a{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},M(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),UKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=av(),r=M7(),n=TIe(),i=E3(),s="Content-Length: ",a=`\r -`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}M(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},M(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}M(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(s,y.byteLength.toString(),a),v.push(a),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},M(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),YKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r +`&&l++}o&&a.length>0&&s.push(a.length),this._lineOffsets=s}return this._lineOffsets}positionAt(s){s=Math.max(Math.min(s,this._content.length),0);let a=this.getLineOffsets(),o=0,l=a.length;if(l===0)return oi.create(0,s);for(;os?l=h:o=h+1}let u=o-1;return oi.create(u,s-a[u])}offsetAt(s){let a=this.getLineOffsets();if(s.line>=a.length)return this._content.length;if(s.line<0)return 0;let o=a[s.line],l=s.line+1"u"}M(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}M(l,"boolean"),i.boolean=l;function u(v){return s.call(v)==="[object String]"}M(u,"string"),i.string=u;function h(v){return s.call(v)==="[object Number]"}M(h,"number"),i.number=h;function d(v,x,b){return s.call(v)==="[object Number]"&&x<=v&&v<=b}M(d,"numberRange"),i.numberRange=d;function f(v){return s.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}M(f,"integer"),i.integer=f;function p(v){return s.call(v)==="[object Number]"&&0<=v&&v<=2147483647}M(p,"uinteger"),i.uinteger=p;function g(v){return s.call(v)==="[object Function]"}M(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}M(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}M(y,"typedArray"),i.typedArray=y})(ot||(ot={}))}}),lv=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}M(r,"RAL"),(function(n){function i(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");e=s}M(i,"install"),n.install=i})(r||(r={})),t.default=r}}),L7=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}M(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}M(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}M(n,"number"),t.number=n;function i(l){return l instanceof Error}M(i,"error"),t.error=i;function s(l){return typeof l=="function"}M(s,"func"),t.func=s;function a(l){return Array.isArray(l)}M(a,"array"),t.array=a;function o(l){return a(l)&&l.every(u=>r(u))}M(o,"stringArray"),t.stringArray=o}}),R3=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=lv(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(s=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:M(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:M(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=a._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},M(a,"Emitter"),a);t.Emitter=i,i._noop=function(){}}}),yO=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=lv(),r=L7(),n=R3(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}M(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var s=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),a=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},M(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=i.None}},M(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),EIe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var N,L,I,$,O,D,F,z,V,B,H,G,W,K,q,oe,Q,Z,re,ie,me,te,_e,$e,Fe;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=L7(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(N=class extends Error{constructor(he,Te,ge){super(Te),this.code=e.number(he)?he:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,N.prototype)}toJson(){const he={code:this.code,message:this.message};return this.data!==void 0&&(he.data=this.data),he}},M(N,"ResponseError"),N);t.ResponseError=n;var i=(L=class{constructor(he){this.kind=he}static is(he){return he===L.auto||he===L.byName||he===L.byPosition}toString(){return this.kind}},M(L,"ParameterStructures"),L);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var s=(I=class{constructor(he,Te){this.method=he,this.numberOfParams=Te}get parameterStructures(){return i.auto}},M(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=s;var a=($=class extends s{constructor(he){super(he,0)}},M($,"RequestType0"),$);t.RequestType0=a;var o=(O=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(O,"RequestType"),O);t.RequestType=o;var l=(D=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(D,"RequestType1"),D);t.RequestType1=l;var u=(F=class extends s{constructor(he){super(he,2)}},M(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends s{constructor(he){super(he,3)}},M(z,"RequestType3"),z);t.RequestType3=h;var d=(V=class extends s{constructor(he){super(he,4)}},M(V,"RequestType4"),V);t.RequestType4=d;var f=(B=class extends s{constructor(he){super(he,5)}},M(B,"RequestType5"),B);t.RequestType5=f;var p=(H=class extends s{constructor(he){super(he,6)}},M(H,"RequestType6"),H);t.RequestType6=p;var g=(G=class extends s{constructor(he){super(he,7)}},M(G,"RequestType7"),G);t.RequestType7=g;var m=(W=class extends s{constructor(he){super(he,8)}},M(W,"RequestType8"),W);t.RequestType8=m;var y=(K=class extends s{constructor(he){super(he,9)}},M(K,"RequestType9"),K);t.RequestType9=y;var v=(q=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(q,"NotificationType"),q);t.NotificationType=v;var x=(oe=class extends s{constructor(he){super(he,0)}},M(oe,"NotificationType0"),oe);t.NotificationType0=x;var b=(Q=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},M(Q,"NotificationType1"),Q);t.NotificationType1=b;var T=(Z=class extends s{constructor(he){super(he,2)}},M(Z,"NotificationType2"),Z);t.NotificationType2=T;var C=(re=class extends s{constructor(he){super(he,3)}},M(re,"NotificationType3"),re);t.NotificationType3=C;var S=(ie=class extends s{constructor(he){super(he,4)}},M(ie,"NotificationType4"),ie);t.NotificationType4=S;var k=(me=class extends s{constructor(he){super(he,5)}},M(me,"NotificationType5"),me);t.NotificationType5=k;var E=(te=class extends s{constructor(he){super(he,6)}},M(te,"NotificationType6"),te);t.NotificationType6=E;var A=(_e=class extends s{constructor(he){super(he,7)}},M(_e,"NotificationType7"),_e);t.NotificationType7=A;var R=($e=class extends s{constructor(he){super(he,8)}},M($e,"NotificationType8"),$e);t.NotificationType8=R;var _=(Fe=class extends s{constructor(he){super(he,9)}},M(Fe,"NotificationType9"),Fe);t.NotificationType9=_;var P;(function(ce){function he(He){const we=He;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}M(he,"isRequest"),ce.isRequest=he;function Te(He){const we=He;return we&&e.string(we.method)&&He.id===void 0}M(Te,"isNotification"),ce.isNotification=Te;function ge(He){const we=He;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}M(ge,"isResponse"),ce.isResponse=ge})(P||(t.Message=P={}))}}),AIe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var s,a;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(s=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:M(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:M(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:M(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},M(s,"LinkedMap"),s);t.LinkedMap=n;var i=(a=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},M(a,"LRUCache"),a);t.LRUCache=i}}),sZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}M(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),aZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=yO(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},M(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},M(l,"SharedArrayBufferCancellationToken"),l),s=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},M(u,"SharedArrayBufferCancellationTokenSource"),u),a=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new s(p)}},M(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=a}}),MIe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=lv(),r=(n=class{constructor(s=1){if(s<=0)throw new Error("Capacity must be greater than 0");this._capacity=s,this._active=0,this._waiting=[]}lock(s){return new Promise((a,o)=>{this._waiting.push({thunk:s,resolve:a,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const s=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=s.thunk();a instanceof Promise?a.then(o=>{this._active--,s.resolve(o),this.runNext()},o=>{this._active--,s.reject(o),this.runNext()}):(this._active--,s.resolve(a),this.runNext())}catch(a){this._active--,s.reject(a),this.runNext()}}},M(n,"Semaphore"),n);t.Semaphore=r}}),oZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=lv(),r=L7(),n=R3(),i=MIe(),s;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}M(f,"is"),d.is=f})(s||(t.MessageReader=s={}));var a=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},M(u,"AbstractMessageReader"),u);t.AbstractMessageReader=a;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}M(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends a{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},M(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),lZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=lv(),r=L7(),n=MIe(),i=R3(),s="Content-Length: ",a=`\r +`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}M(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},M(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}M(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(s,y.byteLength.toString(),a),v.push(a),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},M(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),cZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(s=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},M(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),jKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;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=av(),r=M7(),n=xIe(),i=wIe(),s=E3(),a=pO(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}M($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}M($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=x;var b;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}M($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}M($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}M($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}M($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var R;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||A.is(D.messageStrategy))}M($,"is"),I.is=$})(R||(t.ConnectionOptions=R={}));var _;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(_||(_={}));function P(I,$,O,D){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Q,Z=new i.LinkedMap,re=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Fe=_.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,He=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Me(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}M(Me,"createRequestQueueKey");function je(Ee){return Ee===null?"res-unknown-"+(++B).toString():"res-"+Ee.toString()}M(je,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}M(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Me(it.id),it):n.Message.isResponse(it)?Ee.set(je(it.id),it):Ee.set(le(),it)}M(pe,"addMessageToQueue");function Ce(Ee){}M(Ce,"cancelUndispatched");function ne(){return Fe===_.Listening}M(ne,"isListening");function j(){return Fe===_.Closed}M(j,"isClosed");function J(){return Fe===_.Disposed}M(J,"isDisposed");function ue(){(Fe===_.New||Fe===_.Listening)&&(Fe=_.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}M(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Q||Z.size===0||(Q=(0,e.default)().timer.setImmediate(()=>{Q=void 0,Re()}))}M(ee,"triggerMessageQueue");function Ae(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?De(Ee):n.Message.isResponse(Ee)?qe(Ee):Ke(Ee)}M(Ae,"handleMessage");function Re(){if(Z.size===0)return;const Ee=Z.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Ae):Ae(Ee)}finally{ee()}}M(Re,"processMessageQueue");const Xe=M(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,gt=Me(it),xt=Z.get(gt);if(n.Message.isRequest(xt)){const $r=D==null?void 0:D.connectionStrategy,Cr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(xt,Ce):void 0;if(Cr&&(Cr.error!==void 0||Cr.result!==void 0)){Z.delete(gt),me.delete(it),Cr.id=xt.id,mt(Cr,Ee.method,Date.now()),$.write(Cr).catch(()=>F.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),St(Ee);return}else ie.add(it)}pe(Z,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Tr){const Yr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?Yr.error=Er.toJson():Yr.result=Er===void 0?null:Er,mt(Yr,nn,Tr),$.write(Yr).catch(()=>F.error("Sending response failed."))}M(it,"reply");function gt(Er,nn,Tr){const Yr={jsonrpc:H,id:Ee.id,error:Er.toJson()};mt(Yr,nn,Tr),$.write(Yr).catch(()=>F.error("Sending response failed."))}M(gt,"replyError");function xt(Er,nn,Tr){Er===void 0&&(Er=null);const Yr={jsonrpc:H,id:Ee.id,result:Er};mt(Yr,nn,Tr),$.write(Yr).catch(()=>F.error("Sending response failed."))}M(xt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,Cr;nr&&($r=nr.type,Cr=nr.handler);const Ur=Date.now();if(Cr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Tr;if(Cr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,Ur);return}Tr=Cr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,Ur);return}Tr=Cr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,Ur);return}Tr=Cr(Ee.params,nn.token)}else G&&(Tr=G(Ee.method,Ee.params,nn.token));const Yr=Tr;Tr?Yr.then?Yr.then(wn=>{me.delete(Er),it(wn,Ee.method,Ur)},wn=>{me.delete(Er),wn instanceof n.ResponseError?gt(wn,Ee.method,Ur):wn&&r.string(wn.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${wn.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}):(me.delete(Er),it(Tr,Ee.method,Ur)):(me.delete(Er),xt(Tr,Ee.method,Ur))}catch(Tr){me.delete(Er),Tr instanceof n.ResponseError?it(Tr,Ee.method,Ur):Tr&&r.string(Tr.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Tr.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}}else gt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,Ur)}M(Ne,"handleRequest");function qe(Ee){if(!J())if(Ee.id===null)Ee.error?F.error(`Received response message without id: Error is: +${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},M(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),uZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;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=lv(),r=L7(),n=EIe(),i=AIe(),s=R3(),a=yO(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}M($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}M($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=x;var b;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}M($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}M($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}M($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}M($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var R;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||A.is(D.messageStrategy))}M($,"is"),I.is=$})(R||(t.ConnectionOptions=R={}));var _;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(_||(_={}));function P(I,$,O,D){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Q,Z=new i.LinkedMap,re=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Fe=_.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,He=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Me(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}M(Me,"createRequestQueueKey");function je(Ee){return Ee===null?"res-unknown-"+(++B).toString():"res-"+Ee.toString()}M(je,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}M(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Me(it.id),it):n.Message.isResponse(it)?Ee.set(je(it.id),it):Ee.set(le(),it)}M(pe,"addMessageToQueue");function Ce(Ee){}M(Ce,"cancelUndispatched");function ne(){return Fe===_.Listening}M(ne,"isListening");function j(){return Fe===_.Closed}M(j,"isClosed");function J(){return Fe===_.Disposed}M(J,"isDisposed");function ue(){(Fe===_.New||Fe===_.Listening)&&(Fe=_.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}M(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Q||Z.size===0||(Q=(0,e.default)().timer.setImmediate(()=>{Q=void 0,Re()}))}M(ee,"triggerMessageQueue");function Ae(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?De(Ee):n.Message.isResponse(Ee)?qe(Ee):Ke(Ee)}M(Ae,"handleMessage");function Re(){if(Z.size===0)return;const Ee=Z.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Ae):Ae(Ee)}finally{ee()}}M(Re,"processMessageQueue");const Xe=M(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,gt=Me(it),xt=Z.get(gt);if(n.Message.isRequest(xt)){const $r=D==null?void 0:D.connectionStrategy,kr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(xt,Ce):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){Z.delete(gt),me.delete(it),kr.id=xt.id,mt(kr,Ee.method,Date.now()),$.write(kr).catch(()=>F.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),St(Ee);return}else ie.add(it)}pe(Z,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Cr){const Yr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?Yr.error=Er.toJson():Yr.result=Er===void 0?null:Er,mt(Yr,nn,Cr),$.write(Yr).catch(()=>F.error("Sending response failed."))}M(it,"reply");function gt(Er,nn,Cr){const Yr={jsonrpc:H,id:Ee.id,error:Er.toJson()};mt(Yr,nn,Cr),$.write(Yr).catch(()=>F.error("Sending response failed."))}M(gt,"replyError");function xt(Er,nn,Cr){Er===void 0&&(Er=null);const Yr={jsonrpc:H,id:Ee.id,result:Er};mt(Yr,nn,Cr),$.write(Yr).catch(()=>F.error("Sending response failed."))}M(xt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,kr;nr&&($r=nr.type,kr=nr.handler);const Ur=Date.now();if(kr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Cr;if(kr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,Ur);return}Cr=kr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,Ur);return}Cr=kr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,Ur);return}Cr=kr(Ee.params,nn.token)}else G&&(Cr=G(Ee.method,Ee.params,nn.token));const Yr=Cr;Cr?Yr.then?Yr.then(wn=>{me.delete(Er),it(wn,Ee.method,Ur)},wn=>{me.delete(Er),wn instanceof n.ResponseError?gt(wn,Ee.method,Ur):wn&&r.string(wn.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${wn.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}):(me.delete(Er),it(Cr,Ee.method,Ur)):(me.delete(Er),xt(Cr,Ee.method,Ur))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Ee.method,Ur):Cr&&r.string(Cr.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Cr.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}}else gt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,Ur)}M(Ne,"handleRequest");function qe(Ee){if(!J())if(Ee.id===null)Ee.error?F.error(`Received response message without id: Error is: ${JSON.stringify(Ee.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const it=Ee.id,gt=re.get(it);if(At(Ee,gt),gt!==void 0){re.delete(it);try{if(Ee.error){const xt=Ee.error;gt.reject(new n.ResponseError(xt.code,xt.message,xt.data))}else if(Ee.result!==void 0)gt.resolve(Ee.result);else throw new Error("Should never happen.")}catch(xt){xt.message?F.error(`Response handler '${gt.method}' failed with message: ${xt.message}`):F.error(`Response handler '${gt.method}' failed unexpectedly.`)}}}}M(qe,"handleResponse");function De(Ee){if(J())return;let it,gt;if(Ee.method===o.type.method){const xt=Ee.params.id;ie.delete(xt),St(Ee);return}else{const xt=q.get(Ee.method);xt&&(gt=xt.handler,it=xt.type)}if(gt||K)try{if(St(Ee),gt)if(Ee.params===void 0)it!==void 0&&it.numberOfParams!==0&&it.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received none.`),gt();else if(Array.isArray(Ee.params)){const xt=Ee.params;Ee.method===u.type.method&&xt.length===2&&l.is(xt[0])?gt({token:xt[0],value:xt[1]}):(it!==void 0&&(it.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Ee.method} defines parameters by name but received parameters by position`),it.numberOfParams!==Ee.params.length&&F.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received ${xt.length} arguments`)),gt(...xt))}else it!==void 0&&it.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Ee.method} defines parameters by position but received parameters by name`),gt(Ee.params);else K&&K(Ee.method,Ee.params)}catch(xt){xt.message?F.error(`Notification handler '${Ee.method}' failed with message: ${xt.message}`):F.error(`Notification handler '${Ee.method}' failed unexpectedly.`)}else Te.fire(Ee)}M(De,"handleNotification");function Ke(Ee){if(!Ee){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Ee,null,4)}`);const it=Ee;if(r.string(it.id)||r.number(it.id)){const gt=it.id,xt=re.get(gt);xt&&xt.reject(new Error("The received response has neither a result nor an error property."))}}M(Ke,"handleInvalidMessage");function ze(Ee){if(Ee!=null)switch(te){case f.Verbose:return JSON.stringify(Ee,null,4);case f.Compact:return JSON.stringify(Ee);default:return}}M(ze,"stringifyTrace");function st(Ee){if(!(te===f.Off||!$e))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Ee.params&&(it=`Params: ${ze(Ee.params)} @@ -3439,69 +3446,69 @@ ${JSON.stringify(Ee,null,4)}`);const it=Ee;if(r.string(it.id)||r.number(it.id)){ `:Ee.error===void 0&&(gt=`No result returned. -`)),it){const xt=Ee.error?` Request failed: ${Ee.error.message} (${Ee.error.code}).`:"";$e.log(`Received response '${it.method} - (${Ee.id})' in ${Date.now()-it.timerStart}ms.${xt}`,gt)}else $e.log(`Received response ${Ee.id} without active response promise.`,gt)}else lt("receive-response",Ee)}M(At,"traceReceivedResponse");function lt(Ee,it){if(!$e||te===f.Off)return;const gt={isLSPMessage:!0,type:Ee,message:it,timestamp:Date.now()};$e.log(gt)}M(lt,"logLSPMessage");function zt(){if(j())throw new x(v.Closed,"Connection is closed.");if(J())throw new x(v.Disposed,"Connection is disposed.")}M(zt,"throwIfClosedOrDisposed");function It(){if(ne())throw new x(v.AlreadyListening,"Connection is already listening")}M(It,"throwIfListening");function ft(){if(!ne())throw new Error("Call listen() first.")}M(ft,"throwIfNotListening");function xe(Ee){return Ee===void 0?null:Ee}M(xe,"undefinedToNull");function Nt(Ee){if(Ee!==null)return Ee}M(Nt,"nullToUndefined");function Tt(Ee){return Ee!=null&&!Array.isArray(Ee)&&typeof Ee=="object"}M(Tt,"isNamedParam");function yt(Ee,it){switch(Ee){case n.ParameterStructures.auto:return Tt(it)?Nt(it):[xe(it)];case n.ParameterStructures.byName:if(!Tt(it))throw new Error("Received parameters by name but param is not an object literal.");return Nt(it);case n.ParameterStructures.byPosition:return[xe(it)];default:throw new Error(`Unknown parameter structure ${Ee.toString()}`)}}M(yt,"computeSingleParam");function Rt(Ee,it){let gt;const xt=Ee.numberOfParams;switch(xt){case 0:gt=void 0;break;case 1:gt=yt(Ee.parameterStructures,it[0]);break;default:gt=[];for(let nr=0;nr{zt();let gt,xt;if(r.string(Ee)){gt=Ee;const $r=it[0];let Cr=0,Ur=n.ParameterStructures.auto;n.ParameterStructures.is($r)&&(Cr=1,Ur=$r);let Er=it.length;const nn=Er-Cr;switch(nn){case 0:xt=void 0;break;case 1:xt=yt(Ur,it[Cr]);break;default:if(Ur===n.ParameterStructures.byName)throw new Error(`Received ${nn} parameters for 'by Name' notification parameter structure.`);xt=it.slice(Cr,Er).map(Tr=>xe(Tr));break}}else{const $r=it;gt=Ee.method,xt=Rt(Ee,$r)}const nr={jsonrpc:H,method:gt,params:xt};return Oe(nr),$.write(nr).catch($r=>{throw F.error("Sending notification failed."),$r})},"sendNotification"),onNotification:M((Ee,it)=>{zt();let gt;return r.func(Ee)?K=Ee:it&&(r.string(Ee)?(gt=Ee,q.set(Ee,{type:void 0,handler:it})):(gt=Ee.method,q.set(Ee.method,{type:Ee,handler:it}))),{dispose:M(()=>{gt!==void 0?q.delete(gt):K=void 0},"dispose")}},"onNotification"),onProgress:M((Ee,it,gt)=>{if(oe.has(it))throw new Error(`Progress handler for token ${it} already registered`);return oe.set(it,gt),{dispose:M(()=>{oe.delete(it)},"dispose")}},"onProgress"),sendProgress:M((Ee,it,gt)=>Or.sendNotification(u.type,{token:it,value:gt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:M((Ee,...it)=>{zt(),ft();let gt,xt,nr;if(r.string(Ee)){gt=Ee;const Er=it[0],nn=it[it.length-1];let Tr=0,Yr=n.ParameterStructures.auto;n.ParameterStructures.is(Er)&&(Tr=1,Yr=Er);let wn=it.length;a.CancellationToken.is(nn)&&(wn=wn-1,nr=nn);const ht=wn-Tr;switch(ht){case 0:xt=void 0;break;case 1:xt=yt(Yr,it[Tr]);break;default:if(Yr===n.ParameterStructures.byName)throw new Error(`Received ${ht} parameters for 'by Name' request parameter structure.`);xt=it.slice(Tr,wn).map(vt=>xe(vt));break}}else{const Er=it;gt=Ee.method,xt=Rt(Ee,Er);const nn=Ee.numberOfParams;nr=a.CancellationToken.is(Er[nn])?Er[nn]:void 0}const $r=z++;let Cr;nr&&(Cr=nr.onCancellationRequested(()=>{const Er=we.sender.sendCancellation(Or,$r);return Er===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${$r}`),Promise.resolve()):Er.catch(()=>{F.log(`Sending cancellation messages for id ${$r} failed`)})}));const Ur={jsonrpc:H,id:$r,method:gt,params:xt};return st(Ur),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(Ur),new Promise(async(Er,nn)=>{const Tr=M(ht=>{Er(ht),we.sender.cleanup($r),Cr==null||Cr.dispose()},"resolveWithCleanup"),Yr=M(ht=>{nn(ht),we.sender.cleanup($r),Cr==null||Cr.dispose()},"rejectWithCleanup"),wn={method:gt,timerStart:Date.now(),resolve:Tr,reject:Yr};try{await $.write(Ur),re.set($r,wn)}catch(ht){throw F.error("Sending request failed."),wn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,ht.message?ht.message:"Unknown reason")),ht}})},"sendRequest"),onRequest:M((Ee,it)=>{zt();let gt=null;return d.is(Ee)?(gt=void 0,G=Ee):r.string(Ee)?(gt=null,it!==void 0&&(gt=Ee,W.set(Ee,{handler:it,type:void 0}))):it!==void 0&&(gt=Ee.method,W.set(Ee.method,{type:Ee,handler:it})),{dispose:M(()=>{gt!==null&&(gt!==void 0?W.delete(gt):G=void 0)},"dispose")}},"onRequest"),hasPendingResponse:M(()=>re.size>0,"hasPendingResponse"),trace:M(async(Ee,it,gt)=>{let xt=!1,nr=g.Text;gt!==void 0&&(r.boolean(gt)?xt=gt:(xt=gt.sendNotification||!1,nr=gt.traceFormat||g.Text)),te=Ee,_e=nr,te===f.Off?$e=void 0:$e=it,xt&&!j()&&!J()&&await Or.sendNotification(m.type,{value:f.toString(Ee)})},"trace"),onError:ce.event,onClose:he.event,onUnhandledNotification:Te.event,onDispose:He.event,end:M(()=>{$.end()},"end"),dispose:M(()=>{if(J())return;Fe=_.Disposed,He.fire(void 0);const Ee=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const it of re.values())it.reject(Ee);re=new Map,me=new Map,ie=new Set,Z=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:M(()=>{zt(),It(),Fe=_.Listening,I.listen(Xe)},"listen"),inspect:M(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Or.onNotification(y.type,Ee=>{if(te===f.Off||!$e)return;const it=te===f.Verbose||te===f.Compact;$e.log(Ee.message,it?Ee.verbose:void 0)}),Or.onNotification(u.type,Ee=>{const it=oe.get(Ee.token);it?it(Ee.value):ge.fire(Ee)}),Or}M(P,"createMessageConnection"),t.createMessageConnection=P}}),QU=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=xIe();Object.defineProperty(t,"Message",{enumerable:!0,get:M(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:M(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:M(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:M(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:M(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:M(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:M(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:M(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:M(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:M(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:M(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:M(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:M(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:M(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:M(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:M(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:M(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:M(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:M(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:M(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:M(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:M(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:M(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:M(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:M(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:M(function(){return e.ParameterStructures},"get")});var r=wIe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:M(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:M(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:M(function(){return r.Touch},"get")});var n=GKt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:M(function(){return n.Disposable},"get")});var i=E3();Object.defineProperty(t,"Event",{enumerable:!0,get:M(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:M(function(){return i.Emitter},"get")});var s=pO();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:M(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:M(function(){return s.CancellationToken},"get")});var a=WKt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:M(function(){return a.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:M(function(){return a.SharedArrayReceiverStrategy},"get")});var o=qKt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:M(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:M(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:M(function(){return o.ReadableStreamMessageReader},"get")});var l=UKt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:M(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:M(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:M(function(){return l.WriteableStreamMessageWriter},"get")});var u=YKt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:M(function(){return u.AbstractMessageBuffer},"get")});var h=jKt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:M(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:M(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:M(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:M(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:M(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:M(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:M(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:M(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:M(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:M(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:M(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:M(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:M(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:M(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:M(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:M(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:M(function(){return h.MessageStrategy},"get")});var d=av();t.RAL=d.default}}),XKt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=QU(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},M(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},M(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},M(h,"WritableStreamWrapper"),h),s=new TextEncoder,a=Object.freeze({messageBuffer:Object.freeze({create:M(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:M((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(s.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:M((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:M(d=>new n(d),"asReadableStream"),asWritableStream:M(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:M(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:M(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:M(()=>clearInterval(g),"dispose")}}})});function o(){return a}M(o,"RIL"),(function(d){function f(){e.RAL.install(a)}M(f,"install"),d.install=f})(o||(o={})),t.default=o}}),A3=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:M(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=XKt();n.default.install();var i=QU();r(QU(),t);var s=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},M(l,"BrowserMessageReader"),l);t.BrowserMessageReader=s;var a=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},M(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=a;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}M(o,"createMessageConnection"),t.createMessageConnection=o}}),Qpe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=A3()}}),Es=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=A3(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},M(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},M(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var s=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},M(h,"ProtocolRequestType"),h);t.ProtocolRequestType=s;var a=(d=class extends e.NotificationType0{constructor(g){super(g)}},M(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=a;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},M(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),wee=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}M(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}M(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}M(n,"number"),t.number=n;function i(h){return h instanceof Error}M(i,"error"),t.error=i;function s(h){return typeof h=="function"}M(s,"func"),t.func=s;function a(h){return Array.isArray(h)}M(a,"array"),t.array=a;function o(h){return a(h)&&h.every(d=>r(d))}M(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}M(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}M(u,"objectLiteral"),t.objectLiteral=u}}),KKt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),ZKt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),QKt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Es(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),JKt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Es(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),eZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Es(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),tZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Es(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),rZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),nZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),iZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=A3(),r=Es(),n;(function(a){a.type=new e.ProgressType;function o(l){return l===a.type}M(o,"is"),a.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=r.MessageDirection.serverToClient,a.type=new r.ProtocolRequestType(a.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var s;(function(a){a.method="window/workDoneProgress/cancel",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolNotificationType(a.method)})(s||(t.WorkDoneProgressCancelNotification=s={}))}}),sZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Es(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),aZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Es(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var s;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensDeltaRequest=s={}));var a;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensRangeRequest=a={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),oZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Es(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),lZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),cZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Es(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var s;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(s||(t.WillRenameFilesRequest=s={}));var a;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(a||(t.DidRenameFilesNotification=a={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),uZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Es(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(t.MonikerKind=n={}));var i;(function(s){s.method="textDocument/moniker",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.MonikerRequest=i={}))}}),hZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Es(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),dZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Es(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),fZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Es(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType0(s.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),pZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=A3(),r=wee(),n=Es(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}M(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var s;(function(u){u.Full="full",u.Unchanged="unchanged"})(s||(t.DocumentDiagnosticReportKind=s={}));var a;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(a||(t.DocumentDiagnosticRequest=a={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),gZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(A7(),xee(fO)),r=wee(),n=Es(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}M(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var s;(function(g){function m(x,b){const T={executionOrder:x};return(b===!0||b===!1)&&(T.success=b),T}M(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}M(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}M(v,"equals"),g.equals=v})(s||(t.ExecutionSummary=s={}));var a;(function(g){function m(b,T){return{kind:b,document:T}}M(m,"create"),g.create=m;function y(b){const T=b;return r.objectLiteral(T)&&i.is(T.kind)&&e.DocumentUri.is(T.document)&&(T.metadata===void 0||r.objectLiteral(T.metadata))}M(y,"is"),g.is=y;function v(b,T){const C=new Set;return b.document!==T.document&&C.add("document"),b.kind!==T.kind&&C.add("kind"),b.executionSummary!==T.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||T.metadata!==void 0)&&!x(b.metadata,T.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||T.executionSummary!==void 0)&&!s.equals(b.executionSummary,T.executionSummary)&&C.add("executionSummary"),C}M(v,"diff"),g.diff=v;function x(b,T){if(b===T)return!0;if(b==null||T===null||T===void 0||typeof b!=typeof T||typeof b!="object")return!1;const C=Array.isArray(b),S=Array.isArray(T);if(C!==S)return!1;if(C&&S){if(b.length!==T.length)return!1;for(let k=0;k0}M(Nt,"hasId"),xe.hasId=Nt})(D||(t.StaticRegistrationOptions=D={}));var F;(function(xe){function Nt(Tt){const yt=Tt;return yt&&(yt.documentSelector===null||P.is(yt.documentSelector))}M(Nt,"is"),xe.is=Nt})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(xe){function Nt(yt){const Rt=yt;return n.objectLiteral(Rt)&&(Rt.workDoneProgress===void 0||n.boolean(Rt.workDoneProgress))}M(Nt,"is"),xe.is=Nt;function Tt(yt){const Rt=yt;return Rt&&n.boolean(Rt.workDoneProgress)}M(Tt,"hasWorkDoneProgress"),xe.hasWorkDoneProgress=Tt})(z||(t.WorkDoneProgressOptions=z={}));var V;(function(xe){xe.method="initialize",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(V||(t.InitializeRequest=V={}));var B;(function(xe){xe.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var H;(function(xe){xe.method="initialized",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(H||(t.InitializedNotification=H={}));var G;(function(xe){xe.method="shutdown",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType0(xe.method)})(G||(t.ShutdownRequest=G={}));var W;(function(xe){xe.method="exit",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType0(xe.method)})(W||(t.ExitNotification=W={}));var K;(function(xe){xe.method="workspace/didChangeConfiguration",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(K||(t.DidChangeConfigurationNotification=K={}));var q;(function(xe){xe.Error=1,xe.Warning=2,xe.Info=3,xe.Log=4,xe.Debug=5})(q||(t.MessageType=q={}));var oe;(function(xe){xe.method="window/showMessage",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(oe||(t.ShowMessageNotification=oe={}));var Q;(function(xe){xe.method="window/showMessageRequest",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType(xe.method)})(Q||(t.ShowMessageRequest=Q={}));var Z;(function(xe){xe.method="window/logMessage",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(Z||(t.LogMessageNotification=Z={}));var re;(function(xe){xe.method="telemetry/event",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(re||(t.TelemetryEventNotification=re={}));var ie;(function(xe){xe.None=0,xe.Full=1,xe.Incremental=2})(ie||(t.TextDocumentSyncKind=ie={}));var me;(function(xe){xe.method="textDocument/didOpen",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(me||(t.DidOpenTextDocumentNotification=me={}));var te;(function(xe){function Nt(yt){let Rt=yt;return Rt!=null&&typeof Rt.text=="string"&&Rt.range!==void 0&&(Rt.rangeLength===void 0||typeof Rt.rangeLength=="number")}M(Nt,"isIncremental"),xe.isIncremental=Nt;function Tt(yt){let Rt=yt;return Rt!=null&&typeof Rt.text=="string"&&Rt.range===void 0&&Rt.rangeLength===void 0}M(Tt,"isFull"),xe.isFull=Tt})(te||(t.TextDocumentContentChangeEvent=te={}));var _e;(function(xe){xe.method="textDocument/didChange",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var $e;(function(xe){xe.method="textDocument/didClose",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})($e||(t.DidCloseTextDocumentNotification=$e={}));var Fe;(function(xe){xe.method="textDocument/didSave",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(Fe||(t.DidSaveTextDocumentNotification=Fe={}));var ce;(function(xe){xe.Manual=1,xe.AfterDelay=2,xe.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var he;(function(xe){xe.method="textDocument/willSave",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(he||(t.WillSaveTextDocumentNotification=he={}));var Te;(function(xe){xe.method="textDocument/willSaveWaitUntil",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Te||(t.WillSaveTextDocumentWaitUntilRequest=Te={}));var ge;(function(xe){xe.method="workspace/didChangeWatchedFiles",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var He;(function(xe){xe.Created=1,xe.Changed=2,xe.Deleted=3})(He||(t.FileChangeType=He={}));var we;(function(xe){function Nt(Tt){const yt=Tt;return n.objectLiteral(yt)&&(r.URI.is(yt.baseUri)||r.WorkspaceFolder.is(yt.baseUri))&&n.string(yt.pattern)}M(Nt,"is"),xe.is=Nt})(we||(t.RelativePattern=we={}));var Me;(function(xe){xe.Create=1,xe.Change=2,xe.Delete=4})(Me||(t.WatchKind=Me={}));var je;(function(xe){xe.method="textDocument/publishDiagnostics",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(je||(t.PublishDiagnosticsNotification=je={}));var le;(function(xe){xe.Invoked=1,xe.TriggerCharacter=2,xe.TriggerForIncompleteCompletions=3})(le||(t.CompletionTriggerKind=le={}));var pe;(function(xe){xe.method="textDocument/completion",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(pe||(t.CompletionRequest=pe={}));var Ce;(function(xe){xe.method="completionItem/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ce||(t.CompletionResolveRequest=Ce={}));var ne;(function(xe){xe.method="textDocument/hover",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ne||(t.HoverRequest=ne={}));var j;(function(xe){xe.Invoked=1,xe.TriggerCharacter=2,xe.ContentChange=3})(j||(t.SignatureHelpTriggerKind=j={}));var J;(function(xe){xe.method="textDocument/signatureHelp",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(J||(t.SignatureHelpRequest=J={}));var ue;(function(xe){xe.method="textDocument/definition",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ue||(t.DefinitionRequest=ue={}));var X;(function(xe){xe.method="textDocument/references",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(X||(t.ReferencesRequest=X={}));var fe;(function(xe){xe.method="textDocument/documentHighlight",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(fe||(t.DocumentHighlightRequest=fe={}));var ee;(function(xe){xe.method="textDocument/documentSymbol",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ee||(t.DocumentSymbolRequest=ee={}));var Ae;(function(xe){xe.method="textDocument/codeAction",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ae||(t.CodeActionRequest=Ae={}));var Re;(function(xe){xe.method="codeAction/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Re||(t.CodeActionResolveRequest=Re={}));var Xe;(function(xe){xe.method="workspace/symbol",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Xe||(t.WorkspaceSymbolRequest=Xe={}));var Ne;(function(xe){xe.method="workspaceSymbol/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ne||(t.WorkspaceSymbolResolveRequest=Ne={}));var qe;(function(xe){xe.method="textDocument/codeLens",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(qe||(t.CodeLensRequest=qe={}));var De;(function(xe){xe.method="codeLens/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(De||(t.CodeLensResolveRequest=De={}));var Ke;(function(xe){xe.method="workspace/codeLens/refresh",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType0(xe.method)})(Ke||(t.CodeLensRefreshRequest=Ke={}));var ze;(function(xe){xe.method="textDocument/documentLink",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ze||(t.DocumentLinkRequest=ze={}));var st;(function(xe){xe.method="documentLink/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(st||(t.DocumentLinkResolveRequest=st={}));var Oe;(function(xe){xe.method="textDocument/formatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Oe||(t.DocumentFormattingRequest=Oe={}));var mt;(function(xe){xe.method="textDocument/rangeFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(mt||(t.DocumentRangeFormattingRequest=mt={}));var Le;(function(xe){xe.method="textDocument/rangesFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Le||(t.DocumentRangesFormattingRequest=Le={}));var St;(function(xe){xe.method="textDocument/onTypeFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(St||(t.DocumentOnTypeFormattingRequest=St={}));var At;(function(xe){xe.Identifier=1})(At||(t.PrepareSupportDefaultBehavior=At={}));var lt;(function(xe){xe.method="textDocument/rename",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(lt||(t.RenameRequest=lt={}));var zt;(function(xe){xe.method="textDocument/prepareRename",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(zt||(t.PrepareRenameRequest=zt={}));var It;(function(xe){xe.method="workspace/executeCommand",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(It||(t.ExecuteCommandRequest=It={}));var ft;(function(xe){xe.method="workspace/applyEdit",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ft||(t.ApplyWorkspaceEditRequest=ft={}))}}),vZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=A3();function r(n,i,s,a){return e.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,e.createMessageConnection)(n,i,s,a)}M(r,"createProtocolConnection"),t.createProtocolConnection=r}}),bZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(s,a,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(a,o);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:M(function(){return a[o]},"get")}),Object.defineProperty(s,l,u)}):(function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]})),r=t&&t.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(A3(),t),r((A7(),xee(fO)),t),r(Es(),t),r(yZt(),t);var n=vZt();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:M(function(){return n.createProtocolConnection},"get")});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),xZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(s,a,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(a,o);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:M(function(){return a[o]},"get")}),Object.defineProperty(s,l,u)}):(function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]})),r=t&&t.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Qpe();r(Qpe(),t),r(bZt(),t);function i(s,a,o,l){return(0,n.createMessageConnection)(s,a,o,l)}M(i,"createProtocolConnection"),t.createProtocolConnection=i}}),CIe={};om(CIe,{AbstractAstReflection:()=>kee,AbstractCstNode:()=>Ere,AbstractLangiumParser:()=>Mre,AbstractParserErrorMessageProvider:()=>uHe,AbstractThreadedAsyncParser:()=>Ulr,AstUtils:()=>See,BiMap:()=>RI,Cancellation:()=>$i,CompositeCstNodeImpl:()=>uP,ContextCache:()=>yP,CstNodeBuilder:()=>oHe,CstUtils:()=>Tee,DEFAULT_TOKENIZE_OPTIONS:()=>Ure,DONE_RESULT:()=>hl,DatatypeSymbol:()=>SI,DefaultAstNodeDescriptionProvider:()=>zHe,DefaultAstNodeLocator:()=>HHe,DefaultAsyncParser:()=>aGe,DefaultCommentProvider:()=>sGe,DefaultConfigurationProvider:()=>GHe,DefaultDocumentBuilder:()=>WHe,DefaultDocumentValidator:()=>FHe,DefaultHydrator:()=>lGe,DefaultIndexManager:()=>qHe,DefaultJsonSerializer:()=>OHe,DefaultLangiumDocumentFactory:()=>EHe,DefaultLangiumDocuments:()=>AHe,DefaultLangiumProfiler:()=>Zlr,DefaultLexer:()=>Yre,DefaultLexerErrorMessageProvider:()=>YHe,DefaultLinker:()=>MHe,DefaultNameProvider:()=>RHe,DefaultReferenceDescriptionProvider:()=>VHe,DefaultReferences:()=>_He,DefaultScopeComputation:()=>LHe,DefaultScopeProvider:()=>DHe,DefaultServiceRegistry:()=>PHe,DefaultTokenBuilder:()=>fP,DefaultValueConverter:()=>Ore,DefaultWorkspaceLock:()=>oGe,DefaultWorkspaceManager:()=>UHe,Deferred:()=>R0,Disposable:()=>ry,DisposableCache:()=>mP,DocumentCache:()=>NHe,DocumentState:()=>Mn,DocumentValidator:()=>pu,EMPTY_SCOPE:()=>Hlr,EMPTY_STREAM:()=>A5,EmptyFileSystem:()=>_o,EmptyFileSystemProvider:()=>hGe,ErrorWithLocation:()=>CO,GrammarAST:()=>EIe,GrammarUtils:()=>tte,IndentationAwareLexer:()=>jlr,IndentationAwareTokenBuilder:()=>uGe,JSDocDocumentationProvider:()=>iGe,LangiumCompletionParser:()=>hHe,LangiumParser:()=>cHe,LangiumParserErrorMessageProvider:()=>Rre,LeafCstNodeImpl:()=>kI,LexingMode:()=>H1,MapScope:()=>Vlr,Module:()=>IY,MultiMap:()=>_0,MultiMapScope:()=>IHe,OperationCancelled:()=>yd,ParserWorker:()=>Ylr,ProfilingTask:()=>fGe,Reduction:()=>Z6,RefResolving:()=>e1,RegExpUtils:()=>nte,RootCstNodeImpl:()=>Are,SimpleCache:()=>Vre,StreamImpl:()=>md,StreamScope:()=>MY,TextDocument:()=>AI,TreeStreamImpl:()=>M5,URI:()=>Fc,UriTrie:()=>Fre,UriUtils:()=>Tl,VALIDATE_EACH_NODE:()=>BHe,ValidationCategory:()=>_I,ValidationRegistry:()=>$He,ValueConverter:()=>id,WorkspaceCache:()=>Hre,assertCondition:()=>rte,assertUnreachable:()=>lm,createCompletionParser:()=>Ire,createDefaultCoreModule:()=>ro,createDefaultSharedCoreModule:()=>no,createGrammarConfig:()=>wte,createLangiumParser:()=>Nre,createParser:()=>hP,delayNextTick:()=>pP,diagnosticData:()=>V1,eagerLoad:()=>ene,getDiagnosticRange:()=>Wre,indentationBuilderDefaultOptions:()=>DY,inject:()=>Hn,interruptAndCheck:()=>za,isAstNode:()=>aa,isAstNodeDescription:()=>Cee,isAstNodeWithComment:()=>Gre,isCompositeCstNode:()=>w0,isIMultiModeLexerDefinition:()=>xP,isJSDoc:()=>Xre,isLeafCstNode:()=>ov,isLinkingError:()=>h1,isMultiReference:()=>Sd,isNamed:()=>zre,isOperationCancelled:()=>Ev,isReference:()=>wl,isRootCstNode:()=>gO,isTokenTypeArray:()=>bP,isTokenTypeDictionary:()=>LI,loadGrammarFromJson:()=>io,parseJSDoc:()=>jre,prepareLangiumParser:()=>Dre,setInterruptionPeriod:()=>Pre,startCancelableOperation:()=>gP,stream:()=>yi,toDiagnosticData:()=>qre,toDiagnosticSeverity:()=>CS});var Tee={};om(Tee,{DefaultNameRegexp:()=>Kee,RangeComparison:()=>ld,compareRange:()=>jee,findCommentNode:()=>Zee,findDeclarationNodeAtOffset:()=>qIe,findLeafNodeAtOffset:()=>TO,findLeafNodeBeforeOffset:()=>Qee,flattenCst:()=>WIe,getDatatypeNode:()=>GIe,getInteriorNodes:()=>jIe,getNextNode:()=>UIe,getPreviousNode:()=>ete,getStartlineNode:()=>YIe,inRange:()=>Xee,isChildNode:()=>Yee,isCommentNode:()=>lI,streamCst:()=>I5,toDocumentSegment:()=>N5,tokenToRange:()=>Q6});function aa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}M(aa,"isAstNode");function wl(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}M(wl,"isReference");function Sd(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}M(Sd,"isMultiReference");function Cee(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}M(Cee,"isAstNodeDescription");function h1(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}M(h1,"isLinkingError");var fx,kee=(fx=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return aa(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=a,a}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const s of n)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}},M(fx,"AbstractAstReflection"),fx);function w0(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}M(w0,"isCompositeCstNode");function ov(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}M(ov,"isLeafCstNode");function gO(t){return w0(t)&&typeof t.fullText=="string"}M(gO,"isRootCstNode");var Jl,md=(Jl=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:M(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new Jl(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return hl})}join(e=","){const r=this.iterator();let n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=kIe(i.value)),s=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,s=n.next();for(;!s.done;){if(i>=r&&s.value===e)return i;s=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new Jl(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?hl:{done:!1,value:e(i)}})}filter(e){return new Jl(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return hl})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,s=n.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const s=this.recursiveReduce(e,r,n);return s===void 0?i.value:r(s,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Jl(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:i}=this.nextFn(r.this);if(!n){const s=e(i);if(K6(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return hl})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Jl(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}const{done:i,value:s}=r.nextFn(n.this);if(!i)if(K6(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return hl})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Jl(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?hl:this.nextFn(r.state)))}distinct(e){return new Jl(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return hl})}exclude(e,r){const n=new Set;for(const i of e){const s=r?r(i):i;n.add(s)}return this.filter(i=>{const s=r?r(i):i;return!n.has(s)})}},M(Jl,"StreamImpl"),Jl);function kIe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}M(kIe,"toString");function K6(t){return!!t&&typeof t[Symbol.iterator]=="function"}M(K6,"isIterable");var A5=new md(()=>{},()=>hl),hl=Object.freeze({done:!0,value:void 0});function yi(...t){if(t.length===1){const e=t[0];if(e instanceof md)return e;if(K6(e))return new md(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new md(()=>({index:0}),r=>r.index1?new md(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return hl})}iterator(){const e={state:this.startFn(),next:M(()=>this.nextFn(e.state),"next"),prune:M(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},M(px,"TreeStreamImpl"),px),Z6;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}M(e,"sum"),t.sum=e;function r(s){return s.reduce((a,o)=>a*o,0)}M(r,"product"),t.product=r;function n(s){return s.reduce((a,o)=>Math.min(a,o))}M(n,"min"),t.min=n;function i(s){return s.reduce((a,o)=>Math.max(a,o))}M(i,"max"),t.max=i})(Z6||(Z6={}));var See={};om(See,{assignMandatoryProperties:()=>Eee,copyAstNode:()=>jL,findRootNode:()=>zb,getContainerOfType:()=>lv,getDocument:()=>vh,getReferenceNodes:()=>UL,hasContainerOfType:()=>SIe,linkContentToContainer:()=>R5,streamAllContents:()=>j0,streamAst:()=>bh,streamContents:()=>R7,streamReferences:()=>_5});function R5(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,s)=>{aa(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=s,e.deep&&R5(i,e))}):aa(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&R5(n,e)))}M(R5,"linkContentToContainer");function lv(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}M(lv,"getContainerOfType");function SIe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}M(SIe,"hasContainerOfType");function vh(t){const r=zb(t).$document;if(!r)throw new Error("AST node has no document.");return r}M(vh,"getDocument");function zb(t){for(;t.$container;)t=t.$container;return t}M(zb,"findRootNode");function UL(t){return wl(t)?t.ref?[t.ref]:[]:Sd(t)?t.items.map(e=>e.ref):[]}M(UL,"getReferenceNodes");function R7(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new md(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexR7(r,e))}M(j0,"streamAllContents");function bh(t,e){if(t){if(e!=null&&e.range&&!YL(t,e.range))return new M5(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new M5(t,r=>R7(r,e),{includeRoot:!0})}M(bh,"streamAst");function YL(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?Xee(r,e):!1}M(YL,"isAstNodeInRange");function _5(t){return new md(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexYl,AbstractParserRule:()=>cS,AbstractRule:()=>sb,AbstractType:()=>kc,Action:()=>Cp,Alternatives:()=>uS,ArrayLiteral:()=>XL,ArrayType:()=>KL,Assignment:()=>kp,BooleanLiteral:()=>ZL,CharacterRange:()=>Sp,Condition:()=>Ep,Conjunction:()=>hS,CrossReference:()=>Ap,Disjunction:()=>dS,EndOfFile:()=>QL,Grammar:()=>kf,GrammarImport:()=>JL,Group:()=>d1,InferredType:()=>eI,InfixRule:()=>Qh,InfixRuleOperatorList:()=>fS,InfixRuleOperators:()=>tI,Interface:()=>ab,Keyword:()=>ob,LangiumGrammarAstReflection:()=>Uee,LangiumGrammarTerminals:()=>wZt,NamedArgument:()=>lb,NegatedToken:()=>f1,Negation:()=>rI,NumberLiteral:()=>nI,Parameter:()=>cb,ParameterReference:()=>iI,ParserRule:()=>Wu,ReferenceType:()=>pS,RegexToken:()=>p1,ReturnType:()=>sI,RuleCall:()=>g1,SimpleType:()=>ub,StringLiteral:()=>aI,TerminalAlternatives:()=>m1,TerminalElement:()=>jl,TerminalGroup:()=>y1,TerminalRule:()=>Sf,TerminalRuleCall:()=>v1,Type:()=>gS,TypeAttribute:()=>b1,TypeDefinition:()=>x1,UnionType:()=>oI,UnorderedGroup:()=>mS,UntilToken:()=>w1,ValueLiteral:()=>T1,Wildcard:()=>hb,isAbstractElement:()=>mO,isAbstractParserRule:()=>cv,isAbstractRule:()=>AIe,isAbstractType:()=>MIe,isAction:()=>Lg,isAlternatives:()=>yO,isArrayLiteral:()=>RIe,isArrayType:()=>Mee,isAssignment:()=>T0,isBooleanLiteral:()=>Ree,isCharacterRange:()=>_ee,isCondition:()=>_Ie,isConjunction:()=>Lee,isCrossReference:()=>uv,isDisjunction:()=>Iee,isEndOfFile:()=>Nee,isGrammar:()=>LIe,isGrammarImport:()=>IIe,isGroup:()=>hv,isInferredType:()=>_7,isInfixRule:()=>L5,isInfixRuleOperatorList:()=>NIe,isInfixRuleOperators:()=>DIe,isInterface:()=>Dee,isKeyword:()=>C0,isNamedArgument:()=>OIe,isNegatedToken:()=>Oee,isNegation:()=>Pee,isNumberLiteral:()=>PIe,isParameter:()=>$Ie,isParameterReference:()=>$ee,isParserRule:()=>_l,isReferenceType:()=>Bee,isRegexToken:()=>Fee,isReturnType:()=>zee,isRuleCall:()=>k0,isSimpleType:()=>vO,isStringLiteral:()=>BIe,isTerminalAlternatives:()=>Vee,isTerminalElement:()=>FIe,isTerminalGroup:()=>Hee,isTerminalRule:()=>Ou,isTerminalRuleCall:()=>bO,isType:()=>xO,isTypeAttribute:()=>zIe,isTypeDefinition:()=>VIe,isUnionType:()=>Gee,isUnorderedGroup:()=>wO,isUntilToken:()=>Wee,isValueLiteral:()=>HIe,isWildcard:()=>qee,reflection:()=>qr});var wZt={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Yl={$type:"AbstractElement",cardinality:"cardinality"};function mO(t){return qr.isInstance(t,Yl.$type)}M(mO,"isAbstractElement");var cS={$type:"AbstractParserRule"};function cv(t){return qr.isInstance(t,cS.$type)}M(cv,"isAbstractParserRule");var sb={$type:"AbstractRule"};function AIe(t){return qr.isInstance(t,sb.$type)}M(AIe,"isAbstractRule");var kc={$type:"AbstractType"};function MIe(t){return qr.isInstance(t,kc.$type)}M(MIe,"isAbstractType");var Cp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Lg(t){return qr.isInstance(t,Cp.$type)}M(Lg,"isAction");var uS={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function yO(t){return qr.isInstance(t,uS.$type)}M(yO,"isAlternatives");var XL={$type:"ArrayLiteral",elements:"elements"};function RIe(t){return qr.isInstance(t,XL.$type)}M(RIe,"isArrayLiteral");var KL={$type:"ArrayType",elementType:"elementType"};function Mee(t){return qr.isInstance(t,KL.$type)}M(Mee,"isArrayType");var kp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function T0(t){return qr.isInstance(t,kp.$type)}M(T0,"isAssignment");var ZL={$type:"BooleanLiteral",true:"true"};function Ree(t){return qr.isInstance(t,ZL.$type)}M(Ree,"isBooleanLiteral");var Sp={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function _ee(t){return qr.isInstance(t,Sp.$type)}M(_ee,"isCharacterRange");var Ep={$type:"Condition"};function _Ie(t){return qr.isInstance(t,Ep.$type)}M(_Ie,"isCondition");var hS={$type:"Conjunction",left:"left",right:"right"};function Lee(t){return qr.isInstance(t,hS.$type)}M(Lee,"isConjunction");var Ap={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function uv(t){return qr.isInstance(t,Ap.$type)}M(uv,"isCrossReference");var dS={$type:"Disjunction",left:"left",right:"right"};function Iee(t){return qr.isInstance(t,dS.$type)}M(Iee,"isDisjunction");var QL={$type:"EndOfFile",cardinality:"cardinality"};function Nee(t){return qr.isInstance(t,QL.$type)}M(Nee,"isEndOfFile");var kf={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function LIe(t){return qr.isInstance(t,kf.$type)}M(LIe,"isGrammar");var JL={$type:"GrammarImport",path:"path"};function IIe(t){return qr.isInstance(t,JL.$type)}M(IIe,"isGrammarImport");var d1={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function hv(t){return qr.isInstance(t,d1.$type)}M(hv,"isGroup");var eI={$type:"InferredType",name:"name"};function _7(t){return qr.isInstance(t,eI.$type)}M(_7,"isInferredType");var Qh={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function L5(t){return qr.isInstance(t,Qh.$type)}M(L5,"isInfixRule");var fS={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function NIe(t){return qr.isInstance(t,fS.$type)}M(NIe,"isInfixRuleOperatorList");var tI={$type:"InfixRuleOperators",precedences:"precedences"};function DIe(t){return qr.isInstance(t,tI.$type)}M(DIe,"isInfixRuleOperators");var ab={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Dee(t){return qr.isInstance(t,ab.$type)}M(Dee,"isInterface");var ob={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function C0(t){return qr.isInstance(t,ob.$type)}M(C0,"isKeyword");var lb={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function OIe(t){return qr.isInstance(t,lb.$type)}M(OIe,"isNamedArgument");var f1={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Oee(t){return qr.isInstance(t,f1.$type)}M(Oee,"isNegatedToken");var rI={$type:"Negation",value:"value"};function Pee(t){return qr.isInstance(t,rI.$type)}M(Pee,"isNegation");var nI={$type:"NumberLiteral",value:"value"};function PIe(t){return qr.isInstance(t,nI.$type)}M(PIe,"isNumberLiteral");var cb={$type:"Parameter",name:"name"};function $Ie(t){return qr.isInstance(t,cb.$type)}M($Ie,"isParameter");var iI={$type:"ParameterReference",parameter:"parameter"};function $ee(t){return qr.isInstance(t,iI.$type)}M($ee,"isParameterReference");var Wu={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function _l(t){return qr.isInstance(t,Wu.$type)}M(_l,"isParserRule");var pS={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Bee(t){return qr.isInstance(t,pS.$type)}M(Bee,"isReferenceType");var p1={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Fee(t){return qr.isInstance(t,p1.$type)}M(Fee,"isRegexToken");var sI={$type:"ReturnType",name:"name"};function zee(t){return qr.isInstance(t,sI.$type)}M(zee,"isReturnType");var g1={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function k0(t){return qr.isInstance(t,g1.$type)}M(k0,"isRuleCall");var ub={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function vO(t){return qr.isInstance(t,ub.$type)}M(vO,"isSimpleType");var aI={$type:"StringLiteral",value:"value"};function BIe(t){return qr.isInstance(t,aI.$type)}M(BIe,"isStringLiteral");var m1={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Vee(t){return qr.isInstance(t,m1.$type)}M(Vee,"isTerminalAlternatives");var jl={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function FIe(t){return qr.isInstance(t,jl.$type)}M(FIe,"isTerminalElement");var y1={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Hee(t){return qr.isInstance(t,y1.$type)}M(Hee,"isTerminalGroup");var Sf={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Ou(t){return qr.isInstance(t,Sf.$type)}M(Ou,"isTerminalRule");var v1={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function bO(t){return qr.isInstance(t,v1.$type)}M(bO,"isTerminalRuleCall");var gS={$type:"Type",name:"name",type:"type"};function xO(t){return qr.isInstance(t,gS.$type)}M(xO,"isType");var b1={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function zIe(t){return qr.isInstance(t,b1.$type)}M(zIe,"isTypeAttribute");var x1={$type:"TypeDefinition"};function VIe(t){return qr.isInstance(t,x1.$type)}M(VIe,"isTypeDefinition");var oI={$type:"UnionType",types:"types"};function Gee(t){return qr.isInstance(t,oI.$type)}M(Gee,"isUnionType");var mS={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function wO(t){return qr.isInstance(t,mS.$type)}M(wO,"isUnorderedGroup");var w1={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Wee(t){return qr.isInstance(t,w1.$type)}M(Wee,"isUntilToken");var T1={$type:"ValueLiteral"};function HIe(t){return qr.isInstance(t,T1.$type)}M(HIe,"isValueLiteral");var hb={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function qee(t){return qr.isInstance(t,hb.$type)}M(qee,"isWildcard");var gx,Uee=(gx=class extends kee{constructor(){super(...arguments),this.types={AbstractElement:{name:Yl.$type,properties:{cardinality:{name:Yl.cardinality}},superTypes:[]},AbstractParserRule:{name:cS.$type,properties:{},superTypes:[sb.$type,kc.$type]},AbstractRule:{name:sb.$type,properties:{},superTypes:[]},AbstractType:{name:kc.$type,properties:{},superTypes:[]},Action:{name:Cp.$type,properties:{cardinality:{name:Cp.cardinality},feature:{name:Cp.feature},inferredType:{name:Cp.inferredType},operator:{name:Cp.operator},type:{name:Cp.type,referenceType:kc.$type}},superTypes:[Yl.$type]},Alternatives:{name:uS.$type,properties:{cardinality:{name:uS.cardinality},elements:{name:uS.elements,defaultValue:[]}},superTypes:[Yl.$type]},ArrayLiteral:{name:XL.$type,properties:{elements:{name:XL.elements,defaultValue:[]}},superTypes:[T1.$type]},ArrayType:{name:KL.$type,properties:{elementType:{name:KL.elementType}},superTypes:[x1.$type]},Assignment:{name:kp.$type,properties:{cardinality:{name:kp.cardinality},feature:{name:kp.feature},operator:{name:kp.operator},predicate:{name:kp.predicate},terminal:{name:kp.terminal}},superTypes:[Yl.$type]},BooleanLiteral:{name:ZL.$type,properties:{true:{name:ZL.true,defaultValue:!1}},superTypes:[Ep.$type,T1.$type]},CharacterRange:{name:Sp.$type,properties:{cardinality:{name:Sp.cardinality},left:{name:Sp.left},lookahead:{name:Sp.lookahead},parenthesized:{name:Sp.parenthesized,defaultValue:!1},right:{name:Sp.right}},superTypes:[jl.$type]},Condition:{name:Ep.$type,properties:{},superTypes:[]},Conjunction:{name:hS.$type,properties:{left:{name:hS.left},right:{name:hS.right}},superTypes:[Ep.$type]},CrossReference:{name:Ap.$type,properties:{cardinality:{name:Ap.cardinality},deprecatedSyntax:{name:Ap.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ap.isMulti,defaultValue:!1},terminal:{name:Ap.terminal},type:{name:Ap.type,referenceType:kc.$type}},superTypes:[Yl.$type]},Disjunction:{name:dS.$type,properties:{left:{name:dS.left},right:{name:dS.right}},superTypes:[Ep.$type]},EndOfFile:{name:QL.$type,properties:{cardinality:{name:QL.cardinality}},superTypes:[Yl.$type]},Grammar:{name:kf.$type,properties:{imports:{name:kf.imports,defaultValue:[]},interfaces:{name:kf.interfaces,defaultValue:[]},isDeclared:{name:kf.isDeclared,defaultValue:!1},name:{name:kf.name},rules:{name:kf.rules,defaultValue:[]},types:{name:kf.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:JL.$type,properties:{path:{name:JL.path}},superTypes:[]},Group:{name:d1.$type,properties:{cardinality:{name:d1.cardinality},elements:{name:d1.elements,defaultValue:[]},guardCondition:{name:d1.guardCondition},predicate:{name:d1.predicate}},superTypes:[Yl.$type]},InferredType:{name:eI.$type,properties:{name:{name:eI.name}},superTypes:[kc.$type]},InfixRule:{name:Qh.$type,properties:{call:{name:Qh.call},dataType:{name:Qh.dataType},inferredType:{name:Qh.inferredType},name:{name:Qh.name},operators:{name:Qh.operators},parameters:{name:Qh.parameters,defaultValue:[]},returnType:{name:Qh.returnType,referenceType:kc.$type}},superTypes:[cS.$type]},InfixRuleOperatorList:{name:fS.$type,properties:{associativity:{name:fS.associativity},operators:{name:fS.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:tI.$type,properties:{precedences:{name:tI.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ab.$type,properties:{attributes:{name:ab.attributes,defaultValue:[]},name:{name:ab.name},superTypes:{name:ab.superTypes,defaultValue:[],referenceType:kc.$type}},superTypes:[kc.$type]},Keyword:{name:ob.$type,properties:{cardinality:{name:ob.cardinality},predicate:{name:ob.predicate},value:{name:ob.value}},superTypes:[Yl.$type]},NamedArgument:{name:lb.$type,properties:{calledByName:{name:lb.calledByName,defaultValue:!1},parameter:{name:lb.parameter,referenceType:cb.$type},value:{name:lb.value}},superTypes:[]},NegatedToken:{name:f1.$type,properties:{cardinality:{name:f1.cardinality},lookahead:{name:f1.lookahead},parenthesized:{name:f1.parenthesized,defaultValue:!1},terminal:{name:f1.terminal}},superTypes:[jl.$type]},Negation:{name:rI.$type,properties:{value:{name:rI.value}},superTypes:[Ep.$type]},NumberLiteral:{name:nI.$type,properties:{value:{name:nI.value}},superTypes:[T1.$type]},Parameter:{name:cb.$type,properties:{name:{name:cb.name}},superTypes:[]},ParameterReference:{name:iI.$type,properties:{parameter:{name:iI.parameter,referenceType:cb.$type}},superTypes:[Ep.$type]},ParserRule:{name:Wu.$type,properties:{dataType:{name:Wu.dataType},definition:{name:Wu.definition},entry:{name:Wu.entry,defaultValue:!1},fragment:{name:Wu.fragment,defaultValue:!1},inferredType:{name:Wu.inferredType},name:{name:Wu.name},parameters:{name:Wu.parameters,defaultValue:[]},returnType:{name:Wu.returnType,referenceType:kc.$type}},superTypes:[cS.$type]},ReferenceType:{name:pS.$type,properties:{isMulti:{name:pS.isMulti,defaultValue:!1},referenceType:{name:pS.referenceType}},superTypes:[x1.$type]},RegexToken:{name:p1.$type,properties:{cardinality:{name:p1.cardinality},lookahead:{name:p1.lookahead},parenthesized:{name:p1.parenthesized,defaultValue:!1},regex:{name:p1.regex}},superTypes:[jl.$type]},ReturnType:{name:sI.$type,properties:{name:{name:sI.name}},superTypes:[]},RuleCall:{name:g1.$type,properties:{arguments:{name:g1.arguments,defaultValue:[]},cardinality:{name:g1.cardinality},predicate:{name:g1.predicate},rule:{name:g1.rule,referenceType:sb.$type}},superTypes:[Yl.$type]},SimpleType:{name:ub.$type,properties:{primitiveType:{name:ub.primitiveType},stringType:{name:ub.stringType},typeRef:{name:ub.typeRef,referenceType:kc.$type}},superTypes:[x1.$type]},StringLiteral:{name:aI.$type,properties:{value:{name:aI.value}},superTypes:[T1.$type]},TerminalAlternatives:{name:m1.$type,properties:{cardinality:{name:m1.cardinality},elements:{name:m1.elements,defaultValue:[]},lookahead:{name:m1.lookahead},parenthesized:{name:m1.parenthesized,defaultValue:!1}},superTypes:[jl.$type]},TerminalElement:{name:jl.$type,properties:{cardinality:{name:jl.cardinality},lookahead:{name:jl.lookahead},parenthesized:{name:jl.parenthesized,defaultValue:!1}},superTypes:[Yl.$type]},TerminalGroup:{name:y1.$type,properties:{cardinality:{name:y1.cardinality},elements:{name:y1.elements,defaultValue:[]},lookahead:{name:y1.lookahead},parenthesized:{name:y1.parenthesized,defaultValue:!1}},superTypes:[jl.$type]},TerminalRule:{name:Sf.$type,properties:{definition:{name:Sf.definition},fragment:{name:Sf.fragment,defaultValue:!1},hidden:{name:Sf.hidden,defaultValue:!1},name:{name:Sf.name},type:{name:Sf.type}},superTypes:[sb.$type]},TerminalRuleCall:{name:v1.$type,properties:{cardinality:{name:v1.cardinality},lookahead:{name:v1.lookahead},parenthesized:{name:v1.parenthesized,defaultValue:!1},rule:{name:v1.rule,referenceType:Sf.$type}},superTypes:[jl.$type]},Type:{name:gS.$type,properties:{name:{name:gS.name},type:{name:gS.type}},superTypes:[kc.$type]},TypeAttribute:{name:b1.$type,properties:{defaultValue:{name:b1.defaultValue},isOptional:{name:b1.isOptional,defaultValue:!1},name:{name:b1.name},type:{name:b1.type}},superTypes:[]},TypeDefinition:{name:x1.$type,properties:{},superTypes:[]},UnionType:{name:oI.$type,properties:{types:{name:oI.types,defaultValue:[]}},superTypes:[x1.$type]},UnorderedGroup:{name:mS.$type,properties:{cardinality:{name:mS.cardinality},elements:{name:mS.elements,defaultValue:[]}},superTypes:[Yl.$type]},UntilToken:{name:w1.$type,properties:{cardinality:{name:w1.cardinality},lookahead:{name:w1.lookahead},parenthesized:{name:w1.parenthesized,defaultValue:!1},terminal:{name:w1.terminal}},superTypes:[jl.$type]},ValueLiteral:{name:T1.$type,properties:{},superTypes:[]},Wildcard:{name:hb.$type,properties:{cardinality:{name:hb.cardinality},lookahead:{name:hb.lookahead},parenthesized:{name:hb.parenthesized,defaultValue:!1}},superTypes:[jl.$type]}}}},M(gx,"LangiumGrammarAstReflection"),gx),qr=new Uee;function GIe(t){let e=t,r=!1;for(;e;){const n=lv(e.grammarSource,_l);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}M(GIe,"getDatatypeNode");function I5(t){return new M5(t,e=>w0(e)?e.content:[],{includeRoot:!0})}M(I5,"streamCst");function WIe(t){return I5(t).filter(ov)}M(WIe,"flattenCst");function Yee(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}M(Yee,"isChildNode");function Q6(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}M(Q6,"tokenToRange");function N5(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}M(N5,"toDocumentSegment");var ld;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(ld||(ld={}));function jee(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return ld.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineld.After}M(Xee,"inRange");var Kee=/^[\w\p{L}]$/u;function qIe(t,e,r=Kee){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return TO(t,e)}}M(qIe,"findDeclarationNodeAtOffset");function Zee(t,e){if(t){const r=ete(t,!0);if(r&&lI(r,e))return r;if(gO(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const s=t.content[i];if(lI(s,e))return s}}}}M(Zee,"findCommentNode");function lI(t,e){return ov(t)&&e.includes(t.tokenType.name)}M(lI,"isCommentNode");function TO(t,e){if(ov(t))return t;if(w0(t)){const r=Jee(t,e,!1);if(r)return TO(r,e)}}M(TO,"findLeafNodeAtOffset");function Qee(t,e){if(ov(t))return t;if(w0(t)){const r=Jee(t,e,!0);if(r)return Qee(r,e)}}M(Qee,"findLeafNodeBeforeOffset");function Jee(t,e,r){let n=0,i=t.content.length-1,s;for(;n<=i;){const a=Math.floor((n+i)/2),o=t.content[a];if(o.offset<=e&&o.end>e)return o;o.end<=e?(s=r?o:void 0,n=a+1):i=a-1}return s}M(Jee,"binarySearch");function ete(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}M(ete,"getPreviousNode");function UIe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;npte,findNameAssignment:()=>_O,findNodeForKeyword:()=>fte,findNodeForProperty:()=>AO,findNodesForKeyword:()=>nNe,findNodesForKeywordInternal:()=>RO,findNodesForProperty:()=>dte,getActionAtElement:()=>mte,getActionType:()=>vte,getAllReachableRules:()=>EO,getAllRulesUsedForCrossReferences:()=>rNe,getCrossReferenceTerminal:()=>ute,getEntryRule:()=>ote,getExplicitRuleType:()=>I7,getHiddenRules:()=>lte,getRuleType:()=>bte,getRuleTypeName:()=>lNe,getTypeName:()=>Dy,isArrayCardinality:()=>sNe,isArrayOperator:()=>aNe,isCommentTerminal:()=>hte,isDataType:()=>oNe,isDataTypeRule:()=>L7,isOptionalCardinality:()=>iNe,terminalRegex:()=>N7});var mx,CO=(mx=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},M(mx,"ErrorWithLocation"),mx);function lm(t,e="Error: Got unexpected value."){throw new Error(e)}M(lm,"assertUnreachable");function rte(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}M(rte,"assertCondition");var nte={};om(nte,{NEWLINE_REGEXP:()=>QIe,escapeRegExp:()=>M3,getTerminalParts:()=>eNe,isMultilineComment:()=>ite,isWhitespace:()=>SO,partialMatches:()=>ste,partialRegExp:()=>ate,whitespaceCharacters:()=>tNe});function Jr(t){return t.charCodeAt(0)}M(Jr,"cc");function yR(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}M(yR,"insertToSet");function _2(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}M(_2,"addFlag");function Zm(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}M(Zm,"ASSERT_EXISTS");function KIe(){throw Error("Internal Error - Should never get here!")}M(KIe,"ASSERT_NEVER_REACH_HERE");function eY(t){return t.type==="Character"}M(eY,"isCharacter");var cI=[];for(let t=Jr("0");t<=Jr("9");t++)cI.push(t);var uI=[Jr("_")].concat(cI);for(let t=Jr("a");t<=Jr("z");t++)uI.push(t);for(let t=Jr("A");t<=Jr("Z");t++)uI.push(t);var Jpe=[Jr(" "),Jr("\f"),Jr(` -`),Jr("\r"),Jr(" "),Jr("\v"),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr("\u2028"),Jr("\u2029"),Jr(" "),Jr(" "),Jr(" "),Jr("\uFEFF")],TZt=/[0-9a-fA-F]/,$8=/[0-9]/,CZt=/[1-9]/,yx,ZIe=(yx=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":_2(n,"global");break;case"i":_2(n,"ignoreCase");break;case"m":_2(n,"multiLine");break;case"u":_2(n,"unicode");break;case"y":_2(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}}Zm(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return KIe()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),r={atLeast:i,atMost:s}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Zm(r);break}if(!(e===!0&&r===void 0)&&Zm(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()),Zm(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Jr(` -`),Jr("\r"),Jr("\u2028"),Jr("\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=cI;break;case"D":e=cI,r=!0;break;case"s":e=Jpe;break;case"S":e=Jpe,r=!0;break;case"w":e=uI;break;case"W":e=uI,r=!0;break}if(Zm(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Jr("\f");break;case"n":e=Jr(` -`);break;case"r":e=Jr("\r");break;case"t":e=Jr(" ");break;case"v":e=Jr("\v");break}if(Zm(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:Jr("\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:Jr(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:Jr(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,eY(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,eY(i)){if(i.value{zt();let gt,xt;if(r.string(Ee)){gt=Ee;const $r=it[0];let kr=0,Ur=n.ParameterStructures.auto;n.ParameterStructures.is($r)&&(kr=1,Ur=$r);let Er=it.length;const nn=Er-kr;switch(nn){case 0:xt=void 0;break;case 1:xt=yt(Ur,it[kr]);break;default:if(Ur===n.ParameterStructures.byName)throw new Error(`Received ${nn} parameters for 'by Name' notification parameter structure.`);xt=it.slice(kr,Er).map(Cr=>xe(Cr));break}}else{const $r=it;gt=Ee.method,xt=Rt(Ee,$r)}const nr={jsonrpc:H,method:gt,params:xt};return Oe(nr),$.write(nr).catch($r=>{throw F.error("Sending notification failed."),$r})},"sendNotification"),onNotification:M((Ee,it)=>{zt();let gt;return r.func(Ee)?K=Ee:it&&(r.string(Ee)?(gt=Ee,q.set(Ee,{type:void 0,handler:it})):(gt=Ee.method,q.set(Ee.method,{type:Ee,handler:it}))),{dispose:M(()=>{gt!==void 0?q.delete(gt):K=void 0},"dispose")}},"onNotification"),onProgress:M((Ee,it,gt)=>{if(oe.has(it))throw new Error(`Progress handler for token ${it} already registered`);return oe.set(it,gt),{dispose:M(()=>{oe.delete(it)},"dispose")}},"onProgress"),sendProgress:M((Ee,it,gt)=>Or.sendNotification(u.type,{token:it,value:gt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:M((Ee,...it)=>{zt(),ft();let gt,xt,nr;if(r.string(Ee)){gt=Ee;const Er=it[0],nn=it[it.length-1];let Cr=0,Yr=n.ParameterStructures.auto;n.ParameterStructures.is(Er)&&(Cr=1,Yr=Er);let wn=it.length;a.CancellationToken.is(nn)&&(wn=wn-1,nr=nn);const ht=wn-Cr;switch(ht){case 0:xt=void 0;break;case 1:xt=yt(Yr,it[Cr]);break;default:if(Yr===n.ParameterStructures.byName)throw new Error(`Received ${ht} parameters for 'by Name' request parameter structure.`);xt=it.slice(Cr,wn).map(vt=>xe(vt));break}}else{const Er=it;gt=Ee.method,xt=Rt(Ee,Er);const nn=Ee.numberOfParams;nr=a.CancellationToken.is(Er[nn])?Er[nn]:void 0}const $r=z++;let kr;nr&&(kr=nr.onCancellationRequested(()=>{const Er=we.sender.sendCancellation(Or,$r);return Er===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${$r}`),Promise.resolve()):Er.catch(()=>{F.log(`Sending cancellation messages for id ${$r} failed`)})}));const Ur={jsonrpc:H,id:$r,method:gt,params:xt};return st(Ur),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(Ur),new Promise(async(Er,nn)=>{const Cr=M(ht=>{Er(ht),we.sender.cleanup($r),kr==null||kr.dispose()},"resolveWithCleanup"),Yr=M(ht=>{nn(ht),we.sender.cleanup($r),kr==null||kr.dispose()},"rejectWithCleanup"),wn={method:gt,timerStart:Date.now(),resolve:Cr,reject:Yr};try{await $.write(Ur),re.set($r,wn)}catch(ht){throw F.error("Sending request failed."),wn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,ht.message?ht.message:"Unknown reason")),ht}})},"sendRequest"),onRequest:M((Ee,it)=>{zt();let gt=null;return d.is(Ee)?(gt=void 0,G=Ee):r.string(Ee)?(gt=null,it!==void 0&&(gt=Ee,W.set(Ee,{handler:it,type:void 0}))):it!==void 0&&(gt=Ee.method,W.set(Ee.method,{type:Ee,handler:it})),{dispose:M(()=>{gt!==null&&(gt!==void 0?W.delete(gt):G=void 0)},"dispose")}},"onRequest"),hasPendingResponse:M(()=>re.size>0,"hasPendingResponse"),trace:M(async(Ee,it,gt)=>{let xt=!1,nr=g.Text;gt!==void 0&&(r.boolean(gt)?xt=gt:(xt=gt.sendNotification||!1,nr=gt.traceFormat||g.Text)),te=Ee,_e=nr,te===f.Off?$e=void 0:$e=it,xt&&!j()&&!J()&&await Or.sendNotification(m.type,{value:f.toString(Ee)})},"trace"),onError:ce.event,onClose:he.event,onUnhandledNotification:Te.event,onDispose:He.event,end:M(()=>{$.end()},"end"),dispose:M(()=>{if(J())return;Fe=_.Disposed,He.fire(void 0);const Ee=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const it of re.values())it.reject(Ee);re=new Map,me=new Map,ie=new Set,Z=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:M(()=>{zt(),It(),Fe=_.Listening,I.listen(Xe)},"listen"),inspect:M(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Or.onNotification(y.type,Ee=>{if(te===f.Off||!$e)return;const it=te===f.Verbose||te===f.Compact;$e.log(Ee.message,it?Ee.verbose:void 0)}),Or.onNotification(u.type,Ee=>{const it=oe.get(Ee.token);it?it(Ee.value):ge.fire(Ee)}),Or}M(P,"createMessageConnection"),t.createMessageConnection=P}}),rY=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=EIe();Object.defineProperty(t,"Message",{enumerable:!0,get:M(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:M(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:M(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:M(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:M(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:M(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:M(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:M(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:M(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:M(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:M(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:M(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:M(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:M(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:M(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:M(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:M(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:M(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:M(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:M(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:M(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:M(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:M(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:M(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:M(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:M(function(){return e.ParameterStructures},"get")});var r=AIe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:M(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:M(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:M(function(){return r.Touch},"get")});var n=sZt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:M(function(){return n.Disposable},"get")});var i=R3();Object.defineProperty(t,"Event",{enumerable:!0,get:M(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:M(function(){return i.Emitter},"get")});var s=yO();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:M(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:M(function(){return s.CancellationToken},"get")});var a=aZt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:M(function(){return a.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:M(function(){return a.SharedArrayReceiverStrategy},"get")});var o=oZt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:M(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:M(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:M(function(){return o.ReadableStreamMessageReader},"get")});var l=lZt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:M(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:M(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:M(function(){return l.WriteableStreamMessageWriter},"get")});var u=cZt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:M(function(){return u.AbstractMessageBuffer},"get")});var h=uZt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:M(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:M(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:M(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:M(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:M(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:M(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:M(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:M(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:M(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:M(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:M(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:M(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:M(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:M(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:M(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:M(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:M(function(){return h.MessageStrategy},"get")});var d=lv();t.RAL=d.default}}),hZt=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=rY(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},M(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},M(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},M(h,"WritableStreamWrapper"),h),s=new TextEncoder,a=Object.freeze({messageBuffer:Object.freeze({create:M(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:M((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(s.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:M((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:M(d=>new n(d),"asReadableStream"),asWritableStream:M(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:M(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:M(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:M(()=>clearInterval(g),"dispose")}}})});function o(){return a}M(o,"RIL"),(function(d){function f(){e.RAL.install(a)}M(f,"install"),d.install=f})(o||(o={})),t.default=o}}),_3=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:M(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=hZt();n.default.install();var i=rY();r(rY(),t);var s=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},M(l,"BrowserMessageReader"),l);t.BrowserMessageReader=s;var a=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},M(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=a;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}M(o,"createMessageConnection"),t.createMessageConnection=o}}),ige=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=_3()}}),Es=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=_3(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},M(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},M(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var s=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},M(h,"ProtocolRequestType"),h);t.ProtocolRequestType=s;var a=(d=class extends e.NotificationType0{constructor(g){super(g)}},M(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=a;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},M(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),See=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}M(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}M(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}M(n,"number"),t.number=n;function i(h){return h instanceof Error}M(i,"error"),t.error=i;function s(h){return typeof h=="function"}M(s,"func"),t.func=s;function a(h){return Array.isArray(h)}M(a,"array"),t.array=a;function o(h){return a(h)&&h.every(d=>r(d))}M(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}M(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}M(u,"objectLiteral"),t.objectLiteral=u}}),dZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),fZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),pZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Es(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),gZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Es(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),mZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Es(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),yZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Es(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),vZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),bZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),xZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=_3(),r=Es(),n;(function(a){a.type=new e.ProgressType;function o(l){return l===a.type}M(o,"is"),a.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=r.MessageDirection.serverToClient,a.type=new r.ProtocolRequestType(a.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var s;(function(a){a.method="window/workDoneProgress/cancel",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolNotificationType(a.method)})(s||(t.WorkDoneProgressCancelNotification=s={}))}}),wZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Es(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),TZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Es(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var s;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensDeltaRequest=s={}));var a;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensRangeRequest=a={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),CZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Es(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),kZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Es(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),SZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Es(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var s;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(s||(t.WillRenameFilesRequest=s={}));var a;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(a||(t.DidRenameFilesNotification=a={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),EZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Es(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(t.MonikerKind=n={}));var i;(function(s){s.method="textDocument/moniker",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.MonikerRequest=i={}))}}),AZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Es(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),MZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Es(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),RZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Es(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType0(s.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),_Zt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=_3(),r=See(),n=Es(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}M(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var s;(function(u){u.Full="full",u.Unchanged="unchanged"})(s||(t.DocumentDiagnosticReportKind=s={}));var a;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(a||(t.DocumentDiagnosticRequest=a={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),LZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(_7(),kee(mO)),r=See(),n=Es(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}M(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var s;(function(g){function m(x,b){const T={executionOrder:x};return(b===!0||b===!1)&&(T.success=b),T}M(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}M(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}M(v,"equals"),g.equals=v})(s||(t.ExecutionSummary=s={}));var a;(function(g){function m(b,T){return{kind:b,document:T}}M(m,"create"),g.create=m;function y(b){const T=b;return r.objectLiteral(T)&&i.is(T.kind)&&e.DocumentUri.is(T.document)&&(T.metadata===void 0||r.objectLiteral(T.metadata))}M(y,"is"),g.is=y;function v(b,T){const C=new Set;return b.document!==T.document&&C.add("document"),b.kind!==T.kind&&C.add("kind"),b.executionSummary!==T.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||T.metadata!==void 0)&&!x(b.metadata,T.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||T.executionSummary!==void 0)&&!s.equals(b.executionSummary,T.executionSummary)&&C.add("executionSummary"),C}M(v,"diff"),g.diff=v;function x(b,T){if(b===T)return!0;if(b==null||T===null||T===void 0||typeof b!=typeof T||typeof b!="object")return!1;const C=Array.isArray(b),S=Array.isArray(T);if(C!==S)return!1;if(C&&S){if(b.length!==T.length)return!1;for(let k=0;k0}M(Nt,"hasId"),xe.hasId=Nt})(D||(t.StaticRegistrationOptions=D={}));var F;(function(xe){function Nt(Tt){const yt=Tt;return yt&&(yt.documentSelector===null||P.is(yt.documentSelector))}M(Nt,"is"),xe.is=Nt})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(xe){function Nt(yt){const Rt=yt;return n.objectLiteral(Rt)&&(Rt.workDoneProgress===void 0||n.boolean(Rt.workDoneProgress))}M(Nt,"is"),xe.is=Nt;function Tt(yt){const Rt=yt;return Rt&&n.boolean(Rt.workDoneProgress)}M(Tt,"hasWorkDoneProgress"),xe.hasWorkDoneProgress=Tt})(z||(t.WorkDoneProgressOptions=z={}));var V;(function(xe){xe.method="initialize",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(V||(t.InitializeRequest=V={}));var B;(function(xe){xe.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var H;(function(xe){xe.method="initialized",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(H||(t.InitializedNotification=H={}));var G;(function(xe){xe.method="shutdown",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType0(xe.method)})(G||(t.ShutdownRequest=G={}));var W;(function(xe){xe.method="exit",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType0(xe.method)})(W||(t.ExitNotification=W={}));var K;(function(xe){xe.method="workspace/didChangeConfiguration",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(K||(t.DidChangeConfigurationNotification=K={}));var q;(function(xe){xe.Error=1,xe.Warning=2,xe.Info=3,xe.Log=4,xe.Debug=5})(q||(t.MessageType=q={}));var oe;(function(xe){xe.method="window/showMessage",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(oe||(t.ShowMessageNotification=oe={}));var Q;(function(xe){xe.method="window/showMessageRequest",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType(xe.method)})(Q||(t.ShowMessageRequest=Q={}));var Z;(function(xe){xe.method="window/logMessage",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(Z||(t.LogMessageNotification=Z={}));var re;(function(xe){xe.method="telemetry/event",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(re||(t.TelemetryEventNotification=re={}));var ie;(function(xe){xe.None=0,xe.Full=1,xe.Incremental=2})(ie||(t.TextDocumentSyncKind=ie={}));var me;(function(xe){xe.method="textDocument/didOpen",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(me||(t.DidOpenTextDocumentNotification=me={}));var te;(function(xe){function Nt(yt){let Rt=yt;return Rt!=null&&typeof Rt.text=="string"&&Rt.range!==void 0&&(Rt.rangeLength===void 0||typeof Rt.rangeLength=="number")}M(Nt,"isIncremental"),xe.isIncremental=Nt;function Tt(yt){let Rt=yt;return Rt!=null&&typeof Rt.text=="string"&&Rt.range===void 0&&Rt.rangeLength===void 0}M(Tt,"isFull"),xe.isFull=Tt})(te||(t.TextDocumentContentChangeEvent=te={}));var _e;(function(xe){xe.method="textDocument/didChange",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var $e;(function(xe){xe.method="textDocument/didClose",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})($e||(t.DidCloseTextDocumentNotification=$e={}));var Fe;(function(xe){xe.method="textDocument/didSave",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(Fe||(t.DidSaveTextDocumentNotification=Fe={}));var ce;(function(xe){xe.Manual=1,xe.AfterDelay=2,xe.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var he;(function(xe){xe.method="textDocument/willSave",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(he||(t.WillSaveTextDocumentNotification=he={}));var Te;(function(xe){xe.method="textDocument/willSaveWaitUntil",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Te||(t.WillSaveTextDocumentWaitUntilRequest=Te={}));var ge;(function(xe){xe.method="workspace/didChangeWatchedFiles",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var He;(function(xe){xe.Created=1,xe.Changed=2,xe.Deleted=3})(He||(t.FileChangeType=He={}));var we;(function(xe){function Nt(Tt){const yt=Tt;return n.objectLiteral(yt)&&(r.URI.is(yt.baseUri)||r.WorkspaceFolder.is(yt.baseUri))&&n.string(yt.pattern)}M(Nt,"is"),xe.is=Nt})(we||(t.RelativePattern=we={}));var Me;(function(xe){xe.Create=1,xe.Change=2,xe.Delete=4})(Me||(t.WatchKind=Me={}));var je;(function(xe){xe.method="textDocument/publishDiagnostics",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(je||(t.PublishDiagnosticsNotification=je={}));var le;(function(xe){xe.Invoked=1,xe.TriggerCharacter=2,xe.TriggerForIncompleteCompletions=3})(le||(t.CompletionTriggerKind=le={}));var pe;(function(xe){xe.method="textDocument/completion",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(pe||(t.CompletionRequest=pe={}));var Ce;(function(xe){xe.method="completionItem/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ce||(t.CompletionResolveRequest=Ce={}));var ne;(function(xe){xe.method="textDocument/hover",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ne||(t.HoverRequest=ne={}));var j;(function(xe){xe.Invoked=1,xe.TriggerCharacter=2,xe.ContentChange=3})(j||(t.SignatureHelpTriggerKind=j={}));var J;(function(xe){xe.method="textDocument/signatureHelp",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(J||(t.SignatureHelpRequest=J={}));var ue;(function(xe){xe.method="textDocument/definition",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ue||(t.DefinitionRequest=ue={}));var X;(function(xe){xe.method="textDocument/references",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(X||(t.ReferencesRequest=X={}));var fe;(function(xe){xe.method="textDocument/documentHighlight",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(fe||(t.DocumentHighlightRequest=fe={}));var ee;(function(xe){xe.method="textDocument/documentSymbol",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ee||(t.DocumentSymbolRequest=ee={}));var Ae;(function(xe){xe.method="textDocument/codeAction",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ae||(t.CodeActionRequest=Ae={}));var Re;(function(xe){xe.method="codeAction/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Re||(t.CodeActionResolveRequest=Re={}));var Xe;(function(xe){xe.method="workspace/symbol",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Xe||(t.WorkspaceSymbolRequest=Xe={}));var Ne;(function(xe){xe.method="workspaceSymbol/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ne||(t.WorkspaceSymbolResolveRequest=Ne={}));var qe;(function(xe){xe.method="textDocument/codeLens",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(qe||(t.CodeLensRequest=qe={}));var De;(function(xe){xe.method="codeLens/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(De||(t.CodeLensResolveRequest=De={}));var Ke;(function(xe){xe.method="workspace/codeLens/refresh",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType0(xe.method)})(Ke||(t.CodeLensRefreshRequest=Ke={}));var ze;(function(xe){xe.method="textDocument/documentLink",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ze||(t.DocumentLinkRequest=ze={}));var st;(function(xe){xe.method="documentLink/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(st||(t.DocumentLinkResolveRequest=st={}));var Oe;(function(xe){xe.method="textDocument/formatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Oe||(t.DocumentFormattingRequest=Oe={}));var mt;(function(xe){xe.method="textDocument/rangeFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(mt||(t.DocumentRangeFormattingRequest=mt={}));var Le;(function(xe){xe.method="textDocument/rangesFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Le||(t.DocumentRangesFormattingRequest=Le={}));var St;(function(xe){xe.method="textDocument/onTypeFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(St||(t.DocumentOnTypeFormattingRequest=St={}));var At;(function(xe){xe.Identifier=1})(At||(t.PrepareSupportDefaultBehavior=At={}));var lt;(function(xe){xe.method="textDocument/rename",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(lt||(t.RenameRequest=lt={}));var zt;(function(xe){xe.method="textDocument/prepareRename",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(zt||(t.PrepareRenameRequest=zt={}));var It;(function(xe){xe.method="workspace/executeCommand",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(It||(t.ExecuteCommandRequest=It={}));var ft;(function(xe){xe.method="workspace/applyEdit",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ft||(t.ApplyWorkspaceEditRequest=ft={}))}}),DZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=_3();function r(n,i,s,a){return e.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,e.createMessageConnection)(n,i,s,a)}M(r,"createProtocolConnection"),t.createProtocolConnection=r}}),OZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(s,a,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(a,o);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:M(function(){return a[o]},"get")}),Object.defineProperty(s,l,u)}):(function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]})),r=t&&t.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(_3(),t),r((_7(),kee(mO)),t),r(Es(),t),r(NZt(),t);var n=DZt();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:M(function(){return n.createProtocolConnection},"get")});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),PZt=pn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(s,a,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(a,o);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:M(function(){return a[o]},"get")}),Object.defineProperty(s,l,u)}):(function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]})),r=t&&t.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=ige();r(ige(),t),r(OZt(),t);function i(s,a,o,l){return(0,n.createMessageConnection)(s,a,o,l)}M(i,"createProtocolConnection"),t.createProtocolConnection=i}}),RIe={};um(RIe,{AbstractAstReflection:()=>Mee,AbstractCstNode:()=>_re,AbstractLangiumParser:()=>Ire,AbstractParserErrorMessageProvider:()=>mHe,AbstractThreadedAsyncParser:()=>lcr,AstUtils:()=>Ree,BiMap:()=>II,Cancellation:()=>$i,CompositeCstNodeImpl:()=>fP,ContextCache:()=>xP,CstNodeBuilder:()=>fHe,CstUtils:()=>Eee,DEFAULT_TOKENIZE_OPTIONS:()=>Kre,DONE_RESULT:()=>fl,DatatypeSymbol:()=>MI,DefaultAstNodeDescriptionProvider:()=>UHe,DefaultAstNodeLocator:()=>jHe,DefaultAsyncParser:()=>dGe,DefaultCommentProvider:()=>hGe,DefaultConfigurationProvider:()=>XHe,DefaultDocumentBuilder:()=>KHe,DefaultDocumentValidator:()=>qHe,DefaultHydrator:()=>pGe,DefaultIndexManager:()=>ZHe,DefaultJsonSerializer:()=>VHe,DefaultLangiumDocumentFactory:()=>IHe,DefaultLangiumDocuments:()=>NHe,DefaultLangiumProfiler:()=>fcr,DefaultLexer:()=>Zre,DefaultLexerErrorMessageProvider:()=>JHe,DefaultLinker:()=>DHe,DefaultNameProvider:()=>OHe,DefaultReferenceDescriptionProvider:()=>YHe,DefaultReferences:()=>PHe,DefaultScopeComputation:()=>$He,DefaultScopeProvider:()=>zHe,DefaultServiceRegistry:()=>HHe,DefaultTokenBuilder:()=>mP,DefaultValueConverter:()=>Fre,DefaultWorkspaceLock:()=>fGe,DefaultWorkspaceManager:()=>QHe,Deferred:()=>D0,Disposable:()=>iy,DisposableCache:()=>bP,DocumentCache:()=>FHe,DocumentState:()=>Mn,DocumentValidator:()=>yu,EMPTY_SCOPE:()=>icr,EMPTY_STREAM:()=>_5,EmptyFileSystem:()=>_o,EmptyFileSystemProvider:()=>yGe,ErrorWithLocation:()=>EO,GrammarAST:()=>IIe,GrammarUtils:()=>ste,IndentationAwareLexer:()=>ucr,IndentationAwareTokenBuilder:()=>mGe,JSDocDocumentationProvider:()=>uGe,LangiumCompletionParser:()=>yHe,LangiumParser:()=>gHe,LangiumParserErrorMessageProvider:()=>Nre,LeafCstNodeImpl:()=>AI,LexingMode:()=>W1,MapScope:()=>ncr,Module:()=>PY,MultiMap:()=>O0,MultiMapScope:()=>BHe,OperationCancelled:()=>xd,ParserWorker:()=>ccr,ProfilingTask:()=>bGe,Reduction:()=>eE,RefResolving:()=>n1,RegExpUtils:()=>ote,RootCstNodeImpl:()=>Lre,SimpleCache:()=>qre,StreamImpl:()=>bd,StreamScope:()=>IY,TextDocument:()=>_I,TreeStreamImpl:()=>L5,URI:()=>Hc,UriTrie:()=>Gre,UriUtils:()=>kl,VALIDATE_EACH_NODE:()=>WHe,ValidationCategory:()=>NI,ValidationRegistry:()=>GHe,ValueConverter:()=>od,WorkspaceCache:()=>Ure,assertCondition:()=>ate,assertUnreachable:()=>hm,createCompletionParser:()=>Pre,createDefaultCoreModule:()=>ro,createDefaultSharedCoreModule:()=>no,createGrammarConfig:()=>Ste,createLangiumParser:()=>$re,createParser:()=>pP,delayNextTick:()=>yP,diagnosticData:()=>G1,eagerLoad:()=>ine,getDiagnosticRange:()=>jre,indentationBuilderDefaultOptions:()=>BY,inject:()=>Hn,interruptAndCheck:()=>za,isAstNode:()=>aa,isAstNodeDescription:()=>Aee,isAstNodeWithComment:()=>Yre,isCompositeCstNode:()=>E0,isIMultiModeLexerDefinition:()=>CP,isJSDoc:()=>Jre,isLeafCstNode:()=>cv,isLinkingError:()=>p1,isMultiReference:()=>Md,isNamed:()=>Wre,isOperationCancelled:()=>Mv,isReference:()=>Cl,isRootCstNode:()=>vO,isTokenTypeArray:()=>TP,isTokenTypeDictionary:()=>DI,loadGrammarFromJson:()=>io,parseJSDoc:()=>Qre,prepareLangiumParser:()=>Bre,setInterruptionPeriod:()=>zre,startCancelableOperation:()=>vP,stream:()=>yi,toDiagnosticData:()=>Xre,toDiagnosticSeverity:()=>ES});var Eee={};um(Eee,{DefaultNameRegexp:()=>ete,RangeComparison:()=>hd,compareRange:()=>Qee,findCommentNode:()=>tte,findDeclarationNodeAtOffset:()=>ZIe,findLeafNodeAtOffset:()=>SO,findLeafNodeBeforeOffset:()=>rte,flattenCst:()=>KIe,getDatatypeNode:()=>XIe,getInteriorNodes:()=>eNe,getNextNode:()=>QIe,getPreviousNode:()=>ite,getStartlineNode:()=>JIe,inRange:()=>Jee,isChildNode:()=>Zee,isCommentNode:()=>hI,streamCst:()=>O5,toDocumentSegment:()=>P5,tokenToRange:()=>tE});function aa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}M(aa,"isAstNode");function Cl(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}M(Cl,"isReference");function Md(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}M(Md,"isMultiReference");function Aee(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}M(Aee,"isAstNodeDescription");function p1(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}M(p1,"isLinkingError");var gx,Mee=(gx=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return aa(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=a,a}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const s of n)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}},M(gx,"AbstractAstReflection"),gx);function E0(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}M(E0,"isCompositeCstNode");function cv(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}M(cv,"isLeafCstNode");function vO(t){return E0(t)&&typeof t.fullText=="string"}M(vO,"isRootCstNode");var tc,bd=(tc=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:M(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new tc(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return fl})}join(e=","){const r=this.iterator();let n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=_Ie(i.value)),s=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,s=n.next();for(;!s.done;){if(i>=r&&s.value===e)return i;s=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new tc(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?fl:{done:!1,value:e(i)}})}filter(e){return new tc(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return fl})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,s=n.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const s=this.recursiveReduce(e,r,n);return s===void 0?i.value:r(s,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new tc(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:i}=this.nextFn(r.this);if(!n){const s=e(i);if(J6(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return fl})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new tc(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}const{done:i,value:s}=r.nextFn(n.this);if(!i)if(J6(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return fl})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new tc(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?fl:this.nextFn(r.state)))}distinct(e){return new tc(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return fl})}exclude(e,r){const n=new Set;for(const i of e){const s=r?r(i):i;n.add(s)}return this.filter(i=>{const s=r?r(i):i;return!n.has(s)})}},M(tc,"StreamImpl"),tc);function _Ie(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}M(_Ie,"toString");function J6(t){return!!t&&typeof t[Symbol.iterator]=="function"}M(J6,"isIterable");var _5=new bd(()=>{},()=>fl),fl=Object.freeze({done:!0,value:void 0});function yi(...t){if(t.length===1){const e=t[0];if(e instanceof bd)return e;if(J6(e))return new bd(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new bd(()=>({index:0}),r=>r.index1?new bd(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return fl})}iterator(){const e={state:this.startFn(),next:M(()=>this.nextFn(e.state),"next"),prune:M(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},M(mx,"TreeStreamImpl"),mx),eE;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}M(e,"sum"),t.sum=e;function r(s){return s.reduce((a,o)=>a*o,0)}M(r,"product"),t.product=r;function n(s){return s.reduce((a,o)=>Math.min(a,o))}M(n,"min"),t.min=n;function i(s){return s.reduce((a,o)=>Math.max(a,o))}M(i,"max"),t.max=i})(eE||(eE={}));var Ree={};um(Ree,{assignMandatoryProperties:()=>_ee,copyAstNode:()=>ZL,findRootNode:()=>Hb,getContainerOfType:()=>uv,getDocument:()=>wh,getReferenceNodes:()=>XL,hasContainerOfType:()=>LIe,linkContentToContainer:()=>I5,streamAllContents:()=>Q0,streamAst:()=>Th,streamContents:()=>I7,streamReferences:()=>N5});function I5(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,s)=>{aa(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=s,e.deep&&I5(i,e))}):aa(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&I5(n,e)))}M(I5,"linkContentToContainer");function uv(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}M(uv,"getContainerOfType");function LIe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}M(LIe,"hasContainerOfType");function wh(t){const r=Hb(t).$document;if(!r)throw new Error("AST node has no document.");return r}M(wh,"getDocument");function Hb(t){for(;t.$container;)t=t.$container;return t}M(Hb,"findRootNode");function XL(t){return Cl(t)?t.ref?[t.ref]:[]:Md(t)?t.items.map(e=>e.ref):[]}M(XL,"getReferenceNodes");function I7(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new bd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexI7(r,e))}M(Q0,"streamAllContents");function Th(t,e){if(t){if(e!=null&&e.range&&!KL(t,e.range))return new L5(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new L5(t,r=>I7(r,e),{includeRoot:!0})}M(Th,"streamAst");function KL(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?Jee(r,e):!1}M(KL,"isAstNodeInRange");function N5(t){return new bd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexXl,AbstractParserRule:()=>dS,AbstractRule:()=>ob,AbstractType:()=>Ac,Action:()=>Ap,Alternatives:()=>fS,ArrayLiteral:()=>QL,ArrayType:()=>JL,Assignment:()=>Mp,BooleanLiteral:()=>eI,CharacterRange:()=>Rp,Condition:()=>_p,Conjunction:()=>pS,CrossReference:()=>Lp,Disjunction:()=>gS,EndOfFile:()=>tI,Grammar:()=>Af,GrammarImport:()=>rI,Group:()=>g1,InferredType:()=>nI,InfixRule:()=>td,InfixRuleOperatorList:()=>mS,InfixRuleOperators:()=>iI,Interface:()=>lb,Keyword:()=>cb,LangiumGrammarAstReflection:()=>Kee,LangiumGrammarTerminals:()=>$Zt,NamedArgument:()=>ub,NegatedToken:()=>m1,Negation:()=>sI,NumberLiteral:()=>aI,Parameter:()=>hb,ParameterReference:()=>oI,ParserRule:()=>Yu,ReferenceType:()=>yS,RegexToken:()=>y1,ReturnType:()=>lI,RuleCall:()=>v1,SimpleType:()=>db,StringLiteral:()=>cI,TerminalAlternatives:()=>b1,TerminalElement:()=>Kl,TerminalGroup:()=>x1,TerminalRule:()=>Mf,TerminalRuleCall:()=>w1,Type:()=>vS,TypeAttribute:()=>T1,TypeDefinition:()=>C1,UnionType:()=>uI,UnorderedGroup:()=>bS,UntilToken:()=>k1,ValueLiteral:()=>S1,Wildcard:()=>fb,isAbstractElement:()=>bO,isAbstractParserRule:()=>hv,isAbstractRule:()=>NIe,isAbstractType:()=>DIe,isAction:()=>Dg,isAlternatives:()=>xO,isArrayLiteral:()=>OIe,isArrayType:()=>Iee,isAssignment:()=>A0,isBooleanLiteral:()=>Nee,isCharacterRange:()=>Dee,isCondition:()=>PIe,isConjunction:()=>Oee,isCrossReference:()=>dv,isDisjunction:()=>Pee,isEndOfFile:()=>$ee,isGrammar:()=>$Ie,isGrammarImport:()=>BIe,isGroup:()=>fv,isInferredType:()=>N7,isInfixRule:()=>D5,isInfixRuleOperatorList:()=>FIe,isInfixRuleOperators:()=>zIe,isInterface:()=>Bee,isKeyword:()=>M0,isNamedArgument:()=>VIe,isNegatedToken:()=>Fee,isNegation:()=>zee,isNumberLiteral:()=>HIe,isParameter:()=>GIe,isParameterReference:()=>Vee,isParserRule:()=>Il,isReferenceType:()=>Hee,isRegexToken:()=>Gee,isReturnType:()=>Wee,isRuleCall:()=>R0,isSimpleType:()=>wO,isStringLiteral:()=>WIe,isTerminalAlternatives:()=>qee,isTerminalElement:()=>qIe,isTerminalGroup:()=>Uee,isTerminalRule:()=>Bu,isTerminalRuleCall:()=>TO,isType:()=>CO,isTypeAttribute:()=>UIe,isTypeDefinition:()=>YIe,isUnionType:()=>Yee,isUnorderedGroup:()=>kO,isUntilToken:()=>jee,isValueLiteral:()=>jIe,isWildcard:()=>Xee,reflection:()=>qr});var $Zt={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Xl={$type:"AbstractElement",cardinality:"cardinality"};function bO(t){return qr.isInstance(t,Xl.$type)}M(bO,"isAbstractElement");var dS={$type:"AbstractParserRule"};function hv(t){return qr.isInstance(t,dS.$type)}M(hv,"isAbstractParserRule");var ob={$type:"AbstractRule"};function NIe(t){return qr.isInstance(t,ob.$type)}M(NIe,"isAbstractRule");var Ac={$type:"AbstractType"};function DIe(t){return qr.isInstance(t,Ac.$type)}M(DIe,"isAbstractType");var Ap={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Dg(t){return qr.isInstance(t,Ap.$type)}M(Dg,"isAction");var fS={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function xO(t){return qr.isInstance(t,fS.$type)}M(xO,"isAlternatives");var QL={$type:"ArrayLiteral",elements:"elements"};function OIe(t){return qr.isInstance(t,QL.$type)}M(OIe,"isArrayLiteral");var JL={$type:"ArrayType",elementType:"elementType"};function Iee(t){return qr.isInstance(t,JL.$type)}M(Iee,"isArrayType");var Mp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function A0(t){return qr.isInstance(t,Mp.$type)}M(A0,"isAssignment");var eI={$type:"BooleanLiteral",true:"true"};function Nee(t){return qr.isInstance(t,eI.$type)}M(Nee,"isBooleanLiteral");var Rp={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Dee(t){return qr.isInstance(t,Rp.$type)}M(Dee,"isCharacterRange");var _p={$type:"Condition"};function PIe(t){return qr.isInstance(t,_p.$type)}M(PIe,"isCondition");var pS={$type:"Conjunction",left:"left",right:"right"};function Oee(t){return qr.isInstance(t,pS.$type)}M(Oee,"isConjunction");var Lp={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function dv(t){return qr.isInstance(t,Lp.$type)}M(dv,"isCrossReference");var gS={$type:"Disjunction",left:"left",right:"right"};function Pee(t){return qr.isInstance(t,gS.$type)}M(Pee,"isDisjunction");var tI={$type:"EndOfFile",cardinality:"cardinality"};function $ee(t){return qr.isInstance(t,tI.$type)}M($ee,"isEndOfFile");var Af={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function $Ie(t){return qr.isInstance(t,Af.$type)}M($Ie,"isGrammar");var rI={$type:"GrammarImport",path:"path"};function BIe(t){return qr.isInstance(t,rI.$type)}M(BIe,"isGrammarImport");var g1={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function fv(t){return qr.isInstance(t,g1.$type)}M(fv,"isGroup");var nI={$type:"InferredType",name:"name"};function N7(t){return qr.isInstance(t,nI.$type)}M(N7,"isInferredType");var td={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function D5(t){return qr.isInstance(t,td.$type)}M(D5,"isInfixRule");var mS={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function FIe(t){return qr.isInstance(t,mS.$type)}M(FIe,"isInfixRuleOperatorList");var iI={$type:"InfixRuleOperators",precedences:"precedences"};function zIe(t){return qr.isInstance(t,iI.$type)}M(zIe,"isInfixRuleOperators");var lb={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Bee(t){return qr.isInstance(t,lb.$type)}M(Bee,"isInterface");var cb={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function M0(t){return qr.isInstance(t,cb.$type)}M(M0,"isKeyword");var ub={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function VIe(t){return qr.isInstance(t,ub.$type)}M(VIe,"isNamedArgument");var m1={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Fee(t){return qr.isInstance(t,m1.$type)}M(Fee,"isNegatedToken");var sI={$type:"Negation",value:"value"};function zee(t){return qr.isInstance(t,sI.$type)}M(zee,"isNegation");var aI={$type:"NumberLiteral",value:"value"};function HIe(t){return qr.isInstance(t,aI.$type)}M(HIe,"isNumberLiteral");var hb={$type:"Parameter",name:"name"};function GIe(t){return qr.isInstance(t,hb.$type)}M(GIe,"isParameter");var oI={$type:"ParameterReference",parameter:"parameter"};function Vee(t){return qr.isInstance(t,oI.$type)}M(Vee,"isParameterReference");var Yu={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Il(t){return qr.isInstance(t,Yu.$type)}M(Il,"isParserRule");var yS={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Hee(t){return qr.isInstance(t,yS.$type)}M(Hee,"isReferenceType");var y1={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Gee(t){return qr.isInstance(t,y1.$type)}M(Gee,"isRegexToken");var lI={$type:"ReturnType",name:"name"};function Wee(t){return qr.isInstance(t,lI.$type)}M(Wee,"isReturnType");var v1={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function R0(t){return qr.isInstance(t,v1.$type)}M(R0,"isRuleCall");var db={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function wO(t){return qr.isInstance(t,db.$type)}M(wO,"isSimpleType");var cI={$type:"StringLiteral",value:"value"};function WIe(t){return qr.isInstance(t,cI.$type)}M(WIe,"isStringLiteral");var b1={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qee(t){return qr.isInstance(t,b1.$type)}M(qee,"isTerminalAlternatives");var Kl={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function qIe(t){return qr.isInstance(t,Kl.$type)}M(qIe,"isTerminalElement");var x1={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Uee(t){return qr.isInstance(t,x1.$type)}M(Uee,"isTerminalGroup");var Mf={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Bu(t){return qr.isInstance(t,Mf.$type)}M(Bu,"isTerminalRule");var w1={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function TO(t){return qr.isInstance(t,w1.$type)}M(TO,"isTerminalRuleCall");var vS={$type:"Type",name:"name",type:"type"};function CO(t){return qr.isInstance(t,vS.$type)}M(CO,"isType");var T1={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function UIe(t){return qr.isInstance(t,T1.$type)}M(UIe,"isTypeAttribute");var C1={$type:"TypeDefinition"};function YIe(t){return qr.isInstance(t,C1.$type)}M(YIe,"isTypeDefinition");var uI={$type:"UnionType",types:"types"};function Yee(t){return qr.isInstance(t,uI.$type)}M(Yee,"isUnionType");var bS={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function kO(t){return qr.isInstance(t,bS.$type)}M(kO,"isUnorderedGroup");var k1={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function jee(t){return qr.isInstance(t,k1.$type)}M(jee,"isUntilToken");var S1={$type:"ValueLiteral"};function jIe(t){return qr.isInstance(t,S1.$type)}M(jIe,"isValueLiteral");var fb={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Xee(t){return qr.isInstance(t,fb.$type)}M(Xee,"isWildcard");var yx,Kee=(yx=class extends Mee{constructor(){super(...arguments),this.types={AbstractElement:{name:Xl.$type,properties:{cardinality:{name:Xl.cardinality}},superTypes:[]},AbstractParserRule:{name:dS.$type,properties:{},superTypes:[ob.$type,Ac.$type]},AbstractRule:{name:ob.$type,properties:{},superTypes:[]},AbstractType:{name:Ac.$type,properties:{},superTypes:[]},Action:{name:Ap.$type,properties:{cardinality:{name:Ap.cardinality},feature:{name:Ap.feature},inferredType:{name:Ap.inferredType},operator:{name:Ap.operator},type:{name:Ap.type,referenceType:Ac.$type}},superTypes:[Xl.$type]},Alternatives:{name:fS.$type,properties:{cardinality:{name:fS.cardinality},elements:{name:fS.elements,defaultValue:[]}},superTypes:[Xl.$type]},ArrayLiteral:{name:QL.$type,properties:{elements:{name:QL.elements,defaultValue:[]}},superTypes:[S1.$type]},ArrayType:{name:JL.$type,properties:{elementType:{name:JL.elementType}},superTypes:[C1.$type]},Assignment:{name:Mp.$type,properties:{cardinality:{name:Mp.cardinality},feature:{name:Mp.feature},operator:{name:Mp.operator},predicate:{name:Mp.predicate},terminal:{name:Mp.terminal}},superTypes:[Xl.$type]},BooleanLiteral:{name:eI.$type,properties:{true:{name:eI.true,defaultValue:!1}},superTypes:[_p.$type,S1.$type]},CharacterRange:{name:Rp.$type,properties:{cardinality:{name:Rp.cardinality},left:{name:Rp.left},lookahead:{name:Rp.lookahead},parenthesized:{name:Rp.parenthesized,defaultValue:!1},right:{name:Rp.right}},superTypes:[Kl.$type]},Condition:{name:_p.$type,properties:{},superTypes:[]},Conjunction:{name:pS.$type,properties:{left:{name:pS.left},right:{name:pS.right}},superTypes:[_p.$type]},CrossReference:{name:Lp.$type,properties:{cardinality:{name:Lp.cardinality},deprecatedSyntax:{name:Lp.deprecatedSyntax,defaultValue:!1},isMulti:{name:Lp.isMulti,defaultValue:!1},terminal:{name:Lp.terminal},type:{name:Lp.type,referenceType:Ac.$type}},superTypes:[Xl.$type]},Disjunction:{name:gS.$type,properties:{left:{name:gS.left},right:{name:gS.right}},superTypes:[_p.$type]},EndOfFile:{name:tI.$type,properties:{cardinality:{name:tI.cardinality}},superTypes:[Xl.$type]},Grammar:{name:Af.$type,properties:{imports:{name:Af.imports,defaultValue:[]},interfaces:{name:Af.interfaces,defaultValue:[]},isDeclared:{name:Af.isDeclared,defaultValue:!1},name:{name:Af.name},rules:{name:Af.rules,defaultValue:[]},types:{name:Af.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:rI.$type,properties:{path:{name:rI.path}},superTypes:[]},Group:{name:g1.$type,properties:{cardinality:{name:g1.cardinality},elements:{name:g1.elements,defaultValue:[]},guardCondition:{name:g1.guardCondition},predicate:{name:g1.predicate}},superTypes:[Xl.$type]},InferredType:{name:nI.$type,properties:{name:{name:nI.name}},superTypes:[Ac.$type]},InfixRule:{name:td.$type,properties:{call:{name:td.call},dataType:{name:td.dataType},inferredType:{name:td.inferredType},name:{name:td.name},operators:{name:td.operators},parameters:{name:td.parameters,defaultValue:[]},returnType:{name:td.returnType,referenceType:Ac.$type}},superTypes:[dS.$type]},InfixRuleOperatorList:{name:mS.$type,properties:{associativity:{name:mS.associativity},operators:{name:mS.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:iI.$type,properties:{precedences:{name:iI.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:lb.$type,properties:{attributes:{name:lb.attributes,defaultValue:[]},name:{name:lb.name},superTypes:{name:lb.superTypes,defaultValue:[],referenceType:Ac.$type}},superTypes:[Ac.$type]},Keyword:{name:cb.$type,properties:{cardinality:{name:cb.cardinality},predicate:{name:cb.predicate},value:{name:cb.value}},superTypes:[Xl.$type]},NamedArgument:{name:ub.$type,properties:{calledByName:{name:ub.calledByName,defaultValue:!1},parameter:{name:ub.parameter,referenceType:hb.$type},value:{name:ub.value}},superTypes:[]},NegatedToken:{name:m1.$type,properties:{cardinality:{name:m1.cardinality},lookahead:{name:m1.lookahead},parenthesized:{name:m1.parenthesized,defaultValue:!1},terminal:{name:m1.terminal}},superTypes:[Kl.$type]},Negation:{name:sI.$type,properties:{value:{name:sI.value}},superTypes:[_p.$type]},NumberLiteral:{name:aI.$type,properties:{value:{name:aI.value}},superTypes:[S1.$type]},Parameter:{name:hb.$type,properties:{name:{name:hb.name}},superTypes:[]},ParameterReference:{name:oI.$type,properties:{parameter:{name:oI.parameter,referenceType:hb.$type}},superTypes:[_p.$type]},ParserRule:{name:Yu.$type,properties:{dataType:{name:Yu.dataType},definition:{name:Yu.definition},entry:{name:Yu.entry,defaultValue:!1},fragment:{name:Yu.fragment,defaultValue:!1},inferredType:{name:Yu.inferredType},name:{name:Yu.name},parameters:{name:Yu.parameters,defaultValue:[]},returnType:{name:Yu.returnType,referenceType:Ac.$type}},superTypes:[dS.$type]},ReferenceType:{name:yS.$type,properties:{isMulti:{name:yS.isMulti,defaultValue:!1},referenceType:{name:yS.referenceType}},superTypes:[C1.$type]},RegexToken:{name:y1.$type,properties:{cardinality:{name:y1.cardinality},lookahead:{name:y1.lookahead},parenthesized:{name:y1.parenthesized,defaultValue:!1},regex:{name:y1.regex}},superTypes:[Kl.$type]},ReturnType:{name:lI.$type,properties:{name:{name:lI.name}},superTypes:[]},RuleCall:{name:v1.$type,properties:{arguments:{name:v1.arguments,defaultValue:[]},cardinality:{name:v1.cardinality},predicate:{name:v1.predicate},rule:{name:v1.rule,referenceType:ob.$type}},superTypes:[Xl.$type]},SimpleType:{name:db.$type,properties:{primitiveType:{name:db.primitiveType},stringType:{name:db.stringType},typeRef:{name:db.typeRef,referenceType:Ac.$type}},superTypes:[C1.$type]},StringLiteral:{name:cI.$type,properties:{value:{name:cI.value}},superTypes:[S1.$type]},TerminalAlternatives:{name:b1.$type,properties:{cardinality:{name:b1.cardinality},elements:{name:b1.elements,defaultValue:[]},lookahead:{name:b1.lookahead},parenthesized:{name:b1.parenthesized,defaultValue:!1}},superTypes:[Kl.$type]},TerminalElement:{name:Kl.$type,properties:{cardinality:{name:Kl.cardinality},lookahead:{name:Kl.lookahead},parenthesized:{name:Kl.parenthesized,defaultValue:!1}},superTypes:[Xl.$type]},TerminalGroup:{name:x1.$type,properties:{cardinality:{name:x1.cardinality},elements:{name:x1.elements,defaultValue:[]},lookahead:{name:x1.lookahead},parenthesized:{name:x1.parenthesized,defaultValue:!1}},superTypes:[Kl.$type]},TerminalRule:{name:Mf.$type,properties:{definition:{name:Mf.definition},fragment:{name:Mf.fragment,defaultValue:!1},hidden:{name:Mf.hidden,defaultValue:!1},name:{name:Mf.name},type:{name:Mf.type}},superTypes:[ob.$type]},TerminalRuleCall:{name:w1.$type,properties:{cardinality:{name:w1.cardinality},lookahead:{name:w1.lookahead},parenthesized:{name:w1.parenthesized,defaultValue:!1},rule:{name:w1.rule,referenceType:Mf.$type}},superTypes:[Kl.$type]},Type:{name:vS.$type,properties:{name:{name:vS.name},type:{name:vS.type}},superTypes:[Ac.$type]},TypeAttribute:{name:T1.$type,properties:{defaultValue:{name:T1.defaultValue},isOptional:{name:T1.isOptional,defaultValue:!1},name:{name:T1.name},type:{name:T1.type}},superTypes:[]},TypeDefinition:{name:C1.$type,properties:{},superTypes:[]},UnionType:{name:uI.$type,properties:{types:{name:uI.types,defaultValue:[]}},superTypes:[C1.$type]},UnorderedGroup:{name:bS.$type,properties:{cardinality:{name:bS.cardinality},elements:{name:bS.elements,defaultValue:[]}},superTypes:[Xl.$type]},UntilToken:{name:k1.$type,properties:{cardinality:{name:k1.cardinality},lookahead:{name:k1.lookahead},parenthesized:{name:k1.parenthesized,defaultValue:!1},terminal:{name:k1.terminal}},superTypes:[Kl.$type]},ValueLiteral:{name:S1.$type,properties:{},superTypes:[]},Wildcard:{name:fb.$type,properties:{cardinality:{name:fb.cardinality},lookahead:{name:fb.lookahead},parenthesized:{name:fb.parenthesized,defaultValue:!1}},superTypes:[Kl.$type]}}}},M(yx,"LangiumGrammarAstReflection"),yx),qr=new Kee;function XIe(t){let e=t,r=!1;for(;e;){const n=uv(e.grammarSource,Il);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}M(XIe,"getDatatypeNode");function O5(t){return new L5(t,e=>E0(e)?e.content:[],{includeRoot:!0})}M(O5,"streamCst");function KIe(t){return O5(t).filter(cv)}M(KIe,"flattenCst");function Zee(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}M(Zee,"isChildNode");function tE(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}M(tE,"tokenToRange");function P5(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}M(P5,"toDocumentSegment");var hd;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(hd||(hd={}));function Qee(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return hd.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linehd.After}M(Jee,"inRange");var ete=/^[\w\p{L}]$/u;function ZIe(t,e,r=ete){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return SO(t,e)}}M(ZIe,"findDeclarationNodeAtOffset");function tte(t,e){if(t){const r=ite(t,!0);if(r&&hI(r,e))return r;if(vO(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const s=t.content[i];if(hI(s,e))return s}}}}M(tte,"findCommentNode");function hI(t,e){return cv(t)&&e.includes(t.tokenType.name)}M(hI,"isCommentNode");function SO(t,e){if(cv(t))return t;if(E0(t)){const r=nte(t,e,!1);if(r)return SO(r,e)}}M(SO,"findLeafNodeAtOffset");function rte(t,e){if(cv(t))return t;if(E0(t)){const r=nte(t,e,!0);if(r)return rte(r,e)}}M(rte,"findLeafNodeBeforeOffset");function nte(t,e,r){let n=0,i=t.content.length-1,s;for(;n<=i;){const a=Math.floor((n+i)/2),o=t.content[a];if(o.offset<=e&&o.end>e)return o;o.end<=e?(s=r?o:void 0,n=a+1):i=a-1}return s}M(nte,"binarySearch");function ite(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}M(ite,"getPreviousNode");function QIe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nvte,findNameAssignment:()=>NO,findNodeForKeyword:()=>yte,findNodeForProperty:()=>_O,findNodesForKeyword:()=>cNe,findNodesForKeywordInternal:()=>IO,findNodesForProperty:()=>mte,getActionAtElement:()=>xte,getActionType:()=>Tte,getAllReachableRules:()=>RO,getAllRulesUsedForCrossReferences:()=>lNe,getCrossReferenceTerminal:()=>pte,getEntryRule:()=>hte,getExplicitRuleType:()=>O7,getHiddenRules:()=>dte,getRuleType:()=>Cte,getRuleTypeName:()=>pNe,getTypeName:()=>Py,isArrayCardinality:()=>hNe,isArrayOperator:()=>dNe,isCommentTerminal:()=>gte,isDataType:()=>fNe,isDataTypeRule:()=>D7,isOptionalCardinality:()=>uNe,terminalRegex:()=>P7});var vx,EO=(vx=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},M(vx,"ErrorWithLocation"),vx);function hm(t,e="Error: Got unexpected value."){throw new Error(e)}M(hm,"assertUnreachable");function ate(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}M(ate,"assertCondition");var ote={};um(ote,{NEWLINE_REGEXP:()=>iNe,escapeRegExp:()=>L3,getTerminalParts:()=>aNe,isMultilineComment:()=>lte,isWhitespace:()=>MO,partialMatches:()=>cte,partialRegExp:()=>ute,whitespaceCharacters:()=>oNe});function Jr(t){return t.charCodeAt(0)}M(Jr,"cc");function wR(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}M(wR,"insertToSet");function I2(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}M(I2,"addFlag");function e1(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}M(e1,"ASSERT_EXISTS");function rNe(){throw Error("Internal Error - Should never get here!")}M(rNe,"ASSERT_NEVER_REACH_HERE");function iY(t){return t.type==="Character"}M(iY,"isCharacter");var dI=[];for(let t=Jr("0");t<=Jr("9");t++)dI.push(t);var fI=[Jr("_")].concat(dI);for(let t=Jr("a");t<=Jr("z");t++)fI.push(t);for(let t=Jr("A");t<=Jr("Z");t++)fI.push(t);var sge=[Jr(" "),Jr("\f"),Jr(` +`),Jr("\r"),Jr(" "),Jr("\v"),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr("\u2028"),Jr("\u2029"),Jr(" "),Jr(" "),Jr(" "),Jr("\uFEFF")],BZt=/[0-9a-fA-F]/,V8=/[0-9]/,FZt=/[1-9]/,bx,nNe=(bx=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":I2(n,"global");break;case"i":I2(n,"ignoreCase");break;case"m":I2(n,"multiLine");break;case"u":I2(n,"unicode");break;case"y":I2(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}}e1(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return rNe()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),r={atLeast:i,atMost:s}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;e1(r);break}if(!(e===!0&&r===void 0)&&e1(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()),e1(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Jr(` +`),Jr("\r"),Jr("\u2028"),Jr("\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=dI;break;case"D":e=dI,r=!0;break;case"s":e=sge;break;case"S":e=sge,r=!0;break;case"w":e=fI;break;case"W":e=fI,r=!0;break}if(e1(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Jr("\f");break;case"n":e=Jr(` +`);break;case"r":e=Jr("\r");break;case"t":e=Jr(" ");break;case"v":e=Jr("\v");break}if(e1(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:Jr("\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:Jr(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:Jr(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,iY(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,iY(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},M(yx,"RegExpParser"),yx),vx,kO=(vx=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},M(vx,"BaseRegExpVisitor"),vx),QIe=/\r?\n/gm,JIe=new ZIe,bx,kZt=(bx=class extends kO{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=M3(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)}},M(bx,"TerminalRegExpVisitor"),bx),F1=new kZt;function eNe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=JIe.pattern(t),r=[];for(const n of e.value.value)F1.reset(t),F1.visit(n),r.push({start:F1.startRegexp,end:F1.endRegex});return r}catch{return[]}}M(eNe,"getTerminalParts");function ite(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),F1.reset(t),F1.visit(JIe.pattern(t)),F1.multiline}catch{return!1}}M(ite,"isMultilineComment");var tNe=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function SO(t){const e=typeof t=="string"?new RegExp(t):t;return tNe.some(r=>e.test(r))}M(SO,"isWhitespace");function M3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}M(M3,"escapeRegExp");function ste(t,e){const r=ate(t),n=e.match(r);return!!n&&n[0].length>0}M(ste,"partialMatches");function ate(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let s="",a;function o(u){s+=r.substr(n,u),n+=u}M(o,"appendRaw");function l(u){s+="(?:"+r.substr(n,u)+"|$)",n+=u}for(M(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?o(a[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=i()+"|$)";break;case"=":s+="(?=",n+=3,s+=i()+")";break;case"!":a=n,n+=3,i(),s+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),s+=r.substr(a,n-a);break;default:o(r.indexOf(">",n)-n+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++n,s;default:l(1);break}return s}return M(i,"process"),new RegExp(i(),t.flags)}M(ate,"partialRegExp");function ote(t){return t.rules.find(e=>_l(e)&&e.entry)}M(ote,"getEntryRule");function lte(t){return t.rules.filter(e=>Ou(e)&&e.hidden)}M(lte,"getHiddenRules");function EO(t,e){const r=new Set,n=ote(t);if(!n)return new Set(t.rules);const i=[n].concat(lte(t));for(const a of i)cte(a,r,e);const s=new Set;for(const a of t.rules)(r.has(a.name)||Ou(a)&&a.hidden)&&s.add(a);return s}M(EO,"getAllReachableRules");function cte(t,e,r){e.add(t.name),j0(t).forEach(n=>{if(k0(n)||r&&bO(n)){const i=n.rule.ref;i&&!e.has(i.name)&&cte(i,e,r)}})}M(cte,"ruleDfs");function rNe(t){const e=new Set;return j0(t).forEach(r=>{uv(r)&&(_l(r.type.ref)&&e.add(r.type.ref),_7(r.type.ref)&&_l(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}M(rNe,"getAllRulesUsedForCrossReferences");function ute(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=_O(t.type.ref);return e==null?void 0:e.terminal}}M(ute,"getCrossReferenceTerminal");function hte(t){return t.hidden&&!SO(N7(t))}M(hte,"isCommentTerminal");function dte(t,e){return!t||!e?[]:MO(t,e,t.astNode,!0)}M(dte,"findNodesForProperty");function AO(t,e,r){if(!t||!e)return;const n=MO(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]}M(AO,"findNodeForProperty");function MO(t,e,r,n){if(!n){const i=lv(t.grammarSource,T0);if(i&&i.feature===e)return[t]}return w0(t)&&t.astNode===r?t.content.flatMap(i=>MO(i,e,r,!1)):[]}M(MO,"findNodesForPropertyInternal");function nNe(t,e){return t?RO(t,e,t==null?void 0:t.astNode):[]}M(nNe,"findNodesForKeyword");function fte(t,e,r){if(!t)return;const n=RO(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}M(fte,"findNodeForKeyword");function RO(t,e,r){if(t.astNode!==r)return[];if(C0(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=I5(t).iterator();let i;const s=[];do if(i=n.next(),!i.done){const a=i.value;a.astNode===r?C0(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):n.prune()}while(!i.done);return s}M(RO,"findNodesForKeywordInternal");function pte(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=lv(t.grammarSource,T0);if(n)return n;t=t.container}}M(pte,"findAssignment");function _O(t){let e=t;return _7(e)&&(Lg(e.$container)?e=e.$container.$container:cv(e.$container)?e=e.$container:lm(e.$container)),gte(t,e,new Map)}M(_O,"findNameAssignment");function gte(t,e,r){var i;function n(s,a){let o;return lv(s,T0)||(o=gte(a,a,r)),r.set(t,o),o}if(M(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const s of j0(e)){if(T0(s)&&s.feature.toLowerCase()==="name")return r.set(t,s),s;if(k0(s)&&_l(s.rule.ref))return n(s,s.rule.ref);if(vO(s)&&((i=s.typeRef)!=null&&i.ref))return n(s,s.typeRef.ref)}}M(gte,"findNameAssignmentInternal");function mte(t){const e=t.$container;if(hv(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const s=r[i];if(Lg(s))return s;{const a=j0(r[i]).find(Lg);if(a)return a}}}if(mO(e))return mte(e)}M(mte,"getActionAtElement");function iNe(t,e){return t==="?"||t==="*"||hv(e)&&!!e.guardCondition}M(iNe,"isOptionalCardinality");function sNe(t){return t==="*"||t==="+"}M(sNe,"isArrayCardinality");function aNe(t){return t==="+="}M(aNe,"isArrayOperator");function L7(t){return yte(t,new Set)}M(L7,"isDataTypeRule");function yte(t,e){if(e.has(t))return!0;e.add(t);for(const r of j0(t))if(k0(r)){if(!r.rule.ref||_l(r.rule.ref)&&!yte(r.rule.ref,e)||L5(r.rule.ref))return!1}else{if(T0(r))return!1;if(Lg(r))return!1}return!!t.definition}M(yte,"isDataTypeRuleInternal");function oNe(t){return hI(t.type,new Set)}M(oNe,"isDataType");function hI(t,e){if(e.has(t))return!0;if(e.add(t),Mee(t))return!1;if(Bee(t))return!1;if(Gee(t))return t.types.every(r=>hI(r,e));if(vO(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return xO(r)?hI(r.type,e):!1}else return!1}else return!1}M(hI,"isDataTypeInternal");function I7(t){if(!Ou(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}M(I7,"getExplicitRuleType");function Dy(t){if(cv(t))return _l(t)&&L7(t)?t.name:I7(t)??t.name;if(Dee(t)||xO(t)||zee(t))return t.name;if(Lg(t)){const e=vte(t);if(e)return e}else if(_7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}M(Dy,"getTypeName");function vte(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Dy(t.type.ref)}M(vte,"getActionType");function lNe(t){var e;return Ou(t)?((e=t.type)==null?void 0:e.name)??"string":_l(t)&&L7(t)?t.name:I7(t)??t.name}M(lNe,"getRuleTypeName");function bte(t){var e;return Ou(t)?((e=t.type)==null?void 0:e.name)??"string":I7(t)??t.name}M(bte,"getRuleType");function N7(t){const e={s:!1,i:!1,u:!1},r=dv(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}M(N7,"terminalRegex");var xte=/[\s\S]/.source;function dv(t,e){var r;if(Vee(t))return cNe(t);if(Hee(t))return uNe(t);if(_ee(t))return fNe(t);if(bO(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Ed(dv(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Oee(t))return dNe(t);if(Wee(t))return hNe(t);if(Fee(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),s=t.regex.substring(n+1);return e&&(e.i=s.includes("i"),e.s=s.includes("s"),e.u=s.includes("u")),Ed(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(qee(t))return Ed(xte,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}M(dv,"abstractElementToRegex");function cNe(t){return Ed(t.elements.map(e=>dv(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(cNe,"terminalAlternativesToRegex");function uNe(t){return Ed(t.elements.map(e=>dv(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(uNe,"terminalGroupToRegex");function hNe(t){return Ed(`${xte}*?${dv(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(hNe,"untilTokenToRegex");function dNe(t){return Ed(`(?!${dv(t.terminal)})${xte}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(dNe,"negateTokenToRegex");function fNe(t){return t.right?Ed(`[${vR(t.left)}-${vR(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Ed(vR(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(fNe,"characterRangeToRegex");function vR(t){return M3(t.value)}M(vR,"keywordToRegex");function Ed(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}M(Ed,"withCardinality");function wte(t){const e=[],r=t.Grammar;for(const n of r.rules)Ou(n)&&hte(n)&&ite(N7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Kee}}M(wte,"createGrammarConfig");var SZt=typeof global=="object"&&global&&global.Object===Object&&global,pNe=SZt,EZt=typeof self=="object"&&self&&self.Object===Object&&self,AZt=pNe||EZt||Function("return this")(),Zd=AZt,MZt=Zd.Symbol,Lu=MZt,gNe=Object.prototype,RZt=gNe.hasOwnProperty,_Zt=gNe.toString,xC=Lu?Lu.toStringTag:void 0;function mNe(t){var e=RZt.call(t,xC),r=t[xC];try{t[xC]=void 0;var n=!0}catch{}var i=_Zt.call(t);return n&&(e?t[xC]=r:delete t[xC]),i}M(mNe,"getRawTag");var LZt=mNe,IZt=Object.prototype,NZt=IZt.toString;function yNe(t){return NZt.call(t)}M(yNe,"objectToString");var DZt=yNe,OZt="[object Null]",PZt="[object Undefined]",ege=Lu?Lu.toStringTag:void 0;function vNe(t){return t==null?t===void 0?PZt:OZt:ege&&ege in Object(t)?LZt(t):DZt(t)}M(vNe,"baseGetTag");var cm=vNe;function bNe(t){return t!=null&&typeof t=="object"}M(bNe,"isObjectLike");var Ah=bNe,$Zt="[object Symbol]";function xNe(t){return typeof t=="symbol"||Ah(t)&&cm(t)==$Zt}M(xNe,"isSymbol");var LO=xNe;function wNe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=bQt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}M(BNe,"shortOut");var TQt=BNe;function FNe(t){return function(){return t}}M(FNe,"constant");var CQt=FNe,kQt=(function(){try{var t=pv(Object,"defineProperty");return t({},"",{}),t}catch{}})(),dI=kQt,SQt=dI?function(t,e){return dI(t,"toString",{configurable:!0,enumerable:!1,value:CQt(e),writable:!0})}:P7,EQt=SQt,AQt=TQt(EQt),MQt=AQt;function zNe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}M(YNe,"arrayIncludes");var jNe=YNe,LQt=9007199254740991,IQt=/^(?:0|[1-9]\d*)$/;function XNe(t,e){var r=typeof t;return e=e??LQt,!!e&&(r=="number"||r!="symbol"&&IQt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=PQt}M(rDe,"isLength");var Ete=rDe;function nDe(t){return t!=null&&Ete(t.length)&&!X0(t)}M(nDe,"isArrayLike");var Qd=nDe;function iDe(t,e,r){if(!Iu(r))return!1;var n=typeof e;return(n=="number"?Qd(r)&&IO(e,r.length):n=="string"&&e in r)?$7(r[e],t):!1}M(iDe,"isIterateeCall");var DO=iDe;function sDe(t){return Ste(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&DO(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n-1}M(ODe,"listCacheHas");var eer=ODe;function PDe(t,e){var r=this.__data__,n=$O(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(PDe,"listCacheSet");var ter=PDe;function mv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Lte(o,e-1,r,n,i):_te(i,o):n||(i[i.length]=o)}return i}M(Lte,"baseFlatten");var Ite=Lte;function QDe(t){var e=t==null?0:t.length;return e?Ite(t,1):[]}M(QDe,"flatten");var xh=QDe,xer=vDe(Object.getPrototypeOf,Object),JDe=xer;function eOe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++no))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&urr?new Pte:void 0;for(s.set(t,e),s.set(e,t);++d2?e[2]:void 0;for(i&&DO(e[0],e[1],i)&&(n=1);++r=nnr&&(s=$te,a=!1,e=new Pte(e));e:for(;++i-1?i[s?e[a]:a]:void 0}}M(OPe,"createFind");var cnr=OPe,unr=Math.max;function PPe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:O7(r);return i<0&&(i=unr(n+i,0)),GNe(t,Jd(e),i)}M(PPe,"findIndex");var hnr=PPe,dnr=cnr(hnr),O5=dnr;function $Pe(t){return t&&t.length?t[0]:void 0}M($Pe,"head");var Mh=$Pe;function BPe(t,e){var r=-1,n=Qd(t)?Array(t.length):[];return bv(t,function(i,s,a){n[++r]=e(i,s,a)}),n}M(BPe,"baseMap");var fnr=BPe;function FPe(t,e){var r=Kn(t)?D7:fnr;return r(t,Jd(e))}M(FPe,"map");var Lr=FPe;function zPe(t,e){return Ite(Lr(t,e),1)}M(zPe,"flatMap");var ku=zPe,pnr=Object.prototype,gnr=pnr.hasOwnProperty,mnr=enr(function(t,e,r){gnr.call(t,r)?t[r].push(e):kte(t,r,[e])}),ynr=mnr,vnr=Object.prototype,bnr=vnr.hasOwnProperty;function VPe(t,e){return t!=null&&bnr.call(t,e)}M(VPe,"baseHas");var xnr=VPe;function HPe(t,e){return t!=null&&aPe(t,e,xnr)}M(HPe,"has");var jr=HPe,wnr="[object String]";function GPe(t){return typeof t=="string"||!Kn(t)&&Ah(t)&&cm(t)==wnr}M(GPe,"isString");var fc=GPe;function WPe(t,e){return D7(e,function(r){return t[r]})}M(WPe,"baseValues");var Tnr=WPe;function qPe(t){return t==null?[]:Tnr(t,Hc(t))}M(qPe,"values");var wa=qPe,Cnr=Math.max;function UPe(t,e,r,n){t=Qd(t)?t:wa(t),r=r&&!n?O7(r):0;var i=t.length;return r<0&&(r=Cnr(i+r,0)),fc(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Cte(t,e,r)>-1}M(UPe,"includes");var zl=UPe,knr=Math.max;function YPe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:O7(r);return i<0&&(i=knr(n+i,0)),Cte(t,e,i)}M(YPe,"indexOf");var Ige=YPe,Snr="[object Map]",Enr="[object Set]",Anr=Object.prototype,Mnr=Anr.hasOwnProperty;function jPe(t){if(t==null)return!0;if(Qd(t)&&(Kn(t)||typeof t=="string"||typeof t.splice=="function"||J6(t)||Ate(t)||OO(t)))return!t.length;var e=D5(t);if(e==Snr||e==Enr)return!t.size;if(F7(t))return!xDe(t).length;for(var r in t)if(Mnr.call(t,r))return!1;return!0}M(jPe,"isEmpty");var Fi=jPe,Rnr="[object RegExp]";function XPe(t){return Ah(t)&&cm(t)==Rnr}M(XPe,"baseIsRegExp");var _nr=XPe,Nge=Ig&&Ig.isRegExp,Lnr=Nge?z7(Nge):_nr,S0=Lnr;function KPe(t){return t===void 0}M(KPe,"isUndefined");var E0=KPe,Inr="Expected a function";function ZPe(t){if(typeof t!="function")throw new TypeError(Inr);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}M(ZPe,"negate");var Nnr=ZPe;function QPe(t,e,r,n){if(!Iu(t))return t;e=HO(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i=Vnr){var u=e?null:znr(t);if(u)return Bte(u);a=!1,i=$te,l=new Pte}else l=e?[]:o;e:for(;++n{r.accept(e)})}},M(xx,"AbstractProduction"),xx),wx,Ll=(wx=class extends ef{constructor(e){super([]),this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},M(wx,"NonTerminal"),wx),Tx,R3=(Tx=class extends ef{constructor(e){super(e.definition),this.orgText="",Gc(this,Dh(e,r=>r!==void 0))}},M(Tx,"Rule"),Tx),Cx,pc=(Cx=class extends ef{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Gc(this,Dh(e,r=>r!==void 0))}},M(Cx,"Alternative"),Cx),kx,Eo=(kx=class extends ef{constructor(e){super(e.definition),this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}},M(kx,"Option"),kx),Sx,Xc=(Sx=class extends ef{constructor(e){super(e.definition),this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}},M(Sx,"RepetitionMandatory"),Sx),Ex,Kc=(Ex=class extends ef{constructor(e){super(e.definition),this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}},M(Ex,"RepetitionMandatoryWithSeparator"),Ex),Ax,Os=(Ax=class extends ef{constructor(e){super(e.definition),this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}},M(Ax,"Repetition"),Ax),Mx,vc=(Mx=class extends ef{constructor(e){super(e.definition),this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}},M(Mx,"RepetitionWithSeparator"),Mx),Rx,bc=(Rx=class extends ef{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Gc(this,Dh(e,r=>r!==void 0))}},M(Rx,"Alternation"),Rx),_x,Zi=(_x=class{constructor(e){this.idx=1,Gc(this,Dh(e,r=>r!==void 0))}accept(e){e.visit(this)}},M(_x,"Terminal"),_x);function h$e(t){return Lr(t,xS)}M(h$e,"serializeGrammar");function xS(t){function e(r){return Lr(r,xS)}if(M(e,"convertDefinition"),t instanceof Ll){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return fc(t.label)&&(r.label=t.label),r}else{if(t instanceof pc)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Eo)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Xc)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Kc)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:xS(new Zi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof vc)return{type:"RepetitionWithSeparator",idx:t.idx,separator:xS(new Zi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Os)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof bc)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Zi){const r={type:"Terminal",name:t.terminalType.name,label:c$e(t.terminalType),idx:t.idx};fc(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=S0(n)?n.source:n),r}else{if(t instanceof R3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}M(xS,"serializeProduction");var Lx,_3=(Lx=class{visit(e){const r=e;switch(r.constructor){case Ll:return this.visitNonTerminal(r);case pc:return this.visitAlternative(r);case Eo:return this.visitOption(r);case Xc:return this.visitRepetitionMandatory(r);case Kc:return this.visitRepetitionMandatoryWithSeparator(r);case vc:return this.visitRepetitionWithSeparator(r);case Os:return this.visitRepetition(r);case bc:return this.visitAlternation(r);case Zi:return this.visitTerminal(r);case R3:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},M(Lx,"GAstVisitor"),Lx);function d$e(t){return t instanceof pc||t instanceof Eo||t instanceof Os||t instanceof Xc||t instanceof Kc||t instanceof vc||t instanceof Zi||t instanceof R3}M(d$e,"isSequenceProd");function iE(t,e=[]){return t instanceof Eo||t instanceof Os||t instanceof vc?!0:t instanceof bc?a$e(t.definition,n=>iE(n,e)):t instanceof Ll&&zl(e,t)?!1:t instanceof ef?(t instanceof Ll&&e.push(t),wh(t.definition,n=>iE(n,e))):!1}M(iE,"isOptionalProd");function f$e(t){return t instanceof bc}M(f$e,"isBranchingProd");function nh(t){if(t instanceof Ll)return"SUBRULE";if(t instanceof Eo)return"OPTION";if(t instanceof bc)return"OR";if(t instanceof Xc)return"AT_LEAST_ONE";if(t instanceof Kc)return"AT_LEAST_ONE_SEP";if(t instanceof vc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(nh,"getProductionDslName");var Ix,qO=(Ix=class{walk(e,r=[]){tn(e.definition,(n,i)=>{const s=go(e.definition,i+1);if(n instanceof Ll)this.walkProdRef(n,s,r);else if(n instanceof Zi)this.walkTerminal(n,s,r);else if(n instanceof pc)this.walkFlat(n,s,r);else if(n instanceof Eo)this.walkOption(n,s,r);else if(n instanceof Xc)this.walkAtLeastOne(n,s,r);else if(n instanceof Kc)this.walkAtLeastOneSep(n,s,r);else if(n instanceof vc)this.walkManySep(n,s,r);else if(n instanceof Os)this.walkMany(n,s,r);else if(n instanceof bc)this.walkOr(n,s,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Eo({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=sY(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Eo({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=sY(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);tn(e.definition,s=>{const a=new pc({definition:[s]});this.walk(a,i)})}},M(Ix,"RestWalker"),Ix);function sY(t,e,r){return[new Eo({definition:[new Zi({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}M(sY,"restForRepetitionWithSeparator");function L3(t){if(t instanceof Ll)return L3(t.referencedRule);if(t instanceof Zi)return m$e(t);if(d$e(t))return p$e(t);if(f$e(t))return g$e(t);throw Error("non exhaustive match")}M(L3,"first");function p$e(t){let e=[];const r=t.definition;let n=0,i=r.length>n,s,a=!0;for(;i&&a;)s=r[n],a=iE(s),e=e.concat(L3(s)),n=n+1,i=r.length>n;return Vte(e)}M(p$e,"firstForSequence");function g$e(t){const e=Lr(t.definition,r=>L3(r));return Vte(xh(e))}M(g$e,"firstForBranching");function m$e(t){return[t.terminalType]}M(m$e,"firstForTerminal");var y$e="_~IN~_",Nx,Gnr=(Nx=class extends qO{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=b$e(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),a=new pc({definition:s}),o=L3(a);this.follows[i]=o}},M(Nx,"ResyncFollowsWalker"),Nx);function v$e(t){const e={};return tn(t,r=>{const n=new Gnr(r).startWalking();Gc(e,n)}),e}M(v$e,"computeAllProdsFollows");function b$e(t,e){return t.name+e+y$e}M(b$e,"buildBetweenProdsFollowPrefix");var bR={},Wnr=new ZIe;function G7(t){const e=t.toString();if(bR.hasOwnProperty(e))return bR[e];{const r=Wnr.pattern(e);return bR[e]=r,r}}M(G7,"getRegExpAst");function x$e(){bR={}}M(x$e,"clearRegExpParserCache");var w$e="Complement Sets are not supported for first char optimization",gI=`Unable to use "first char" lexer optimizations: -`;function T$e(t,e=!1){try{const r=G7(t);return mI(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===w$e)e&&Hte(`${gI} Unable to optimize: < ${t.toString()} > +`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},M(bx,"RegExpParser"),bx),xx,AO=(xx=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},M(xx,"BaseRegExpVisitor"),xx),iNe=/\r?\n/gm,sNe=new nNe,wx,zZt=(wx=class extends AO{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=L3(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)}},M(wx,"TerminalRegExpVisitor"),wx),V1=new zZt;function aNe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=sNe.pattern(t),r=[];for(const n of e.value.value)V1.reset(t),V1.visit(n),r.push({start:V1.startRegexp,end:V1.endRegex});return r}catch{return[]}}M(aNe,"getTerminalParts");function lte(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),V1.reset(t),V1.visit(sNe.pattern(t)),V1.multiline}catch{return!1}}M(lte,"isMultilineComment");var oNe=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function MO(t){const e=typeof t=="string"?new RegExp(t):t;return oNe.some(r=>e.test(r))}M(MO,"isWhitespace");function L3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}M(L3,"escapeRegExp");function cte(t,e){const r=ute(t),n=e.match(r);return!!n&&n[0].length>0}M(cte,"partialMatches");function ute(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let s="",a;function o(u){s+=r.substr(n,u),n+=u}M(o,"appendRaw");function l(u){s+="(?:"+r.substr(n,u)+"|$)",n+=u}for(M(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?o(a[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=i()+"|$)";break;case"=":s+="(?=",n+=3,s+=i()+")";break;case"!":a=n,n+=3,i(),s+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),s+=r.substr(a,n-a);break;default:o(r.indexOf(">",n)-n+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++n,s;default:l(1);break}return s}return M(i,"process"),new RegExp(i(),t.flags)}M(ute,"partialRegExp");function hte(t){return t.rules.find(e=>Il(e)&&e.entry)}M(hte,"getEntryRule");function dte(t){return t.rules.filter(e=>Bu(e)&&e.hidden)}M(dte,"getHiddenRules");function RO(t,e){const r=new Set,n=hte(t);if(!n)return new Set(t.rules);const i=[n].concat(dte(t));for(const a of i)fte(a,r,e);const s=new Set;for(const a of t.rules)(r.has(a.name)||Bu(a)&&a.hidden)&&s.add(a);return s}M(RO,"getAllReachableRules");function fte(t,e,r){e.add(t.name),Q0(t).forEach(n=>{if(R0(n)||r&&TO(n)){const i=n.rule.ref;i&&!e.has(i.name)&&fte(i,e,r)}})}M(fte,"ruleDfs");function lNe(t){const e=new Set;return Q0(t).forEach(r=>{dv(r)&&(Il(r.type.ref)&&e.add(r.type.ref),N7(r.type.ref)&&Il(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}M(lNe,"getAllRulesUsedForCrossReferences");function pte(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=NO(t.type.ref);return e==null?void 0:e.terminal}}M(pte,"getCrossReferenceTerminal");function gte(t){return t.hidden&&!MO(P7(t))}M(gte,"isCommentTerminal");function mte(t,e){return!t||!e?[]:LO(t,e,t.astNode,!0)}M(mte,"findNodesForProperty");function _O(t,e,r){if(!t||!e)return;const n=LO(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]}M(_O,"findNodeForProperty");function LO(t,e,r,n){if(!n){const i=uv(t.grammarSource,A0);if(i&&i.feature===e)return[t]}return E0(t)&&t.astNode===r?t.content.flatMap(i=>LO(i,e,r,!1)):[]}M(LO,"findNodesForPropertyInternal");function cNe(t,e){return t?IO(t,e,t==null?void 0:t.astNode):[]}M(cNe,"findNodesForKeyword");function yte(t,e,r){if(!t)return;const n=IO(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}M(yte,"findNodeForKeyword");function IO(t,e,r){if(t.astNode!==r)return[];if(M0(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=O5(t).iterator();let i;const s=[];do if(i=n.next(),!i.done){const a=i.value;a.astNode===r?M0(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):n.prune()}while(!i.done);return s}M(IO,"findNodesForKeywordInternal");function vte(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=uv(t.grammarSource,A0);if(n)return n;t=t.container}}M(vte,"findAssignment");function NO(t){let e=t;return N7(e)&&(Dg(e.$container)?e=e.$container.$container:hv(e.$container)?e=e.$container:hm(e.$container)),bte(t,e,new Map)}M(NO,"findNameAssignment");function bte(t,e,r){var i;function n(s,a){let o;return uv(s,A0)||(o=bte(a,a,r)),r.set(t,o),o}if(M(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const s of Q0(e)){if(A0(s)&&s.feature.toLowerCase()==="name")return r.set(t,s),s;if(R0(s)&&Il(s.rule.ref))return n(s,s.rule.ref);if(wO(s)&&((i=s.typeRef)!=null&&i.ref))return n(s,s.typeRef.ref)}}M(bte,"findNameAssignmentInternal");function xte(t){const e=t.$container;if(fv(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const s=r[i];if(Dg(s))return s;{const a=Q0(r[i]).find(Dg);if(a)return a}}}if(bO(e))return xte(e)}M(xte,"getActionAtElement");function uNe(t,e){return t==="?"||t==="*"||fv(e)&&!!e.guardCondition}M(uNe,"isOptionalCardinality");function hNe(t){return t==="*"||t==="+"}M(hNe,"isArrayCardinality");function dNe(t){return t==="+="}M(dNe,"isArrayOperator");function D7(t){return wte(t,new Set)}M(D7,"isDataTypeRule");function wte(t,e){if(e.has(t))return!0;e.add(t);for(const r of Q0(t))if(R0(r)){if(!r.rule.ref||Il(r.rule.ref)&&!wte(r.rule.ref,e)||D5(r.rule.ref))return!1}else{if(A0(r))return!1;if(Dg(r))return!1}return!!t.definition}M(wte,"isDataTypeRuleInternal");function fNe(t){return pI(t.type,new Set)}M(fNe,"isDataType");function pI(t,e){if(e.has(t))return!0;if(e.add(t),Iee(t))return!1;if(Hee(t))return!1;if(Yee(t))return t.types.every(r=>pI(r,e));if(wO(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return CO(r)?pI(r.type,e):!1}else return!1}else return!1}M(pI,"isDataTypeInternal");function O7(t){if(!Bu(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}M(O7,"getExplicitRuleType");function Py(t){if(hv(t))return Il(t)&&D7(t)?t.name:O7(t)??t.name;if(Bee(t)||CO(t)||Wee(t))return t.name;if(Dg(t)){const e=Tte(t);if(e)return e}else if(N7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}M(Py,"getTypeName");function Tte(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Py(t.type.ref)}M(Tte,"getActionType");function pNe(t){var e;return Bu(t)?((e=t.type)==null?void 0:e.name)??"string":Il(t)&&D7(t)?t.name:O7(t)??t.name}M(pNe,"getRuleTypeName");function Cte(t){var e;return Bu(t)?((e=t.type)==null?void 0:e.name)??"string":O7(t)??t.name}M(Cte,"getRuleType");function P7(t){const e={s:!1,i:!1,u:!1},r=pv(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}M(P7,"terminalRegex");var kte=/[\s\S]/.source;function pv(t,e){var r;if(qee(t))return gNe(t);if(Uee(t))return mNe(t);if(Dee(t))return bNe(t);if(TO(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Rd(pv(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Fee(t))return vNe(t);if(jee(t))return yNe(t);if(Gee(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),s=t.regex.substring(n+1);return e&&(e.i=s.includes("i"),e.s=s.includes("s"),e.u=s.includes("u")),Rd(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Xee(t))return Rd(kte,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}M(pv,"abstractElementToRegex");function gNe(t){return Rd(t.elements.map(e=>pv(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(gNe,"terminalAlternativesToRegex");function mNe(t){return Rd(t.elements.map(e=>pv(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(mNe,"terminalGroupToRegex");function yNe(t){return Rd(`${kte}*?${pv(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(yNe,"untilTokenToRegex");function vNe(t){return Rd(`(?!${pv(t.terminal)})${kte}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(vNe,"negateTokenToRegex");function bNe(t){return t.right?Rd(`[${TR(t.left)}-${TR(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Rd(TR(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(bNe,"characterRangeToRegex");function TR(t){return L3(t.value)}M(TR,"keywordToRegex");function Rd(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}M(Rd,"withCardinality");function Ste(t){const e=[],r=t.Grammar;for(const n of r.rules)Bu(n)&>e(n)&<e(P7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:ete}}M(Ste,"createGrammarConfig");var VZt=typeof global=="object"&&global&&global.Object===Object&&global,xNe=VZt,HZt=typeof self=="object"&&self&&self.Object===Object&&self,GZt=xNe||HZt||Function("return this")(),ef=GZt,WZt=ef.Symbol,Du=WZt,wNe=Object.prototype,qZt=wNe.hasOwnProperty,UZt=wNe.toString,CC=Du?Du.toStringTag:void 0;function TNe(t){var e=qZt.call(t,CC),r=t[CC];try{t[CC]=void 0;var n=!0}catch{}var i=UZt.call(t);return n&&(e?t[CC]=r:delete t[CC]),i}M(TNe,"getRawTag");var YZt=TNe,jZt=Object.prototype,XZt=jZt.toString;function CNe(t){return XZt.call(t)}M(CNe,"objectToString");var KZt=CNe,ZZt="[object Null]",QZt="[object Undefined]",age=Du?Du.toStringTag:void 0;function kNe(t){return t==null?t===void 0?QZt:ZZt:age&&age in Object(t)?YZt(t):KZt(t)}M(kNe,"baseGetTag");var dm=kNe;function SNe(t){return t!=null&&typeof t=="object"}M(SNe,"isObjectLike");var _h=SNe,JZt="[object Symbol]";function ENe(t){return typeof t=="symbol"||_h(t)&&dm(t)==JZt}M(ENe,"isSymbol");var DO=ENe;function ANe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=OQt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}M(WNe,"shortOut");var BQt=WNe;function qNe(t){return function(){return t}}M(qNe,"constant");var FQt=qNe,zQt=(function(){try{var t=mv(Object,"defineProperty");return t({},"",{}),t}catch{}})(),gI=zQt,VQt=gI?function(t,e){return gI(t,"toString",{configurable:!0,enumerable:!1,value:FQt(e),writable:!0})}:F7,HQt=VQt,GQt=BQt(HQt),WQt=GQt;function UNe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}M(JNe,"arrayIncludes");var eDe=JNe,YQt=9007199254740991,jQt=/^(?:0|[1-9]\d*)$/;function tDe(t,e){var r=typeof t;return e=e??YQt,!!e&&(r=="number"||r!="symbol"&&jQt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=QQt}M(lDe,"isLength");var _te=lDe;function cDe(t){return t!=null&&_te(t.length)&&!J0(t)}M(cDe,"isArrayLike");var tf=cDe;function uDe(t,e,r){if(!Ou(r))return!1;var n=typeof e;return(n=="number"?tf(r)&&OO(e,r.length):n=="string"&&e in r)?z7(r[e],t):!1}M(uDe,"isIterateeCall");var $O=uDe;function hDe(t){return Rte(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&$O(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n-1}M(VDe,"listCacheHas");var mer=VDe;function HDe(t,e){var r=this.__data__,n=zO(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(HDe,"listCacheSet");var yer=HDe;function vv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Ote(o,e-1,r,n,i):Dte(i,o):n||(i[i.length]=o)}return i}M(Ote,"baseFlatten");var Pte=Ote;function iOe(t){var e=t==null?0:t.length;return e?Pte(t,1):[]}M(iOe,"flatten");var Ch=iOe,Per=kDe(Object.getPrototypeOf,Object),sOe=Per;function aOe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++no))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Err?new zte:void 0;for(s.set(t,e),s.set(e,t);++d2?e[2]:void 0;for(i&&$O(e[0],e[1],i)&&(n=1);++r=bnr&&(s=Vte,a=!1,e=new zte(e));e:for(;++i-1?i[s?e[a]:a]:void 0}}M(VPe,"createFind");var Snr=VPe,Enr=Math.max;function HPe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:B7(r);return i<0&&(i=Enr(n+i,0)),XNe(t,rf(e),i)}M(HPe,"findIndex");var Anr=HPe,Mnr=Snr(Anr),B5=Mnr;function GPe(t){return t&&t.length?t[0]:void 0}M(GPe,"head");var Lh=GPe;function WPe(t,e){var r=-1,n=tf(t)?Array(t.length):[];return wv(t,function(i,s,a){n[++r]=e(i,s,a)}),n}M(WPe,"baseMap");var Rnr=WPe;function qPe(t,e){var r=Kn(t)?$7:Rnr;return r(t,rf(e))}M(qPe,"map");var Lr=qPe;function UPe(t,e){return Pte(Lr(t,e),1)}M(UPe,"flatMap");var Au=UPe,_nr=Object.prototype,Lnr=_nr.hasOwnProperty,Inr=mnr(function(t,e,r){Lnr.call(t,r)?t[r].push(e):Mte(t,r,[e])}),Nnr=Inr,Dnr=Object.prototype,Onr=Dnr.hasOwnProperty;function YPe(t,e){return t!=null&&Onr.call(t,e)}M(YPe,"baseHas");var Pnr=YPe;function jPe(t,e){return t!=null&&dPe(t,e,Pnr)}M(jPe,"has");var jr=jPe,$nr="[object String]";function XPe(t){return typeof t=="string"||!Kn(t)&&_h(t)&&dm(t)==$nr}M(XPe,"isString");var mc=XPe;function KPe(t,e){return $7(e,function(r){return t[r]})}M(KPe,"baseValues");var Bnr=KPe;function ZPe(t){return t==null?[]:Bnr(t,qc(t))}M(ZPe,"values");var wa=ZPe,Fnr=Math.max;function QPe(t,e,r,n){t=tf(t)?t:wa(t),r=r&&!n?B7(r):0;var i=t.length;return r<0&&(r=Fnr(i+r,0)),mc(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ate(t,e,r)>-1}M(QPe,"includes");var Hl=QPe,znr=Math.max;function JPe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:B7(r);return i<0&&(i=znr(n+i,0)),Ate(t,e,i)}M(JPe,"indexOf");var Bge=JPe,Vnr="[object Map]",Hnr="[object Set]",Gnr=Object.prototype,Wnr=Gnr.hasOwnProperty;function e$e(t){if(t==null)return!0;if(tf(t)&&(Kn(t)||typeof t=="string"||typeof t.splice=="function"||rE(t)||Lte(t)||BO(t)))return!t.length;var e=$5(t);if(e==Vnr||e==Hnr)return!t.size;if(H7(t))return!EDe(t).length;for(var r in t)if(Wnr.call(t,r))return!1;return!0}M(e$e,"isEmpty");var Fi=e$e,qnr="[object RegExp]";function t$e(t){return _h(t)&&dm(t)==qnr}M(t$e,"baseIsRegExp");var Unr=t$e,Fge=Og&&Og.isRegExp,Ynr=Fge?G7(Fge):Unr,_0=Ynr;function r$e(t){return t===void 0}M(r$e,"isUndefined");var L0=r$e,jnr="Expected a function";function n$e(t){if(typeof t!="function")throw new TypeError(jnr);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}M(n$e,"negate");var Xnr=n$e;function i$e(t,e,r,n){if(!Ou(t))return t;e=qO(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i=nir){var u=e?null:rir(t);if(u)return Hte(u);a=!1,i=Vte,l=new zte}else l=e?[]:o;e:for(;++n{r.accept(e)})}},M(Tx,"AbstractProduction"),Tx),Cx,Nl=(Cx=class extends nf{constructor(e){super([]),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},M(Cx,"NonTerminal"),Cx),kx,I3=(kx=class extends nf{constructor(e){super(e.definition),this.orgText="",Uc(this,$h(e,r=>r!==void 0))}},M(kx,"Rule"),kx),Sx,yc=(Sx=class extends nf{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Uc(this,$h(e,r=>r!==void 0))}},M(Sx,"Alternative"),Sx),Ex,Eo=(Ex=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Ex,"Option"),Ex),Ax,Qc=(Ax=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Ax,"RepetitionMandatory"),Ax),Mx,Jc=(Mx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Mx,"RepetitionMandatoryWithSeparator"),Mx),Rx,Os=(Rx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Rx,"Repetition"),Rx),_x,wc=(_x=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(_x,"RepetitionWithSeparator"),_x),Lx,Tc=(Lx=class extends nf{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Uc(this,$h(e,r=>r!==void 0))}},M(Lx,"Alternation"),Lx),Ix,Zi=(Ix=class{constructor(e){this.idx=1,Uc(this,$h(e,r=>r!==void 0))}accept(e){e.visit(this)}},M(Ix,"Terminal"),Ix);function y$e(t){return Lr(t,CS)}M(y$e,"serializeGrammar");function CS(t){function e(r){return Lr(r,CS)}if(M(e,"convertDefinition"),t instanceof Nl){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return mc(t.label)&&(r.label=t.label),r}else{if(t instanceof yc)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Eo)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Qc)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Jc)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:CS(new Zi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof wc)return{type:"RepetitionWithSeparator",idx:t.idx,separator:CS(new Zi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Os)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Tc)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Zi){const r={type:"Terminal",name:t.terminalType.name,label:g$e(t.terminalType),idx:t.idx};mc(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=_0(n)?n.source:n),r}else{if(t instanceof I3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}M(CS,"serializeProduction");var Nx,N3=(Nx=class{visit(e){const r=e;switch(r.constructor){case Nl:return this.visitNonTerminal(r);case yc:return this.visitAlternative(r);case Eo:return this.visitOption(r);case Qc:return this.visitRepetitionMandatory(r);case Jc:return this.visitRepetitionMandatoryWithSeparator(r);case wc:return this.visitRepetitionWithSeparator(r);case Os:return this.visitRepetition(r);case Tc:return this.visitAlternation(r);case Zi:return this.visitTerminal(r);case I3:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},M(Nx,"GAstVisitor"),Nx);function v$e(t){return t instanceof yc||t instanceof Eo||t instanceof Os||t instanceof Qc||t instanceof Jc||t instanceof wc||t instanceof Zi||t instanceof I3}M(v$e,"isSequenceProd");function oE(t,e=[]){return t instanceof Eo||t instanceof Os||t instanceof wc?!0:t instanceof Tc?d$e(t.definition,n=>oE(n,e)):t instanceof Nl&&Hl(e,t)?!1:t instanceof nf?(t instanceof Nl&&e.push(t),kh(t.definition,n=>oE(n,e))):!1}M(oE,"isOptionalProd");function b$e(t){return t instanceof Tc}M(b$e,"isBranchingProd");function ah(t){if(t instanceof Nl)return"SUBRULE";if(t instanceof Eo)return"OPTION";if(t instanceof Tc)return"OR";if(t instanceof Qc)return"AT_LEAST_ONE";if(t instanceof Jc)return"AT_LEAST_ONE_SEP";if(t instanceof wc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(ah,"getProductionDslName");var Dx,jO=(Dx=class{walk(e,r=[]){tn(e.definition,(n,i)=>{const s=go(e.definition,i+1);if(n instanceof Nl)this.walkProdRef(n,s,r);else if(n instanceof Zi)this.walkTerminal(n,s,r);else if(n instanceof yc)this.walkFlat(n,s,r);else if(n instanceof Eo)this.walkOption(n,s,r);else if(n instanceof Qc)this.walkAtLeastOne(n,s,r);else if(n instanceof Jc)this.walkAtLeastOneSep(n,s,r);else if(n instanceof wc)this.walkManySep(n,s,r);else if(n instanceof Os)this.walkMany(n,s,r);else if(n instanceof Tc)this.walkOr(n,s,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Eo({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=cY(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Eo({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=cY(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);tn(e.definition,s=>{const a=new yc({definition:[s]});this.walk(a,i)})}},M(Dx,"RestWalker"),Dx);function cY(t,e,r){return[new Eo({definition:[new Zi({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}M(cY,"restForRepetitionWithSeparator");function D3(t){if(t instanceof Nl)return D3(t.referencedRule);if(t instanceof Zi)return T$e(t);if(v$e(t))return x$e(t);if(b$e(t))return w$e(t);throw Error("non exhaustive match")}M(D3,"first");function x$e(t){let e=[];const r=t.definition;let n=0,i=r.length>n,s,a=!0;for(;i&&a;)s=r[n],a=oE(s),e=e.concat(D3(s)),n=n+1,i=r.length>n;return qte(e)}M(x$e,"firstForSequence");function w$e(t){const e=Lr(t.definition,r=>D3(r));return qte(Ch(e))}M(w$e,"firstForBranching");function T$e(t){return[t.terminalType]}M(T$e,"firstForTerminal");var C$e="_~IN~_",Ox,sir=(Ox=class extends jO{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=S$e(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),a=new yc({definition:s}),o=D3(a);this.follows[i]=o}},M(Ox,"ResyncFollowsWalker"),Ox);function k$e(t){const e={};return tn(t,r=>{const n=new sir(r).startWalking();Uc(e,n)}),e}M(k$e,"computeAllProdsFollows");function S$e(t,e){return t.name+e+C$e}M(S$e,"buildBetweenProdsFollowPrefix");var CR={},air=new nNe;function U7(t){const e=t.toString();if(CR.hasOwnProperty(e))return CR[e];{const r=air.pattern(e);return CR[e]=r,r}}M(U7,"getRegExpAst");function E$e(){CR={}}M(E$e,"clearRegExpParserCache");var A$e="Complement Sets are not supported for first char optimization",vI=`Unable to use "first char" lexer optimizations: +`;function M$e(t,e=!1){try{const r=U7(t);return bI(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===A$e)e&&Ute(`${vI} 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.`),pI(`${gI} + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),yI(`${vI} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}M(T$e,"getOptimizedStartCodesIndices");function mI(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")vk(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)vk(h,e,r);else{for(let h=u.from;h<=u.to&&h=xk){const h=u.from>=xk?u.from:xk,d=u.to,f=A0(h),p=A0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":mI(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&yI(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return wa(e)}M(mI,"firstCharOptimizedIndices");function vk(t,e,r){const n=A0(t);e[n]=n,r===!0&&C$e(t,e)}M(vk,"addOptimizedIdxToResult");function C$e(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=A0(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const s=A0(i.charCodeAt(0));e[s]=s}}}M(C$e,"handleIgnoreCase");function aY(t,e){return O5(t.value,r=>{if(typeof r=="number")return zl(e,r);{const n=r;return O5(e,i=>n.from<=i&&i<=n.to)!==void 0}})}M(aY,"findCode");function yI(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Kn(t.value)?wh(t.value,yI):yI(t.value):!1}M(yI,"isWholeOptional");var Dx,qnr=(Dx=class extends kO{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){zl(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?aY(e,this.targetCharCodes)===void 0&&(this.found=!0):aY(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},M(Dx,"CharCodeFinder"),Dx);function UO(t,e){if(e instanceof RegExp){const r=G7(e),n=new qnr(t);return n.visit(r),n.found}else return O5(e,r=>zl(t,r.charCodeAt(0)))!==void 0}M(UO,"canMatchCharCode");var Py="PATTERN",bk="defaultMode",F8="modes";function k$e(t,e){e=zte(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:M((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{q$e()});let n;r("Reject Lexer.NA",()=>{n=WO(t,x=>x[Py]===Sl.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=Lr(n,x=>{const b=x[Py];if(S0(b)){const T=b.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!b.ignoreCase?T:T.length===2&&T[0]==="\\"&&!zl(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:oY(b)}else{if(X0(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const T=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(T);return oY(C)}}else throw Error("non exhaustive match")}})});let a,o,l,u,h;r("misc mapping",()=>{a=Lr(n,x=>x.tokenTypeIdx),o=Lr(n,x=>{const b=x.GROUP;if(b!==Sl.SKIPPED){if(fc(b))return b;if(E0(b))return!1;throw Error("non exhaustive match")}}),l=Lr(n,x=>{const b=x.LONGER_ALT;if(b)return Kn(b)?Lr(b,C=>Ige(n,C)):[Ige(n,b)]}),u=Lr(n,x=>x.PUSH_MODE),h=Lr(n,x=>jr(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=Yte(e.lineTerminatorCharacters);d=Lr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Lr(n,b=>jr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:Ute(b,x)===!1&&UO(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Lr(n,qte),p=Lr(s,G$e),g=Wc(n,(x,b)=>{const T=b.GROUP;return fc(T)&&T!==Sl.SKIPPED&&(x[T]=[]),x},{}),m=Lr(s,(x,b)=>({pattern:s[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:a[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Wc(n,(x,b,T)=>{if(typeof b.PATTERN=="string"){const C=b.PATTERN.charCodeAt(0),S=A0(C);xR(x,S,m[T])}else if(Kn(b.START_CHARS_HINT)){let C;tn(b.START_CHARS_HINT,S=>{const k=typeof S=="string"?S.charCodeAt(0):S,E=A0(k);C!==E&&(C=E,xR(x,E,m[T]))})}else if(S0(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&pI(`${gI} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}M(M$e,"getOptimizedStartCodesIndices");function bI(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")wk(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)wk(h,e,r);else{for(let h=u.from;h<=u.to&&h=Ck){const h=u.from>=Ck?u.from:Ck,d=u.to,f=I0(h),p=I0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":bI(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&xI(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return wa(e)}M(bI,"firstCharOptimizedIndices");function wk(t,e,r){const n=I0(t);e[n]=n,r===!0&&R$e(t,e)}M(wk,"addOptimizedIdxToResult");function R$e(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=I0(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const s=I0(i.charCodeAt(0));e[s]=s}}}M(R$e,"handleIgnoreCase");function uY(t,e){return B5(t.value,r=>{if(typeof r=="number")return Hl(e,r);{const n=r;return B5(e,i=>n.from<=i&&i<=n.to)!==void 0}})}M(uY,"findCode");function xI(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Kn(t.value)?kh(t.value,xI):xI(t.value):!1}M(xI,"isWholeOptional");var Px,oir=(Px=class extends AO{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){Hl(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?uY(e,this.targetCharCodes)===void 0&&(this.found=!0):uY(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},M(Px,"CharCodeFinder"),Px);function XO(t,e){if(e instanceof RegExp){const r=U7(e),n=new oir(t);return n.visit(r),n.found}else return B5(e,r=>Hl(t,r.charCodeAt(0)))!==void 0}M(XO,"canMatchCharCode");var By="PATTERN",Tk="defaultMode",G8="modes";function _$e(t,e){e=Wte(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:M((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Z$e()});let n;r("Reject Lexer.NA",()=>{n=YO(t,x=>x[By]===Al.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=Lr(n,x=>{const b=x[By];if(_0(b)){const T=b.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!b.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Hl(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:hY(b)}else{if(J0(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const T=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(T);return hY(C)}}else throw Error("non exhaustive match")}})});let a,o,l,u,h;r("misc mapping",()=>{a=Lr(n,x=>x.tokenTypeIdx),o=Lr(n,x=>{const b=x.GROUP;if(b!==Al.SKIPPED){if(mc(b))return b;if(L0(b))return!1;throw Error("non exhaustive match")}}),l=Lr(n,x=>{const b=x.LONGER_ALT;if(b)return Kn(b)?Lr(b,C=>Bge(n,C)):[Bge(n,b)]}),u=Lr(n,x=>x.PUSH_MODE),h=Lr(n,x=>jr(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=Zte(e.lineTerminatorCharacters);d=Lr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Lr(n,b=>jr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:Kte(b,x)===!1&&XO(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Lr(n,Xte),p=Lr(s,X$e),g=Yc(n,(x,b)=>{const T=b.GROUP;return mc(T)&&T!==Al.SKIPPED&&(x[T]=[]),x},{}),m=Lr(s,(x,b)=>({pattern:s[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:a[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Yc(n,(x,b,T)=>{if(typeof b.PATTERN=="string"){const C=b.PATTERN.charCodeAt(0),S=I0(C);kR(x,S,m[T])}else if(Kn(b.START_CHARS_HINT)){let C;tn(b.START_CHARS_HINT,S=>{const k=typeof S=="string"?S.charCodeAt(0):S,E=I0(k);C!==E&&(C=E,kR(x,E,m[T]))})}else if(_0(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&yI(`${vI} Unable to analyze < ${b.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=T$e(b.PATTERN,e.ensureOptimizations);Fi(C)&&(y=!1),tn(C,S=>{xR(x,S,m[T])})}else e.ensureOptimizations&&pI(`${gI} TokenType: <${b.name}> is using a custom token pattern without providing parameter. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=M$e(b.PATTERN,e.ensureOptimizations);Fi(C)&&(y=!1),tn(C,S=>{kR(x,S,m[T])})}else e.ensureOptimizations&&yI(`${vI} TokenType: <${b.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}M(k$e,"analyzeTokenTypes");function S$e(t,e){let r=[];const n=A$e(t);r=r.concat(n.errors);const i=M$e(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(E$e(s)),r=r.concat(D$e(s)),r=r.concat(O$e(s,e)),r=r.concat(P$e(s)),r}M(S$e,"validatePatterns");function E$e(t){let e=[];const r=Pu(t,n=>S0(n[Py]));return e=e.concat(R$e(r)),e=e.concat(L$e(r)),e=e.concat(I$e(r)),e=e.concat(N$e(r)),e=e.concat(_$e(r)),e}M(E$e,"validateRegExpPattern");function A$e(t){const e=Pu(t,i=>!jr(i,Py)),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ps.MISSING_PATTERN,tokenTypes:[i]})),n=GO(t,e);return{errors:r,valid:n}}M(A$e,"findMissingPatterns");function M$e(t){const e=Pu(t,i=>{const s=i[Py];return!S0(s)&&!X0(s)&&!jr(s,"exec")&&!fc(s)}),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ps.INVALID_PATTERN,tokenTypes:[i]})),n=GO(t,e);return{errors:r,valid:n}}M(M$e,"findInvalidPatterns");var Unr=/[^\\][$]/;function R$e(t){const i=class i extends kO{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}};M(i,"EndAnchorFinder");let e=i;const r=Pu(t,s=>{const a=s.PATTERN;try{const o=G7(a),l=new e;return l.visit(o),l.found}catch{return Unr.test(a.source)}});return Lr(r,s=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}M(_$e,"analyzeTokenTypes");function L$e(t,e){let r=[];const n=N$e(t);r=r.concat(n.errors);const i=D$e(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(I$e(s)),r=r.concat(z$e(s)),r=r.concat(V$e(s,e)),r=r.concat(H$e(s)),r}M(L$e,"validatePatterns");function I$e(t){let e=[];const r=Fu(t,n=>_0(n[By]));return e=e.concat(O$e(r)),e=e.concat($$e(r)),e=e.concat(B$e(r)),e=e.concat(F$e(r)),e=e.concat(P$e(r)),e}M(I$e,"validateRegExpPattern");function N$e(t){const e=Fu(t,i=>!jr(i,By)),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ps.MISSING_PATTERN,tokenTypes:[i]})),n=UO(t,e);return{errors:r,valid:n}}M(N$e,"findMissingPatterns");function D$e(t){const e=Fu(t,i=>{const s=i[By];return!_0(s)&&!J0(s)&&!jr(s,"exec")&&!mc(s)}),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ps.INVALID_PATTERN,tokenTypes:[i]})),n=UO(t,e);return{errors:r,valid:n}}M(D$e,"findInvalidPatterns");var lir=/[^\\][$]/;function O$e(t){const i=class i extends AO{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}};M(i,"EndAnchorFinder");let e=i;const r=Fu(t,s=>{const a=s.PATTERN;try{const o=U7(a),l=new e;return l.visit(o),l.found}catch{return lir.test(a.source)}});return Lr(r,s=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+s.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ps.EOI_ANCHOR_FOUND,tokenTypes:[s]}))}M(R$e,"findEndOfInputAnchor");function _$e(t){const e=Pu(t,n=>n.PATTERN.test(""));return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ps.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}M(_$e,"findEmptyMatchRegExps");var Ynr=/[^\\[][\^]|^\^/;function L$e(t){const i=class i extends kO{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}};M(i,"StartAnchorFinder");let e=i;const r=Pu(t,s=>{const a=s.PATTERN;try{const o=G7(a),l=new e;return l.visit(o),l.found}catch{return Ynr.test(a.source)}});return Lr(r,s=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ps.EOI_ANCHOR_FOUND,tokenTypes:[s]}))}M(O$e,"findEndOfInputAnchor");function P$e(t){const e=Fu(t,n=>n.PATTERN.test(""));return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ps.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}M(P$e,"findEmptyMatchRegExps");var cir=/[^\\[][\^]|^\^/;function $$e(t){const i=class i extends AO{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}};M(i,"StartAnchorFinder");let e=i;const r=Fu(t,s=>{const a=s.PATTERN;try{const o=U7(a),l=new e;return l.visit(o),l.found}catch{return cir.test(a.source)}});return Lr(r,s=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+s.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ps.SOI_ANCHOR_FOUND,tokenTypes:[s]}))}M(L$e,"findStartOfInputAnchor");function I$e(t){const e=Pu(t,n=>{const i=n[Py];return i instanceof RegExp&&(i.multiline||i.global)});return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ps.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}M(I$e,"findUnsupportedFlags");function N$e(t){const e=[];let r=Lr(t,s=>Wc(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!zl(e,o)&&o.PATTERN!==Sl.NA&&(e.push(o),a.push(o)),a),[]));r=H7(r);const n=Pu(r,s=>s.length>1);return Lr(n,s=>{const a=Lr(s,l=>l.name);return{message:`The same RegExp pattern ->${Mh(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Ps.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}M(N$e,"findDuplicatePatterns");function D$e(t){const e=Pu(t,n=>{if(!jr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Sl.SKIPPED&&i!==Sl.NA&&!fc(i)});return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ps.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}M(D$e,"findInvalidGroupType");function O$e(t,e){const r=Pu(t,i=>i.PUSH_MODE!==void 0&&!zl(e,i.PUSH_MODE));return Lr(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ps.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}M(O$e,"findModesThatDoNotExist");function P$e(t){const e=[],r=Wc(t,(n,i,s)=>{const a=i.PATTERN;return a===Sl.NA||(fc(a)?n.push({str:a,idx:s,tokenType:i}):S0(a)&&B$e(a)&&n.push({str:a.source,idx:s,tokenType:i})),n},[]);return tn(t,(n,i)=>{tn(r,({str:s,idx:a,tokenType:o})=>{if(i${o.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ps.SOI_ANCHOR_FOUND,tokenTypes:[s]}))}M($$e,"findStartOfInputAnchor");function B$e(t){const e=Fu(t,n=>{const i=n[By];return i instanceof RegExp&&(i.multiline||i.global)});return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ps.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}M(B$e,"findUnsupportedFlags");function F$e(t){const e=[];let r=Lr(t,s=>Yc(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!Hl(e,o)&&o.PATTERN!==Al.NA&&(e.push(o),a.push(o)),a),[]));r=q7(r);const n=Fu(r,s=>s.length>1);return Lr(n,s=>{const a=Lr(s,l=>l.name);return{message:`The same RegExp pattern ->${Lh(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Ps.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}M(F$e,"findDuplicatePatterns");function z$e(t){const e=Fu(t,n=>{if(!jr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Al.SKIPPED&&i!==Al.NA&&!mc(i)});return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ps.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}M(z$e,"findInvalidGroupType");function V$e(t,e){const r=Fu(t,i=>i.PUSH_MODE!==void 0&&!Hl(e,i.PUSH_MODE));return Lr(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ps.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}M(V$e,"findModesThatDoNotExist");function H$e(t){const e=[],r=Yc(t,(n,i,s)=>{const a=i.PATTERN;return a===Al.NA||(mc(a)?n.push({str:a,idx:s,tokenType:i}):_0(a)&&W$e(a)&&n.push({str:a.source,idx:s,tokenType:i})),n},[]);return tn(t,(n,i)=>{tn(r,({str:s,idx:a,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Ps.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}M(P$e,"findUnreachablePatterns");function $$e(t,e){if(S0(e)){if(F$e(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(X0(e))return e(t,0,[],{});if(jr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}M($$e,"tryToMatchStrToPattern");function B$e(t){return O5([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}M(B$e,"noMetaChar");function F$e(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:Ps.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),jr(t,F8)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+F8+`> property in its definition -`,type:Ps.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),jr(t,F8)&&jr(t,bk)&&!jr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${bk}: <${t.defaultMode}>which does not exist -`,type:Ps.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),jr(t,F8)&&tn(t.modes,(i,s)=>{tn(i,(a,o)=>{if(E0(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}> -`,type:Ps.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(jr(a,"LONGER_ALT")){const l=Kn(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];tn(l,u=>{!E0(u)&&!zl(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${s}> -`,type:Ps.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}M(z$e,"performRuntimeChecks");function V$e(t,e,r){const n=[];let i=!1;const s=H7(xh(wa(t.modes))),a=WO(s,l=>l[Py]===Sl.NA),o=Yte(r);return e&&tn(a,l=>{const u=Ute(l,o);if(u!==!1){const d={message:W$e(l,u),type:u.issue,tokenType:l};n.push(d)}else jr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):UO(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Ps.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}M(H$e,"findUnreachablePatterns");function G$e(t,e){if(_0(e)){if(q$e(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(J0(e))return e(t,0,[],{});if(jr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}M(G$e,"tryToMatchStrToPattern");function W$e(t){return B5([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}M(W$e,"noMetaChar");function q$e(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:Ps.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),jr(t,G8)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+G8+`> property in its definition +`,type:Ps.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),jr(t,G8)&&jr(t,Tk)&&!jr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Tk}: <${t.defaultMode}>which does not exist +`,type:Ps.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),jr(t,G8)&&tn(t.modes,(i,s)=>{tn(i,(a,o)=>{if(L0(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}> +`,type:Ps.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(jr(a,"LONGER_ALT")){const l=Kn(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];tn(l,u=>{!L0(u)&&!Hl(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${s}> +`,type:Ps.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}M(U$e,"performRuntimeChecks");function Y$e(t,e,r){const n=[];let i=!1;const s=q7(Ch(wa(t.modes))),a=YO(s,l=>l[By]===Al.NA),o=Zte(r);return e&&tn(a,l=>{const u=Kte(l,o);if(u!==!1){const d={message:K$e(l,u),type:u.issue,tokenType:l};n.push(d)}else jr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):XO(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:Ps.NO_LINE_BREAKS_FLAGS}),n}M(V$e,"performWarningRuntimeChecks");function H$e(t){const e={},r=Hc(t);return tn(r,n=>{const i=t[n];if(Kn(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(H$e,"cloneEmptyGroups");function qte(t){const e=t.PATTERN;if(S0(e))return!1;if(X0(e))return!0;if(jr(e,"exec"))return!0;if(fc(e))return!1;throw Error("non exhaustive match")}M(qte,"isCustomPattern");function G$e(t){return fc(t)&&t.length===1?t.charCodeAt(0):!1}M(G$e,"isShortPattern");var jnr={test:M(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(Kn(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(j$e,"cloneEmptyGroups");function Xte(t){const e=t.PATTERN;if(_0(e))return!1;if(J0(e))return!0;if(jr(e,"exec"))return!0;if(mc(e))return!1;throw Error("non exhaustive match")}M(Xte,"isCustomPattern");function X$e(t){return mc(t)&&t.length===1?t.charCodeAt(0):!1}M(X$e,"isShortPattern");var uir={test:M(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Ps.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the 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")}M(W$e,"buildLineBreakIssueMessage");function Yte(t){return Lr(t,r=>fc(r)?r.charCodeAt(0):r)}M(Yte,"getCharCodes");function xR(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}M(xR,"addToMapOfArrays");var xk=256,wR=[];function A0(t){return t255?255+~~(t/255):t}}M(q$e,"initCharCodeToOptimizedIndexMap");function I3(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}M(I3,"tokenStructuredMatcher");function sE(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}M(sE,"tokenStructuredMatcherNoCategories");var Dge=1,U$e={};function N3(t){const e=Y$e(t);j$e(e),K$e(e),X$e(e),tn(e,r=>{r.isParent=r.categoryMatches.length>0})}M(N3,"augmentTokenTypes");function Y$e(t){let e=Ao(t),r=t,n=!0;for(;n;){r=H7(xh(Lr(r,s=>s.CATEGORIES)));const i=GO(r,e);e=e.concat(i),Fi(i)?n=!1:r=i}return e}M(Y$e,"expandCategories");function j$e(t){tn(t,e=>{Xte(e)||(U$e[Dge]=e,e.tokenTypeIdx=Dge++),lY(e)&&!Kn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),lY(e)||(e.CATEGORIES=[]),Z$e(e)||(e.categoryMatches=[]),Q$e(e)||(e.categoryMatchesMap={})})}M(j$e,"assignTokenDefaultProps");function X$e(t){tn(t,e=>{e.categoryMatches=[],tn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(U$e[n].tokenTypeIdx)})})}M(X$e,"assignCategoriesTokensProp");function K$e(t){tn(t,e=>{jte([],e)})}M(K$e,"assignCategoriesMapProp");function jte(t,e){tn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),tn(e.CATEGORIES,r=>{const n=t.concat(e);zl(n,r)||jte(n,r)})}M(jte,"singleAssignCategoriesToksMap");function Xte(t){return jr(t,"tokenTypeIdx")}M(Xte,"hasShortKeyProperty");function lY(t){return jr(t,"CATEGORIES")}M(lY,"hasCategoriesProperty");function Z$e(t){return jr(t,"categoryMatches")}M(Z$e,"hasExtendingTokensTypesProperty");function Q$e(t){return jr(t,"categoryMatchesMap")}M(Q$e,"hasExtendingTokensTypesMapProperty");function J$e(t){return jr(t,"tokenTypeIdx")}M(J$e,"isTokenType");var cY={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Ps;(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"})(Ps||(Ps={}));var wk={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:cY,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(wk);var Ox,Sl=(Ox=class{constructor(e,r=wk){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=Gte(s),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return s()},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=Gc({},wk,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===wk.lineTerminatorsPattern)this.config.lineTerminatorsPattern=jnr;else if(this.config.lineTerminatorCharacters===wk.lineTerminatorCharacters)throw Error(`Error: Missing 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),Kn(e)?i={modes:{defaultMode:Ao(e)},defaultMode:bk}:(s=!1,i=Ao(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(z$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(V$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},tn(i.modes,(o,l)=>{i.modes[l]=WO(o,u=>E0(u))});const a=Hc(i.modes);if(tn(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(S$e(o,a))}),Fi(this.lexerDefinitionErrors)){N3(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=k$e(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Gc({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Fi(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Lr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}M(K$e,"buildLineBreakIssueMessage");function Zte(t){return Lr(t,r=>mc(r)?r.charCodeAt(0):r)}M(Zte,"getCharCodes");function kR(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}M(kR,"addToMapOfArrays");var Ck=256,SR=[];function I0(t){return t255?255+~~(t/255):t}}M(Z$e,"initCharCodeToOptimizedIndexMap");function O3(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}M(O3,"tokenStructuredMatcher");function lE(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}M(lE,"tokenStructuredMatcherNoCategories");var zge=1,Q$e={};function P3(t){const e=J$e(t);eBe(e),rBe(e),tBe(e),tn(e,r=>{r.isParent=r.categoryMatches.length>0})}M(P3,"augmentTokenTypes");function J$e(t){let e=Ao(t),r=t,n=!0;for(;n;){r=q7(Ch(Lr(r,s=>s.CATEGORIES)));const i=UO(r,e);e=e.concat(i),Fi(i)?n=!1:r=i}return e}M(J$e,"expandCategories");function eBe(t){tn(t,e=>{Jte(e)||(Q$e[zge]=e,e.tokenTypeIdx=zge++),dY(e)&&!Kn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),dY(e)||(e.CATEGORIES=[]),nBe(e)||(e.categoryMatches=[]),iBe(e)||(e.categoryMatchesMap={})})}M(eBe,"assignTokenDefaultProps");function tBe(t){tn(t,e=>{e.categoryMatches=[],tn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Q$e[n].tokenTypeIdx)})})}M(tBe,"assignCategoriesTokensProp");function rBe(t){tn(t,e=>{Qte([],e)})}M(rBe,"assignCategoriesMapProp");function Qte(t,e){tn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),tn(e.CATEGORIES,r=>{const n=t.concat(e);Hl(n,r)||Qte(n,r)})}M(Qte,"singleAssignCategoriesToksMap");function Jte(t){return jr(t,"tokenTypeIdx")}M(Jte,"hasShortKeyProperty");function dY(t){return jr(t,"CATEGORIES")}M(dY,"hasCategoriesProperty");function nBe(t){return jr(t,"categoryMatches")}M(nBe,"hasExtendingTokensTypesProperty");function iBe(t){return jr(t,"categoryMatchesMap")}M(iBe,"hasExtendingTokensTypesMapProperty");function sBe(t){return jr(t,"tokenTypeIdx")}M(sBe,"isTokenType");var fY={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Ps;(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"})(Ps||(Ps={}));var kk={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:fY,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(kk);var $x,Al=($x=class{constructor(e,r=kk){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=Yte(s),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return s()},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=Uc({},kk,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===kk.lineTerminatorsPattern)this.config.lineTerminatorsPattern=uir;else if(this.config.lineTerminatorCharacters===kk.lineTerminatorCharacters)throw Error(`Error: Missing 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),Kn(e)?i={modes:{defaultMode:Ao(e)},defaultMode:Tk}:(s=!1,i=Ao(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(U$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Y$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},tn(i.modes,(o,l)=>{i.modes[l]=YO(o,u=>L0(u))});const a=qc(i.modes);if(tn(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(L$e(o,a))}),Fi(this.lexerDefinitionErrors)){P3(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=_$e(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Uc({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Fi(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Lr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}tn(this.lexerDefinitionWarning,o=>{Hte(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(s&&(this.handleModes=Da),this.trackStartLines===!1&&(this.computeNewColumn=P7),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Da),/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 config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Wc(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Fi(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}tn(this.lexerDefinitionWarning,o=>{Ute(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(s&&(this.handleModes=Da),this.trackStartLines===!1&&(this.computeNewColumn=F7),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Da),/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 config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Yc(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Fi(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{x$e()}),this.TRACE_INIT("toFastProperties",()=>{Wte(this)})})}tokenize(e,r=this.defaultMode){if(!Fi(this.lexerDefinitionErrors)){const i=Lr(this.lexerDefinitionErrors,s=>s.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{E$e()}),this.TRACE_INIT("toFastProperties",()=>{jte(this)})})}tokenize(e,r=this.defaultMode){if(!Fi(this.lexerDefinitionErrors)){const i=Lr(this.lexerDefinitionErrors,s=>s.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,s,a,o,l,u,h,d,f,p,g,m,y,v;const x=e,b=x.length;let T=0,C=0;const S=this.hasCustom?0:Math.floor(e.length/10),k=new Array(S),E=[];let A=this.trackStartLines?1:void 0,R=this.trackStartLines?1:void 0;const _=H$e(this.emptyGroups),P=this.trackStartLines,N=this.config.lineTerminatorsPattern;let L=0,I=[],$=[];const O=[],D=[];Object.freeze(D);let F=!1;const z=M(G=>{if(O.length===1&&G.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(G);E.push({offset:G.startOffset,line:G.startLine,column:G.startColumn,length:G.image.length,message:W})}else{O.pop();const W=Oy(O);I=this.patternIdxToConfig[W],$=this.charCodeToPatternIdxToConfig[W],L=I.length;const K=this.canModeBeOptimized[W]&&this.config.safeMode===!1;$&&K?F=!0:F=!1}},"pop_mode");function V(G){O.push(G),$=this.charCodeToPatternIdxToConfig[G],I=this.patternIdxToConfig[G],L=I.length,L=I.length;const W=this.canModeBeOptimized[G]&&this.config.safeMode===!1;$&&W?F=!0:F=!1}M(V,"push_mode"),V.call(this,r);let B;const H=this.config.recoveryEnabled;for(;Tl.length){l=a,d=a.length,u=h,B=Z;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(T,T+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,T,p,B.tokenType,A,R,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):_[f].push(g)),P===!0&&B.canLineTerminator===!0){let q=0,oe,Q;N.lastIndex=0;do l=l!==null?l:e.substring(T,T+d),oe=N.test(l),oe===!0&&(Q=N.lastIndex-1,q++);while(oe===!0);q!==0?(A=A+q,R=d-Q,this.updateTokenEndLineColumnLocation(g,f,Q,q,A,R,d)):R=this.computeNewColumn(R,d)}else R=this.computeNewColumn(R,d);T=T+d,this.handleModes(B,z,V,g)}else{const q=T,oe=A,Q=R;let Z=H===!1;for(;Z===!1&&T ${ty(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const s="Expecting: ",o=` -but found: '`+Mh(e).image+"'";if(n)return s+n+o;{const l=Wc(t,(f,p)=>f.concat(p),[]),u=Lr(l,f=>`[${Lr(f,p=>ty(p)).join(", ")}]`),d=`one of these possible Token sequences: +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,s,a,o,l,u,h,d,f,p,g,m,y,v;const x=e,b=x.length;let T=0,C=0;const S=this.hasCustom?0:Math.floor(e.length/10),k=new Array(S),E=[];let A=this.trackStartLines?1:void 0,R=this.trackStartLines?1:void 0;const _=j$e(this.emptyGroups),P=this.trackStartLines,N=this.config.lineTerminatorsPattern;let L=0,I=[],$=[];const O=[],D=[];Object.freeze(D);let F=!1;const z=M(G=>{if(O.length===1&&G.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(G);E.push({offset:G.startOffset,line:G.startLine,column:G.startColumn,length:G.image.length,message:W})}else{O.pop();const W=$y(O);I=this.patternIdxToConfig[W],$=this.charCodeToPatternIdxToConfig[W],L=I.length;const K=this.canModeBeOptimized[W]&&this.config.safeMode===!1;$&&K?F=!0:F=!1}},"pop_mode");function V(G){O.push(G),$=this.charCodeToPatternIdxToConfig[G],I=this.patternIdxToConfig[G],L=I.length,L=I.length;const W=this.canModeBeOptimized[G]&&this.config.safeMode===!1;$&&W?F=!0:F=!1}M(V,"push_mode"),V.call(this,r);let B;const H=this.config.recoveryEnabled;for(;Tl.length){l=a,d=a.length,u=h,B=Z;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(T,T+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,T,p,B.tokenType,A,R,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):_[f].push(g)),P===!0&&B.canLineTerminator===!0){let q=0,oe,Q;N.lastIndex=0;do l=l!==null?l:e.substring(T,T+d),oe=N.test(l),oe===!0&&(Q=N.lastIndex-1,q++);while(oe===!0);q!==0?(A=A+q,R=d-Q,this.updateTokenEndLineColumnLocation(g,f,Q,q,A,R,d)):R=this.computeNewColumn(R,d)}else R=this.computeNewColumn(R,d);T=T+d,this.handleModes(B,z,V,g)}else{const q=T,oe=A,Q=R;let Z=H===!1;for(;Z===!1&&T ${ny(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const s="Expecting: ",o=` +but found: '`+Lh(e).image+"'";if(n)return s+n+o;{const l=Yc(t,(f,p)=>f.concat(p),[]),u=Lr(l,f=>`[${Lr(f,p=>ny(p)).join(", ")}]`),d=`one of these possible Token sequences: ${Lr(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return s+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",a=` -but found: '`+Mh(e).image+"'";if(r)return i+r+a;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${Lr(t,u=>`[${Lr(u,h=>ty(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(db);var Knr={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+t.name+"<-"}},z1={buildDuplicateFoundError(t,e){function r(h){return h instanceof Zi?h.terminalType.name:h instanceof Ll?h.nonTerminalName:""}M(r,"getExtraProductionArgument");const n=t.name,i=Mh(e),s=i.idx,a=nh(i),o=r(i),l=s>0;let u=`->${a}${l?s:""}<- ${o?`with argument: ->${o}<-`:""} +but found: '`+Lh(e).image+"'";if(r)return i+r+a;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${Lr(t,u=>`[${Lr(u,h=>ny(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(pb);var dir={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+t.name+"<-"}},H1={buildDuplicateFoundError(t,e){function r(h){return h instanceof Zi?h.terminalType.name:h instanceof Nl?h.nonTerminalName:""}M(r,"getExtraProductionArgument");const n=t.name,i=Lh(e),s=i.idx,a=ah(i),o=r(i),l=s>0;let u=`->${a}${l?s:""}<- ${o?`with argument: ->${o}<-`:""} appears more than once (${e.length} times) in the top level rule: ->${n}<-. For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` @@ -3509,16 +3516,16 @@ inside top level rule: ->`+t.name+"<-"}},z1={buildDuplicateFoundError(t,e){funct 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=Lr(t.prefixPath,i=>ty(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=Lr(t.prefixPath,i=>ny(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix in 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 inside <${t.topLevelRule.name}> Rule, `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. Only the last alternative may be empty. -`;else{const i=Lr(t.prefixPath,s=>ty(s)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. +`;else{const i=Lr(t.prefixPath,s=>ny(s)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n},buildEmptyRepetitionError(t){let e=nh(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. +For Further details.`,n},buildEmptyRepetitionError(t){let e=ah(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 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: inside <${t.topLevelRule.name}> Rule. @@ -3527,45 +3534,45 @@ 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 R3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function tBe(t,e){const r=new Znr(t,e);return r.resolveRefs(),r.errors}M(tBe,"resolveGrammar");var Px,Znr=(Px=class extends _3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(wa(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:Il.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(Px,"GastRefResolverVisitor"),Px),$x,Qnr=($x=class extends qO{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=Ao(this.path.ruleStack).reverse(),this.occurrenceStack=Ao(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Fi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},M($x,"AbstractNextPossibleTokensWalker"),$x),Bx,Jnr=(Bx=class extends Qnr{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),s=new pc({definition:i});this.possibleTokTypes=L3(s),this.found=!0}}},M(Bx,"NextAfterTokenWalker"),Bx),Fx,YO=(Fx=class extends qO{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}},M(Fx,"AbstractNextTerminalAfterProductionWalker"),Fx),zx,eir=(zx=class extends YO{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Mh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},M(zx,"NextTerminalAfterManyWalker"),zx),Vx,Gge=(Vx=class extends YO{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Mh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},M(Vx,"NextTerminalAfterManySepWalker"),Vx),Hx,tir=(Hx=class extends YO{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Mh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},M(Hx,"NextTerminalAfterAtLeastOneWalker"),Hx),Gx,Wge=(Gx=class extends YO{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Mh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},M(Gx,"NextTerminalAfterAtLeastOneSepWalker"),Gx);function vI(t,e,r=[]){r=Ao(r);let n=[],i=0;function s(o){return o.concat(go(t,i+1))}M(s,"remainingPathWith");function a(o){const l=vI(s(o),e,r);return n.concat(l)}for(M(a,"getAlternativesForProd");r.length{Fi(l.definition)===!1&&(n=a(l.definition))}),n;if(o instanceof Zi)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:go(t,i)}),n}M(vI,"possiblePathsFrom");function Qte(t,e,r,n){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Fi(d);){const f=d.pop();if(f===a){o&&Oy(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Fi(p))continue;const v=p[0];if(v===i){const x={idx:g,def:go(p),ruleStack:nE(m),occurrenceStack:nE(y)};d.push(x)}else if(v instanceof Zi)if(g=0;x--){const b=v.definition[x],T={idx:g,def:b.definition.concat(go(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof pc)d.push({idx:g,def:v.definition.concat(go(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof R3)d.push(rBe(v,g,m,y));else throw Error("non exhaustive match")}return h}M(Qte,"nextPossibleTokensAfter");function rBe(t,e,r,n){const i=Ao(r);i.push(t.name);const s=Ao(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}M(rBe,"expandTopLevelRule");var ws;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ws||(ws={}));function jO(t){if(t instanceof Eo||t==="Option")return ws.OPTION;if(t instanceof Os||t==="Repetition")return ws.REPETITION;if(t instanceof Xc||t==="RepetitionMandatory")return ws.REPETITION_MANDATORY;if(t instanceof Kc||t==="RepetitionMandatoryWithSeparator")return ws.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof vc||t==="RepetitionWithSeparator")return ws.REPETITION_WITH_SEPARATOR;if(t instanceof bc||t==="Alternation")return ws.ALTERNATION;throw Error("non exhaustive match")}M(jO,"getProdType");function uY(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=jO(n);return s===ws.ALTERNATION?q7(e,r,i):U7(e,r,s,i)}M(uY,"getLookaheadPaths");function nBe(t,e,r,n,i,s){const a=q7(t,e,r),o=ere(a)?sE:I3;return s(a,n,o,i)}M(nBe,"buildLookaheadFuncForOr");function iBe(t,e,r,n,i,s){const a=U7(t,e,i,r),o=ere(a)?sE:I3;return s(a[0],o,n)}M(iBe,"buildLookaheadFuncForOptionalProd");function sBe(t,e,r,n){const i=t.length,s=wh(t,a=>wh(a,o=>o.length===1));if(e)return function(a){const o=Lr(a,l=>l.GATE);for(let l=0;lxh(l)),o=Wc(a,(l,u,h)=>(tn(u,d=>{jr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),tn(d.categoryMatches,f=>{jr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;as.length===1),i=t.length;if(n&&!r){const s=xh(t);if(s.length===1&&Fi(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=Wc(s,(o,l,u)=>(o[l.tokenTypeIdx]=!0,tn(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;svI([a],1)),n=hY(r.length),i=Lr(r,a=>{const o={};return tn(a,l=>{const u=TR(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=hY(o.length);for(let l=0;l{const v=TR(y.partialPath);tn(v,x=>{i[l][x]=!0})})}}}}return n}M(Jte,"lookAheadSequenceFromAlternatives");function q7(t,e,r,n){const i=new oBe(t,ws.ALTERNATION,n);return e.accept(i),Jte(i.result,r)}M(q7,"getLookaheadPathsForOr");function U7(t,e,r,n){const i=new oBe(t,r);e.accept(i);const s=i.result,o=new rir(e,t,r).startWalking(),l=new pc({definition:s}),u=new pc({definition:o});return Jte([l,u],n)}M(U7,"getLookaheadPathsForOptionalProd");function bI(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(cBe,"isStrictPrefixOfPath");function ere(t){return wh(t,e=>wh(e,r=>wh(r,n=>Fi(n.categoryMatches))))}M(ere,"areTokenCategoriesNotUsed");function uBe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:Il.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(uBe,"validateLookahead");function hBe(t,e,r,n){const i=ku(t,l=>dBe(l,r)),s=TBe(t,e,r),a=ku(t,l=>vBe(l,r)),o=ku(t,l=>pBe(l,t,n,r));return i.concat(s,a,o)}M(hBe,"validateGrammar");function dBe(t,e){const r=new nir;t.accept(r);const n=r.allProductions,i=ynr(n,fBe),s=Dh(i,o=>o.length>1);return Lr(wa(s),o=>{const l=Mh(o),u=e.buildDuplicateFoundError(t,o),h=nh(l),d={message:u,type:Il.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=tre(l);return f&&(d.parameter=f),d})}M(dBe,"validateDuplicateProductions");function fBe(t){return`${nh(t)}_#_${t.idx}_#_${tre(t)}`}M(fBe,"identifyProductionForDuplicates");function tre(t){return t instanceof Zi?t.terminalType.name:t instanceof Ll?t.nonTerminalName:""}M(tre,"getExtraProductionArgument");var Ux,nir=(Ux=class extends _3{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},M(Ux,"OccurrenceValidationCollector"),Ux);function pBe(t,e,r,n){const i=[];if(Wc(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:Il.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(pBe,"validateRuleDoesNotAlreadyExist");function gBe(t,e,r){const n=[];let i;return zl(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Il.INVALID_RULE_OVERRIDE,ruleName:t})),n}M(gBe,"validateRuleIsOverridden");function rre(t,e,r,n=[]){const i=[],s=wS(e.definition);if(Fi(s))return[];{const a=t.name;zl(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Il.LEFT_RECURSION,ruleName:a});const l=GO(s,n.concat([t])),u=ku(l,h=>{const d=Ao(n);return d.push(h),rre(t,h,r,d)});return i.concat(u)}}M(rre,"validateNoLeftRecursion");function wS(t){let e=[];if(Fi(t))return e;const r=Mh(t);if(r instanceof Ll)e.push(r.referencedRule);else if(r instanceof pc||r instanceof Eo||r instanceof Xc||r instanceof Kc||r instanceof vc||r instanceof Os)e=e.concat(wS(r.definition));else if(r instanceof bc)e=xh(Lr(r.definition,s=>wS(s.definition)));else if(!(r instanceof Zi))throw Error("non exhaustive match");const n=iE(r),i=t.length>1;if(n&&i){const s=go(t);return e.concat(wS(s))}else return e}M(wS,"getFirstNoneTerminal");var Yx,nre=(Yx=class extends _3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Yx,"OrCollector"),Yx);function mBe(t,e){const r=new nre;t.accept(r);const n=r.alternations;return ku(n,s=>{const a=nE(s.definition);return ku(a,(o,l)=>{const u=Qte([o],[],I3,1);return Fi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:Il.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}M(mBe,"validateEmptyOrAlternative");function yBe(t,e,r){const n=new nre;t.accept(n);let i=n.alternations;return i=WO(i,a=>a.ignoreAmbiguities===!0),ku(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=q7(o,t,l,a),h=xBe(u,a,t,r),d=wBe(u,a,t,r);return h.concat(d)})}M(yBe,"validateAmbiguousAlternationAlternatives");var jx,iir=(jx=class extends _3{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},M(jx,"RepetitionCollector"),jx);function vBe(t,e){const r=new nre;t.accept(r);const n=r.alternations;return ku(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Il.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}M(vBe,"validateTooManyAlts");function bBe(t,e,r){const n=[];return tn(t,i=>{const s=new iir;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=jO(o),u=o.maxLookahead||e,h=o.idx,f=U7(h,i,l,u)[0];if(Fi(xh(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Il.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(bBe,"validateSomeNonEmptyLookaheadPath");function xBe(t,e,r,n){const i=[],s=Wc(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||tn(l,h=>{const d=[u];tn(t,(f,p)=>{u!==p&&bI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!bI(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Lr(s,o=>{const l=Lr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Il.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(xBe,"checkAlternativesAmbiguities");function wBe(t,e,r,n){const i=Wc(t,(a,o,l)=>{const u=Lr(o,h=>({idx:l,path:h}));return a.concat(u)},[]);return H7(ku(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,u=a.path,h=Pu(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Il.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(wBe,"checkPrefixAlternativesAmbiguities");function TBe(t,e,r){const n=[],i=Lr(e,s=>s.name);return tn(t,s=>{const a=s.name;if(zl(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:Il.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}M(TBe,"checkTerminalAndNoneTerminalsNameSpace");function CBe(t){const e=zte(t,{errMsgProvider:Knr}),r={};return tn(t.rules,n=>{r[n.name]=n}),tBe(r,e.errMsgProvider)}M(CBe,"resolveGrammar");function kBe(t){return t=zte(t,{errMsgProvider:z1}),hBe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(kBe,"validateGrammar");var SBe="MismatchedTokenException",EBe="NoViableAltException",ABe="EarlyExitException",MBe="NotAllInputParsedException",RBe=[SBe,EBe,ABe,MBe];Object.freeze(RBe);function aE(t){return zl(RBe,t.name)}M(aE,"isRecognitionException");var Xx,XO=(Xx=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},M(Xx,"RecognitionException"),Xx),Kx,_Be=(Kx=class extends XO{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=SBe}},M(Kx,"MismatchedTokenException"),Kx),Zx,sir=(Zx=class extends XO{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=EBe}},M(Zx,"NoViableAltException"),Zx),Qx,air=(Qx=class extends XO{constructor(e,r){super(e,r),this.name=MBe}},M(Qx,"NotAllInputParsedException"),Qx),Jx,oir=(Jx=class extends XO{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ABe}},M(Jx,"EarlyExitException"),Jx),Vz={},LBe="InRuleRecoveryException",e4,lir=(e4=class extends Error{constructor(e){super(e),this.name=LBe}},M(e4,"InRuleRecoveryException"),e4),t4,cir=(t4=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=jr(e,"recoveryEnabled")?e.recoveryEnabled:M0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=IBe)}getTokenToInsert(e){const r=W7(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=M(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new _Be(p,u,this.LA(0));g.resyncedTokens=nE(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new lir("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Fi(r))return!1;const n=this.LA(1);return O5(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return zl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=O5(e,s=>Zte(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Vz;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Lr(e,(n,i)=>i===0?Vz:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Lr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return xh(e)}getFollowSetFromFollowKey(e){if(e===Vz)return[Ng];const r=e.ruleName+e.idxInCallingRule+y$e+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Ng)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return nE(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Ao(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(t4,"Recoverable"),t4);function IBe(t,e,r,n,i,s,a){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new s(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Ng,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}M(IBe,"attemptInRepetitionRecovery");var uir=4,um=8,NBe=1<rre(r,r,z1))}validateEmptyOrAlternatives(e){return ku(e,r=>mBe(r,z1))}validateAmbiguousAlternationAlternatives(e,r){return ku(e,n=>yBe(n,r,z1))}validateSomeNonEmptyLookaheadPath(e,r){return bBe(e,r,z1)}buildLookaheadForAlternation(e){return nBe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,sBe)}buildLookaheadForOptional(e){return iBe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,jO(e.prodType),aBe)}},M(r4,"LLkLookaheadStrategy"),r4),n4,hir=(n4=class{initLooksAhead(e){this.dynamicTokensEnabled=jr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:M0.dynamicTokensEnabled,this.maxLookahead=jr(e,"maxLookahead")?e.maxLookahead:M0.maxLookahead,this.lookaheadStrategy=jr(e,"lookaheadStrategy")?e.lookaheadStrategy:new ire({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){tn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=OBe(r);tn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${nh(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=kR(this.fullRuleNameToShort[r.name],NBe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,dY,"Repetition",u.maxLookahead,nh(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,DBe,"Option",u.maxLookahead,nh(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,fY,"RepetitionMandatory",u.maxLookahead,nh(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,CR,"RepetitionMandatoryWithSeparator",u.maxLookahead,nh(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,pY,"RepetitionWithSeparator",u.maxLookahead,nh(u))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=kR(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return kR(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(n4,"LooksAhead"),n4),i4,dir=(i4=class extends _3{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},M(i4,"DslMethodsCollectorVisitor"),i4),z8=new dir;function OBe(t){z8.reset(),t.accept(z8);const e=z8.dslMethods;return z8.reset(),e}M(OBe,"collectMethods");function gY(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof I3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function oBe(t,e){const r=new fir(t,e);return r.resolveRefs(),r.errors}M(oBe,"resolveGrammar");var Bx,fir=(Bx=class extends N3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(wa(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:Dl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(Bx,"GastRefResolverVisitor"),Bx),Fx,pir=(Fx=class extends jO{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=Ao(this.path.ruleStack).reverse(),this.occurrenceStack=Ao(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Fi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},M(Fx,"AbstractNextPossibleTokensWalker"),Fx),zx,gir=(zx=class extends pir{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),s=new yc({definition:i});this.possibleTokTypes=D3(s),this.found=!0}}},M(zx,"NextAfterTokenWalker"),zx),Vx,KO=(Vx=class extends jO{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}},M(Vx,"AbstractNextTerminalAfterProductionWalker"),Vx),Hx,mir=(Hx=class extends KO{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},M(Hx,"NextTerminalAfterManyWalker"),Hx),Gx,Xge=(Gx=class extends KO{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},M(Gx,"NextTerminalAfterManySepWalker"),Gx),Wx,yir=(Wx=class extends KO{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},M(Wx,"NextTerminalAfterAtLeastOneWalker"),Wx),qx,Kge=(qx=class extends KO{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},M(qx,"NextTerminalAfterAtLeastOneSepWalker"),qx);function wI(t,e,r=[]){r=Ao(r);let n=[],i=0;function s(o){return o.concat(go(t,i+1))}M(s,"remainingPathWith");function a(o){const l=wI(s(o),e,r);return n.concat(l)}for(M(a,"getAlternativesForProd");r.length{Fi(l.definition)===!1&&(n=a(l.definition))}),n;if(o instanceof Zi)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:go(t,i)}),n}M(wI,"possiblePathsFrom");function rre(t,e,r,n){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Fi(d);){const f=d.pop();if(f===a){o&&$y(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Fi(p))continue;const v=p[0];if(v===i){const x={idx:g,def:go(p),ruleStack:aE(m),occurrenceStack:aE(y)};d.push(x)}else if(v instanceof Zi)if(g=0;x--){const b=v.definition[x],T={idx:g,def:b.definition.concat(go(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof yc)d.push({idx:g,def:v.definition.concat(go(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof I3)d.push(lBe(v,g,m,y));else throw Error("non exhaustive match")}return h}M(rre,"nextPossibleTokensAfter");function lBe(t,e,r,n){const i=Ao(r);i.push(t.name);const s=Ao(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}M(lBe,"expandTopLevelRule");var ws;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ws||(ws={}));function ZO(t){if(t instanceof Eo||t==="Option")return ws.OPTION;if(t instanceof Os||t==="Repetition")return ws.REPETITION;if(t instanceof Qc||t==="RepetitionMandatory")return ws.REPETITION_MANDATORY;if(t instanceof Jc||t==="RepetitionMandatoryWithSeparator")return ws.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof wc||t==="RepetitionWithSeparator")return ws.REPETITION_WITH_SEPARATOR;if(t instanceof Tc||t==="Alternation")return ws.ALTERNATION;throw Error("non exhaustive match")}M(ZO,"getProdType");function pY(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=ZO(n);return s===ws.ALTERNATION?j7(e,r,i):X7(e,r,s,i)}M(pY,"getLookaheadPaths");function cBe(t,e,r,n,i,s){const a=j7(t,e,r),o=ire(a)?lE:O3;return s(a,n,o,i)}M(cBe,"buildLookaheadFuncForOr");function uBe(t,e,r,n,i,s){const a=X7(t,e,i,r),o=ire(a)?lE:O3;return s(a[0],o,n)}M(uBe,"buildLookaheadFuncForOptionalProd");function hBe(t,e,r,n){const i=t.length,s=kh(t,a=>kh(a,o=>o.length===1));if(e)return function(a){const o=Lr(a,l=>l.GATE);for(let l=0;lCh(l)),o=Yc(a,(l,u,h)=>(tn(u,d=>{jr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),tn(d.categoryMatches,f=>{jr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;as.length===1),i=t.length;if(n&&!r){const s=Ch(t);if(s.length===1&&Fi(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=Yc(s,(o,l,u)=>(o[l.tokenTypeIdx]=!0,tn(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;swI([a],1)),n=gY(r.length),i=Lr(r,a=>{const o={};return tn(a,l=>{const u=ER(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=gY(o.length);for(let l=0;l{const v=ER(y.partialPath);tn(v,x=>{i[l][x]=!0})})}}}}return n}M(nre,"lookAheadSequenceFromAlternatives");function j7(t,e,r,n){const i=new fBe(t,ws.ALTERNATION,n);return e.accept(i),nre(i.result,r)}M(j7,"getLookaheadPathsForOr");function X7(t,e,r,n){const i=new fBe(t,r);e.accept(i);const s=i.result,o=new vir(e,t,r).startWalking(),l=new yc({definition:s}),u=new yc({definition:o});return nre([l,u],n)}M(X7,"getLookaheadPathsForOptionalProd");function TI(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(gBe,"isStrictPrefixOfPath");function ire(t){return kh(t,e=>kh(e,r=>kh(r,n=>Fi(n.categoryMatches))))}M(ire,"areTokenCategoriesNotUsed");function mBe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:Dl.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(mBe,"validateLookahead");function yBe(t,e,r,n){const i=Au(t,l=>vBe(l,r)),s=MBe(t,e,r),a=Au(t,l=>kBe(l,r)),o=Au(t,l=>xBe(l,t,n,r));return i.concat(s,a,o)}M(yBe,"validateGrammar");function vBe(t,e){const r=new bir;t.accept(r);const n=r.allProductions,i=Nnr(n,bBe),s=$h(i,o=>o.length>1);return Lr(wa(s),o=>{const l=Lh(o),u=e.buildDuplicateFoundError(t,o),h=ah(l),d={message:u,type:Dl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=sre(l);return f&&(d.parameter=f),d})}M(vBe,"validateDuplicateProductions");function bBe(t){return`${ah(t)}_#_${t.idx}_#_${sre(t)}`}M(bBe,"identifyProductionForDuplicates");function sre(t){return t instanceof Zi?t.terminalType.name:t instanceof Nl?t.nonTerminalName:""}M(sre,"getExtraProductionArgument");var jx,bir=(jx=class extends N3{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},M(jx,"OccurrenceValidationCollector"),jx);function xBe(t,e,r,n){const i=[];if(Yc(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:Dl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(xBe,"validateRuleDoesNotAlreadyExist");function wBe(t,e,r){const n=[];let i;return Hl(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Dl.INVALID_RULE_OVERRIDE,ruleName:t})),n}M(wBe,"validateRuleIsOverridden");function are(t,e,r,n=[]){const i=[],s=kS(e.definition);if(Fi(s))return[];{const a=t.name;Hl(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Dl.LEFT_RECURSION,ruleName:a});const l=UO(s,n.concat([t])),u=Au(l,h=>{const d=Ao(n);return d.push(h),are(t,h,r,d)});return i.concat(u)}}M(are,"validateNoLeftRecursion");function kS(t){let e=[];if(Fi(t))return e;const r=Lh(t);if(r instanceof Nl)e.push(r.referencedRule);else if(r instanceof yc||r instanceof Eo||r instanceof Qc||r instanceof Jc||r instanceof wc||r instanceof Os)e=e.concat(kS(r.definition));else if(r instanceof Tc)e=Ch(Lr(r.definition,s=>kS(s.definition)));else if(!(r instanceof Zi))throw Error("non exhaustive match");const n=oE(r),i=t.length>1;if(n&&i){const s=go(t);return e.concat(kS(s))}else return e}M(kS,"getFirstNoneTerminal");var Xx,ore=(Xx=class extends N3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Xx,"OrCollector"),Xx);function TBe(t,e){const r=new ore;t.accept(r);const n=r.alternations;return Au(n,s=>{const a=aE(s.definition);return Au(a,(o,l)=>{const u=rre([o],[],O3,1);return Fi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:Dl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}M(TBe,"validateEmptyOrAlternative");function CBe(t,e,r){const n=new ore;t.accept(n);let i=n.alternations;return i=YO(i,a=>a.ignoreAmbiguities===!0),Au(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=j7(o,t,l,a),h=EBe(u,a,t,r),d=ABe(u,a,t,r);return h.concat(d)})}M(CBe,"validateAmbiguousAlternationAlternatives");var Kx,xir=(Kx=class extends N3{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},M(Kx,"RepetitionCollector"),Kx);function kBe(t,e){const r=new ore;t.accept(r);const n=r.alternations;return Au(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Dl.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}M(kBe,"validateTooManyAlts");function SBe(t,e,r){const n=[];return tn(t,i=>{const s=new xir;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=ZO(o),u=o.maxLookahead||e,h=o.idx,f=X7(h,i,l,u)[0];if(Fi(Ch(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Dl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(SBe,"validateSomeNonEmptyLookaheadPath");function EBe(t,e,r,n){const i=[],s=Yc(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||tn(l,h=>{const d=[u];tn(t,(f,p)=>{u!==p&&TI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!TI(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Lr(s,o=>{const l=Lr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Dl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(EBe,"checkAlternativesAmbiguities");function ABe(t,e,r,n){const i=Yc(t,(a,o,l)=>{const u=Lr(o,h=>({idx:l,path:h}));return a.concat(u)},[]);return q7(Au(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,u=a.path,h=Fu(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Dl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(ABe,"checkPrefixAlternativesAmbiguities");function MBe(t,e,r){const n=[],i=Lr(e,s=>s.name);return tn(t,s=>{const a=s.name;if(Hl(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:Dl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}M(MBe,"checkTerminalAndNoneTerminalsNameSpace");function RBe(t){const e=Wte(t,{errMsgProvider:dir}),r={};return tn(t.rules,n=>{r[n.name]=n}),oBe(r,e.errMsgProvider)}M(RBe,"resolveGrammar");function _Be(t){return t=Wte(t,{errMsgProvider:H1}),yBe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(_Be,"validateGrammar");var LBe="MismatchedTokenException",IBe="NoViableAltException",NBe="EarlyExitException",DBe="NotAllInputParsedException",OBe=[LBe,IBe,NBe,DBe];Object.freeze(OBe);function cE(t){return Hl(OBe,t.name)}M(cE,"isRecognitionException");var Zx,QO=(Zx=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},M(Zx,"RecognitionException"),Zx),Qx,PBe=(Qx=class extends QO{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=LBe}},M(Qx,"MismatchedTokenException"),Qx),Jx,wir=(Jx=class extends QO{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=IBe}},M(Jx,"NoViableAltException"),Jx),e4,Tir=(e4=class extends QO{constructor(e,r){super(e,r),this.name=DBe}},M(e4,"NotAllInputParsedException"),e4),t4,Cir=(t4=class extends QO{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=NBe}},M(t4,"EarlyExitException"),t4),qz={},$Be="InRuleRecoveryException",r4,kir=(r4=class extends Error{constructor(e){super(e),this.name=$Be}},M(r4,"InRuleRecoveryException"),r4),n4,Sir=(n4=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=jr(e,"recoveryEnabled")?e.recoveryEnabled:N0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=BBe)}getTokenToInsert(e){const r=Y7(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=M(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new PBe(p,u,this.LA(0));g.resyncedTokens=aE(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new kir("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Fi(r))return!1;const n=this.LA(1);return B5(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Hl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=B5(e,s=>tre(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return qz;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Lr(e,(n,i)=>i===0?qz:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Lr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ch(e)}getFollowSetFromFollowKey(e){if(e===qz)return[Pg];const r=e.ruleName+e.idxInCallingRule+C$e+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Pg)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return aE(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Ao(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(n4,"Recoverable"),n4);function BBe(t,e,r,n,i,s,a){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new s(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Pg,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}M(BBe,"attemptInRepetitionRecovery");var Eir=4,fm=8,FBe=1<are(r,r,H1))}validateEmptyOrAlternatives(e){return Au(e,r=>TBe(r,H1))}validateAmbiguousAlternationAlternatives(e,r){return Au(e,n=>CBe(n,r,H1))}validateSomeNonEmptyLookaheadPath(e,r){return SBe(e,r,H1)}buildLookaheadForAlternation(e){return cBe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,hBe)}buildLookaheadForOptional(e){return uBe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ZO(e.prodType),dBe)}},M(i4,"LLkLookaheadStrategy"),i4),s4,Air=(s4=class{initLooksAhead(e){this.dynamicTokensEnabled=jr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:N0.dynamicTokensEnabled,this.maxLookahead=jr(e,"maxLookahead")?e.maxLookahead:N0.maxLookahead,this.lookaheadStrategy=jr(e,"lookaheadStrategy")?e.lookaheadStrategy:new lre({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){tn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=VBe(r);tn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${ah(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=MR(this.fullRuleNameToShort[r.name],FBe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,mY,"Repetition",u.maxLookahead,ah(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,zBe,"Option",u.maxLookahead,ah(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,yY,"RepetitionMandatory",u.maxLookahead,ah(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,AR,"RepetitionMandatoryWithSeparator",u.maxLookahead,ah(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,vY,"RepetitionWithSeparator",u.maxLookahead,ah(u))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=MR(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return MR(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(s4,"LooksAhead"),s4),a4,Mir=(a4=class extends N3{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},M(a4,"DslMethodsCollectorVisitor"),a4),W8=new Mir;function VBe(t){W8.reset(),t.accept(W8);const e=W8.dslMethods;return W8.reset(),e}M(VBe,"collectMethods");function bY(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${s.join(` `).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}M(FBe,"createBaseSemanticVisitorConstructor");function zBe(t,e,r){const n=M(function(){},"derivedConstructor");sre(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return tn(e,s=>{i[s]=BBe}),n.prototype=i,n.prototype.constructor=n,n}M(zBe,"createBaseVisitorConstructorWithDefaults");var yY;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(yY||(yY={}));function VBe(t,e){return HBe(t,e)}M(VBe,"validateVisitor");function HBe(t,e){const r=Pu(e,i=>X0(t[i])===!1),n=Lr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:yY.MISSING_METHOD,methodName:i}));return H7(n)}M(HBe,"validateMissingCstMethods");var s4,pir=(s4=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=jr(e,"nodeLocationTracking")?e.nodeLocationTracking:M0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Da,this.cstFinallyStateUpdate=Da,this.cstPostTerminal=Da,this.cstPostNonTerminal=Da,this.cstPostRule=Da;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=mY,this.setNodeLocationFromNode=mY,this.cstPostRule=Da,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Da,this.setNodeLocationFromNode=Da,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=gY,this.setNodeLocationFromNode=gY,this.cstPostRule=Da,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Da,this.setNodeLocationFromNode=Da,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Da,this.setNodeLocationFromNode=Da,this.cstPostRule=Da,this.setInitialNodeLocation=Da;else throw Error(`Invalid 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];PBe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];$Be(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(E0(this.baseCstVisitorConstructor)){const e=FBe(this.className,Hc(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(E0(this.baseCstVisitorWithDefaultsConstructor)){const e=zBe(this.className,Hc(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]}},M(s4,"TreeBuilder"),s4),a4,gir=(a4=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing 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)):xI}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?xI: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()}},M(a4,"LexerAdapter"),a4),o4,mir=(o4=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=wI){if(zl(this.definedRulesNames,e)){const a={message:z1.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Il.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=wI){const i=gBe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,r,n);return this[e]=s,s}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(aE(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return h$e(wa(this.gastProductionsCache))}},M(o4,"RecognizerApi"),o4),l4,yir=(l4=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=sE,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},jr(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}M(qBe,"createBaseSemanticVisitorConstructor");function UBe(t,e,r){const n=M(function(){},"derivedConstructor");cre(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return tn(e,s=>{i[s]=WBe}),n.prototype=i,n.prototype.constructor=n,n}M(UBe,"createBaseVisitorConstructorWithDefaults");var wY;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(wY||(wY={}));function YBe(t,e){return jBe(t,e)}M(YBe,"validateVisitor");function jBe(t,e){const r=Fu(e,i=>J0(t[i])===!1),n=Lr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:wY.MISSING_METHOD,methodName:i}));return q7(n)}M(jBe,"validateMissingCstMethods");var o4,_ir=(o4=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=jr(e,"nodeLocationTracking")?e.nodeLocationTracking:N0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Da,this.cstFinallyStateUpdate=Da,this.cstPostTerminal=Da,this.cstPostNonTerminal=Da,this.cstPostRule=Da;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=xY,this.setNodeLocationFromNode=xY,this.cstPostRule=Da,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Da,this.setNodeLocationFromNode=Da,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=bY,this.setNodeLocationFromNode=bY,this.cstPostRule=Da,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Da,this.setNodeLocationFromNode=Da,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Da,this.setNodeLocationFromNode=Da,this.cstPostRule=Da,this.setInitialNodeLocation=Da;else throw Error(`Invalid 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];HBe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];GBe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(L0(this.baseCstVisitorConstructor)){const e=qBe(this.className,qc(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(L0(this.baseCstVisitorWithDefaultsConstructor)){const e=UBe(this.className,qc(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]}},M(o4,"TreeBuilder"),o4),l4,Lir=(l4=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing 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)):CI}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?CI: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()}},M(l4,"LexerAdapter"),l4),c4,Iir=(c4=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=kI){if(Hl(this.definedRulesNames,e)){const a={message:H1.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Dl.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=kI){const i=wBe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,r,n);return this[e]=s,s}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(cE(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return y$e(wa(this.gastProductionsCache))}},M(c4,"RecognizerApi"),c4),u4,Nir=(u4=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=lE,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},jr(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 For Further details.`);if(Kn(e)){if(Fi(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(Kn(e))this.tokensMap=Wc(e,(s,a)=>(s[a.name]=a,s),{});else if(jr(e,"modes")&&wh(xh(wa(e.modes)),J$e)){const s=xh(wa(e.modes)),a=Vte(s);this.tokensMap=Wc(a,(o,l)=>(o[l.name]=l,o),{})}else if(Iu(e))this.tokensMap=Ao(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ng;const n=jr(e,"modes")?xh(wa(e.modes)):wa(e),i=wh(n,s=>Fi(s.categoryMatches));this.tokenMatcher=i?sE:I3,N3(wa(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=jr(n,"resyncEnabled")?n.resyncEnabled:wI.resyncEnabled,s=jr(n,"recoveryValueFunc")?n.recoveryValueFunc:wI.recoveryValueFunc,a=this.ruleShortNameIdx<a.call(this)&&o.call(this),"lookAheadFunc")}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(fY,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;const a=r.GATE;if(a!==void 0){const o=i;i=M(()=>a.call(this)&&o.call(this),"lookAheadFunc")}}else s=r;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,ws.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,fY,e,tir)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(CR,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=M(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Wge],o,CR,e,Wge)}else throw this.raiseEarlyExitException(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(dY,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=M(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else s=r;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,dY,e,eir,a)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(pY,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=M(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Gge],o,pY,e,Gge)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,CR,e,s)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(NBe,r),i=Kn(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].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 air(r,e))}}subruleInternal(e,r,n){let i;try{const s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,n,e.ruleName)}}subruleInternalError(e,r,n){throw aE(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,n)}catch(s){i=this.consumeInternalRecovery(e,r,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new _Be(i,r,s))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===LBe?n:s}}else throw n}saveRecogState(){const e=this.errors,r=Ao(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ng)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},M(l4,"RecognizerEngine"),l4),c4,vir=(c4=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=jr(e,"errorMessageProvider")?e.errorMessageProvider:M0.errorMessageProvider}SAVE_ERROR(e){if(aE(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ao(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ao(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=U7(e,s,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new oir(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=q7(e,i,this.maxLookahead),a=[];for(let u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new sir(l,this.LA(1),o))}},M(c4,"ErrorHandler"),c4),u4,bir=(u4=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(E0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Qte([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Mh(e.ruleStack),i=this.getGAstProductions()[r];return new Jnr(i,e).startWalking()}},M(u4,"ContentAssist"),u4),KO={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(KO);var qge=!0,Uge=Math.pow(2,um)-1,GBe=Hb({name:"RECORDING_PHASE_TOKEN",pattern:Sl.NA});N3([GBe]);var WBe=W7(GBe,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(WBe);var xir={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},h4,wir=(h4=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return xI}topLevelRuleRecord(e,r){try{const n=new R3({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+` + For Further details.`)}if(Kn(e))this.tokensMap=Yc(e,(s,a)=>(s[a.name]=a,s),{});else if(jr(e,"modes")&&kh(Ch(wa(e.modes)),sBe)){const s=Ch(wa(e.modes)),a=qte(s);this.tokensMap=Yc(a,(o,l)=>(o[l.name]=l,o),{})}else if(Ou(e))this.tokensMap=Ao(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Pg;const n=jr(e,"modes")?Ch(wa(e.modes)):wa(e),i=kh(n,s=>Fi(s.categoryMatches));this.tokenMatcher=i?lE:O3,P3(wa(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=jr(n,"resyncEnabled")?n.resyncEnabled:kI.resyncEnabled,s=jr(n,"recoveryValueFunc")?n.recoveryValueFunc:kI.recoveryValueFunc,a=this.ruleShortNameIdx<a.call(this)&&o.call(this),"lookAheadFunc")}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(yY,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;const a=r.GATE;if(a!==void 0){const o=i;i=M(()=>a.call(this)&&o.call(this),"lookAheadFunc")}}else s=r;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,ws.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,yY,e,yir)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(AR,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=M(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Kge],o,AR,e,Kge)}else throw this.raiseEarlyExitException(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(mY,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=M(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else s=r;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,mY,e,mir,a)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(vY,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=M(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Xge],o,vY,e,Xge)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,AR,e,s)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(FBe,r),i=Kn(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].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 Tir(r,e))}}subruleInternal(e,r,n){let i;try{const s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,n,e.ruleName)}}subruleInternalError(e,r,n){throw cE(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,n)}catch(s){i=this.consumeInternalRecovery(e,r,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new PBe(i,r,s))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===$Be?n:s}}else throw n}saveRecogState(){const e=this.errors,r=Ao(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Pg)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},M(u4,"RecognizerEngine"),u4),h4,Dir=(h4=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=jr(e,"errorMessageProvider")?e.errorMessageProvider:N0.errorMessageProvider}SAVE_ERROR(e){if(cE(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ao(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ao(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=X7(e,s,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Cir(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=j7(e,i,this.maxLookahead),a=[];for(let u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new wir(l,this.LA(1),o))}},M(h4,"ErrorHandler"),h4),d4,Oir=(d4=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(L0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return rre([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Lh(e.ruleStack),i=this.getGAstProductions()[r];return new gir(i,e).startWalking()}},M(d4,"ContentAssist"),d4),JO={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(JO);var Zge=!0,Qge=Math.pow(2,fm)-1,XBe=Wb({name:"RECORDING_PHASE_TOKEN",pattern:Al.NA});P3([XBe]);var KBe=Y7(XBe,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(KBe);var Pir={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},f4,$ir=(f4=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return CI}topLevelRuleRecord(e,r){try{const n=new I3({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 L2.call(this,Eo,e,r)}atLeastOneInternalRecord(e,r){L2.call(this,Xc,r,e)}atLeastOneSepFirstInternalRecord(e,r){L2.call(this,Kc,r,e,qge)}manyInternalRecord(e,r){L2.call(this,Os,r,e)}manySepFirstInternalRecord(e,r){L2.call(this,vc,r,e,qge)}orInternalRecord(e,r){return qBe.call(this,e,r)}subruleInternalRecord(e,r,n){if(oE(r),!e||jr(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Oy(this.recordingProdStack),s=e.ruleName,a=new Ll({idx:r,nonTerminalName:s,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?xir:KO}consumeInternalRecord(e,r,n){if(oE(r),!Xte(e)){const a=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Oy(this.recordingProdStack),s=new Zi({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(s),WBe}},M(h4,"GastRecorder"),h4);function L2(t,e,r,n=!1){oE(r);const i=Oy(this.recordingProdStack),s=X0(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),jr(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),KO}M(L2,"recordProd");function qBe(t,e){oE(e);const r=Oy(this.recordingProdStack),n=Kn(t)===!1,i=n===!1?t:t.DEF,s=new bc({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});jr(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=a$e(i,o=>X0(o.GATE));return s.hasPredicates=a,r.definition.push(s),tn(i,o=>{const l=new pc({definition:[]});s.definition.push(l),jr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:jr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),KO}M(qBe,"recordOrProd");function vY(t){return t===0?"":`${t}`}M(vY,"getIdxSuffix");function oE(t){if(t<0||t>Uge){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${Uge+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}M(oE,"assertMethodIdxIsValid");var d4,Tir=(d4=class{initPerformanceTracer(e){if(jr(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=M0.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:s}=Gte(r),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,s}else return r()}},M(d4,"PerformanceTracer"),d4);function UBe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=r.prototype[i]})})}M(UBe,"applyMixins");var xI=W7(Ng,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(xI);var M0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:db,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),wI=Object.freeze({recoveryValueFunc:M(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Il;(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"})(Il||(Il={}));function bY(t=void 0){return function(){return t}}M(bY,"EMPTY_ALT");var iy,are=(iy=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",()=>{Wte(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),tn(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=CBe({rules:wa(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Fi(n)&&this.skipValidations===!1){const i=kBe({rules:wa(this.gastProductionsCache),tokenTypes:wa(this.tokensMap),errMsgProvider:z1,grammarName:r}),s=uBe({lookaheadStrategy:this.lookaheadStrategy,rules:wa(this.gastProductionsCache),tokenTypes:wa(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Fi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=v$e(wa(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:wa(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(wa(this.gastProductionsCache))})),!iy.DEFER_DEFINITION_ERRORS_HANDLING&&!Fi(this.definitionErrors))throw e=Lr(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return N2.call(this,Eo,e,r)}atLeastOneInternalRecord(e,r){N2.call(this,Qc,r,e)}atLeastOneSepFirstInternalRecord(e,r){N2.call(this,Jc,r,e,Zge)}manyInternalRecord(e,r){N2.call(this,Os,r,e)}manySepFirstInternalRecord(e,r){N2.call(this,wc,r,e,Zge)}orInternalRecord(e,r){return ZBe.call(this,e,r)}subruleInternalRecord(e,r,n){if(uE(r),!e||jr(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=$y(this.recordingProdStack),s=e.ruleName,a=new Nl({idx:r,nonTerminalName:s,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?Pir:JO}consumeInternalRecord(e,r,n){if(uE(r),!Jte(e)){const a=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=$y(this.recordingProdStack),s=new Zi({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(s),KBe}},M(f4,"GastRecorder"),f4);function N2(t,e,r,n=!1){uE(r);const i=$y(this.recordingProdStack),s=J0(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),jr(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),JO}M(N2,"recordProd");function ZBe(t,e){uE(e);const r=$y(this.recordingProdStack),n=Kn(t)===!1,i=n===!1?t:t.DEF,s=new Tc({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});jr(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=d$e(i,o=>J0(o.GATE));return s.hasPredicates=a,r.definition.push(s),tn(i,o=>{const l=new yc({definition:[]});s.definition.push(l),jr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:jr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),JO}M(ZBe,"recordOrProd");function TY(t){return t===0?"":`${t}`}M(TY,"getIdxSuffix");function uE(t){if(t<0||t>Qge){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${Qge+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}M(uE,"assertMethodIdxIsValid");var p4,Bir=(p4=class{initPerformanceTracer(e){if(jr(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=N0.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:s}=Yte(r),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,s}else return r()}},M(p4,"PerformanceTracer"),p4);function QBe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=r.prototype[i]})})}M(QBe,"applyMixins");var CI=Y7(Pg,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(CI);var N0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:pb,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),kI=Object.freeze({recoveryValueFunc:M(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Dl;(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"})(Dl||(Dl={}));function CY(t=void 0){return function(){return t}}M(CY,"EMPTY_ALT");var ay,ure=(ay=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",()=>{jte(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),tn(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=RBe({rules:wa(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Fi(n)&&this.skipValidations===!1){const i=_Be({rules:wa(this.gastProductionsCache),tokenTypes:wa(this.tokensMap),errMsgProvider:H1,grammarName:r}),s=mBe({lookaheadStrategy:this.lookaheadStrategy,rules:wa(this.gastProductionsCache),tokenTypes:wa(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Fi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=k$e(wa(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:wa(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(wa(this.gastProductionsCache))})),!ay.DEFER_DEFINITION_ERRORS_HANDLING&&!Fi(this.definitionErrors))throw e=Lr(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),jr(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=jr(r,"skipValidations")?r.skipValidations:M0.skipValidations}},M(iy,"Parser"),iy);are.DEFER_DEFINITION_ERRORS_HANDLING=!1;UBe(are,[cir,hir,pir,gir,yir,mir,vir,bir,wir,Tir]);var f4,Cir=(f4=class extends are{constructor(e,r=M0){const n=Ao(r);n.outputCst=!1,super(e,n)}},M(f4,"EmbeddedActionsParser"),f4);function YBe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}M(tFe,"listCacheHas");var Rir=tFe;function rFe(t,e){var r=this.__data__,n=ZO(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(rFe,"listCacheSet");var _ir=rFe;function xv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Psr?new OFe:void 0;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=yar}M(ize,"isLength");var cre=ize,bar="[object Arguments]",xar="[object Array]",war="[object Boolean]",Tar="[object Date]",Car="[object Error]",kar="[object Function]",Sar="[object Map]",Ear="[object Number]",Aar="[object Object]",Mar="[object RegExp]",Rar="[object Set]",_ar="[object String]",Lar="[object WeakMap]",Iar="[object ArrayBuffer]",Nar="[object DataView]",Dar="[object Float32Array]",Oar="[object Float64Array]",Par="[object Int8Array]",$ar="[object Int16Array]",Bar="[object Int32Array]",Far="[object Uint8Array]",zar="[object Uint8ClampedArray]",Var="[object Uint16Array]",Har="[object Uint32Array]",ji={};ji[Dar]=ji[Oar]=ji[Par]=ji[$ar]=ji[Bar]=ji[Far]=ji[zar]=ji[Var]=ji[Har]=!0;ji[bar]=ji[xar]=ji[Iar]=ji[war]=ji[Nar]=ji[Tar]=ji[Car]=ji[kar]=ji[Sar]=ji[Ear]=ji[Aar]=ji[Mar]=ji[Rar]=ji[_ar]=ji[Lar]=!1;function sze(t){return P5(t)&&cre(t.length)&&!!ji[D3(t)]}M(sze,"baseIsTypedArray");var Gar=sze;function aze(t){return function(e){return t(e)}}M(aze,"baseUnary");var War=aze,oze=typeof exports=="object"&&exports&&!exports.nodeType&&exports,TS=oze&&typeof module=="object"&&module&&!module.nodeType&&module,qar=TS&&TS.exports===oze,Wz=qar&&oFe.process,Uar=(function(){try{var t=TS&&TS.require&&TS.require("util").types;return t||Wz&&Wz.binding&&Wz.binding("util")}catch{}})(),rme=Uar,nme=rme&&rme.isTypedArray,Yar=nme?War(nme):Gar,ure=Yar,jar=Object.prototype,Xar=jar.hasOwnProperty;function lze(t,e){var r=Nl(t),n=!r&&tP(t),i=!r&&!n&&TI(t),s=!r&&!n&&!i&&ure(t),a=r||n||i||s,o=a?aar(t.length,String):[],l=o.length;for(var u in t)(e||Xar.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||nze(u,l)))&&o.push(u);return o}M(lze,"arrayLikeKeys");var Kar=lze,Zar=Object.prototype;function cze(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Zar;return t===r}M(cze,"isPrototype");var uze=cze;function hze(t,e){return function(r){return t(e(r))}}M(hze,"overArg");var Qar=hze,Jar=Qar(Object.keys,Object),eor=Jar,tor=Object.prototype,ror=tor.hasOwnProperty;function dze(t){if(!uze(t))return eor(t);var e=[];for(var r in Object(t))ror.call(t,r)&&r!="constructor"&&e.push(r);return e}M(dze,"baseKeys");var fze=dze;function pze(t){return t!=null&&cre(t.length)&&!pFe(t)}M(pze,"isArrayLike");var rP=pze;function gze(t){return rP(t)?Kar(t):fze(t)}M(gze,"keys");var hre=gze;function mze(t){return ear(t,hre,sar)}M(mze,"getAllKeys");var ime=mze,nor=1,ior=Object.prototype,sor=ior.hasOwnProperty;function yze(t,e,r,n,i,s){var a=r&nor,o=ime(t),l=o.length,u=ime(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:sor.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++dbre(t,e,a));return Sv(t,e,n,r,...i)}M(cVe,"alternation");function uVe(t,e,r){const n=Aa(t,e,r,{type:Dg});Z0(t,n);const i=Sv(t,e,n,r,hm(t,e,r));return hVe(t,e,r,i)}M(uVe,"option");function hm(t,e,r){const n=nlr(Gf(r.definition,i=>bre(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:fVe(t,n)}M(hm,"block");function xre(t,e,r,n,i){const s=n.left,a=n.right,o=Aa(t,e,r,{type:llr});Z0(t,o);const l=Aa(t,e,r,{type:tVe});return s.loopback=o,l.loopback=o,t.decisionMap[$y(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,qs(a,o),i===void 0?(qs(o,s),qs(o,l)):(qs(o,l),qs(o,i.left),qs(i.right,s)),{left:s,right:l}}M(xre,"plus");function wre(t,e,r,n,i){const s=n.left,a=n.right,o=Aa(t,e,r,{type:olr});Z0(t,o);const l=Aa(t,e,r,{type:tVe}),u=Aa(t,e,r,{type:alr});return o.loopback=u,l.loopback=u,qs(o,s),qs(o,l),qs(a,u),i!==void 0?(qs(u,l),qs(u,i.left),qs(i.right,s)):qs(u,o),t.decisionMap[$y(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}M(wre,"star");function hVe(t,e,r,n){const i=n.left,s=n.right;return qs(i,s),t.decisionMap[$y(e,"Option",r.idx)]=i,n}M(hVe,"optional");function Z0(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}M(Z0,"defineDecisionState");function Sv(t,e,r,n,...i){const s=Aa(t,e,n,{type:slr,start:r});r.end=s;for(const o of i)o!==void 0?(qs(r,o.left),qs(o.right,s)):qs(r,s);const a={left:r,right:s};return t.decisionMap[$y(e,dVe(n),n.idx)]=r,a}M(Sv,"makeAlts");function dVe(t){if(t instanceof bc)return"Alternation";if(t instanceof Eo)return"Option";if(t instanceof Os)return"Repetition";if(t instanceof vc)return"RepetitionWithSeparator";if(t instanceof Xc)return"RepetitionMandatory";if(t instanceof Kc)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}M(dVe,"getProdType");function fVe(t,e){const r=e.length;for(let s=0;se.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},M(v4,"ATNConfigSet"),v4);function Tre(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}M(Tre,"getATNConfigKey");function yVe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Cre(o,e-1,r,n,i):qFe(i,o):n||(i[i.length]=o)}return i}M(Cre,"baseFlatten");var wVe=Cre;function TVe(t,e){return wVe(Gf(t,e),1)}M(TVe,"flatMap");var flr=TVe;function CVe(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s-1}M(AVe,"arrayIncludes");var vlr=AVe;function MVe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=klr){var u=e?null:Clr(t);if(u)return lre(u);a=!1,i=BFe,l=new OFe}else l=e?[]:o;e:for(;++n{const i=n.toString();let s=r[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},r[i]=s),s}}M(zVe,"createDFACache");var b4,VVe=(b4=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=nVe(e.rules),this.dfas=HVe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,l=$y(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Gf(uY({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Gf(f,p=>p[0]));if(SY(d,!1)&&!s){const f=mme(d,(p,g,m)=>(qz(g,y=>{y&&(p[y.tokenTypeIdx]=m,qz(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new VVe,g=f===void 0?0:f.length;for(let y=0;yGf(f,p=>p[0]));if(SY(d)&&d[0][0]&&!s){const f=d[0],p=Alr(f);if(p.length===1&&Dlr(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=mme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,qz(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=ER.call(this,a,h,yme,o);return typeof f=="object"?!1:f===0}}},M(x4,"LLStarLookaheadStrategy"),x4);function SY(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const s of n){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}M(SY,"isLL1Sequence");function HVe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nty(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${YVe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=jr(r,"skipValidations")?r.skipValidations:N0.skipValidations}},M(ay,"Parser"),ay);ure.DEFER_DEFINITION_ERRORS_HANDLING=!1;QBe(ure,[Sir,Air,_ir,Lir,Nir,Iir,Dir,Oir,$ir,Bir]);var g4,Fir=(g4=class extends ure{constructor(e,r=N0){const n=Ao(r);n.outputCst=!1,super(e,n)}},M(g4,"EmbeddedActionsParser"),g4);function JBe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}M(oFe,"listCacheHas");var qir=oFe;function lFe(t,e){var r=this.__data__,n=eP(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(lFe,"listCacheSet");var Uir=lFe;function Tv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Qsr?new VFe:void 0;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Dar}M(uze,"isLength");var fre=uze,Oar="[object Arguments]",Par="[object Array]",$ar="[object Boolean]",Bar="[object Date]",Far="[object Error]",zar="[object Function]",Var="[object Map]",Har="[object Number]",Gar="[object Object]",War="[object RegExp]",qar="[object Set]",Uar="[object String]",Yar="[object WeakMap]",jar="[object ArrayBuffer]",Xar="[object DataView]",Kar="[object Float32Array]",Zar="[object Float64Array]",Qar="[object Int8Array]",Jar="[object Int16Array]",eor="[object Int32Array]",tor="[object Uint8Array]",ror="[object Uint8ClampedArray]",nor="[object Uint16Array]",ior="[object Uint32Array]",ji={};ji[Kar]=ji[Zar]=ji[Qar]=ji[Jar]=ji[eor]=ji[tor]=ji[ror]=ji[nor]=ji[ior]=!0;ji[Oar]=ji[Par]=ji[jar]=ji[$ar]=ji[Xar]=ji[Bar]=ji[Far]=ji[zar]=ji[Var]=ji[Har]=ji[Gar]=ji[War]=ji[qar]=ji[Uar]=ji[Yar]=!1;function hze(t){return F5(t)&&fre(t.length)&&!!ji[$3(t)]}M(hze,"baseIsTypedArray");var sor=hze;function dze(t){return function(e){return t(e)}}M(dze,"baseUnary");var aor=dze,fze=typeof exports=="object"&&exports&&!exports.nodeType&&exports,SS=fze&&typeof module=="object"&&module&&!module.nodeType&&module,oor=SS&&SS.exports===fze,jz=oor&&fFe.process,lor=(function(){try{var t=SS&&SS.require&&SS.require("util").types;return t||jz&&jz.binding&&jz.binding("util")}catch{}})(),lme=lor,cme=lme&&lme.isTypedArray,cor=cme?aor(cme):sor,pre=cor,uor=Object.prototype,hor=uor.hasOwnProperty;function pze(t,e){var r=Ol(t),n=!r&&iP(t),i=!r&&!n&&SI(t),s=!r&&!n&&!i&&pre(t),a=r||n||i||s,o=a?Car(t.length,String):[],l=o.length;for(var u in t)(e||hor.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||cze(u,l)))&&o.push(u);return o}M(pze,"arrayLikeKeys");var dor=pze,por=Object.prototype;function gze(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||por;return t===r}M(gze,"isPrototype");var mze=gze;function yze(t,e){return function(r){return t(e(r))}}M(yze,"overArg");var gor=yze,mor=gor(Object.keys,Object),yor=mor,vor=Object.prototype,bor=vor.hasOwnProperty;function vze(t){if(!mze(t))return yor(t);var e=[];for(var r in Object(t))bor.call(t,r)&&r!="constructor"&&e.push(r);return e}M(vze,"baseKeys");var bze=vze;function xze(t){return t!=null&&fre(t.length)&&!xFe(t)}M(xze,"isArrayLike");var sP=xze;function wze(t){return sP(t)?dor(t):bze(t)}M(wze,"keys");var gre=wze;function Tze(t){return mar(t,gre,Tar)}M(Tze,"getAllKeys");var ume=Tze,xor=1,wor=Object.prototype,Tor=wor.hasOwnProperty;function Cze(t,e,r,n,i,s){var a=r&xor,o=ume(t),l=o.length,u=ume(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Tor.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++dCre(t,e,a));return Av(t,e,n,r,...i)}M(gVe,"alternation");function mVe(t,e,r){const n=Aa(t,e,r,{type:$g});tp(t,n);const i=Av(t,e,n,r,pm(t,e,r));return yVe(t,e,r,i)}M(mVe,"option");function pm(t,e,r){const n=blr(Yf(r.definition,i=>Cre(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:bVe(t,n)}M(pm,"block");function kre(t,e,r,n,i){const s=n.left,a=n.right,o=Aa(t,e,r,{type:klr});tp(t,o);const l=Aa(t,e,r,{type:oVe});return s.loopback=o,l.loopback=o,t.decisionMap[Fy(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,qs(a,o),i===void 0?(qs(o,s),qs(o,l)):(qs(o,l),qs(o,i.left),qs(i.right,s)),{left:s,right:l}}M(kre,"plus");function Sre(t,e,r,n,i){const s=n.left,a=n.right,o=Aa(t,e,r,{type:Clr});tp(t,o);const l=Aa(t,e,r,{type:oVe}),u=Aa(t,e,r,{type:Tlr});return o.loopback=u,l.loopback=u,qs(o,s),qs(o,l),qs(a,u),i!==void 0?(qs(u,l),qs(u,i.left),qs(i.right,s)):qs(u,o),t.decisionMap[Fy(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}M(Sre,"star");function yVe(t,e,r,n){const i=n.left,s=n.right;return qs(i,s),t.decisionMap[Fy(e,"Option",r.idx)]=i,n}M(yVe,"optional");function tp(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}M(tp,"defineDecisionState");function Av(t,e,r,n,...i){const s=Aa(t,e,n,{type:wlr,start:r});r.end=s;for(const o of i)o!==void 0?(qs(r,o.left),qs(o.right,s)):qs(r,s);const a={left:r,right:s};return t.decisionMap[Fy(e,vVe(n),n.idx)]=r,a}M(Av,"makeAlts");function vVe(t){if(t instanceof Tc)return"Alternation";if(t instanceof Eo)return"Option";if(t instanceof Os)return"Repetition";if(t instanceof wc)return"RepetitionWithSeparator";if(t instanceof Qc)return"RepetitionMandatory";if(t instanceof Jc)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}M(vVe,"getProdType");function bVe(t,e){const r=e.length;for(let s=0;se.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},M(x4,"ATNConfigSet"),x4);function Ere(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}M(Ere,"getATNConfigKey");function CVe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Are(o,e-1,r,n,i):ZFe(i,o):n||(i[i.length]=o)}return i}M(Are,"baseFlatten");var AVe=Are;function MVe(t,e){return AVe(Yf(t,e),1)}M(MVe,"flatMap");var Rlr=MVe;function RVe(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s-1}M(NVe,"arrayIncludes");var Dlr=NVe;function DVe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=zlr){var u=e?null:Flr(t);if(u)return dre(u);a=!1,i=WFe,l=new VFe}else l=e?[]:o;e:for(;++n{const i=n.toString();let s=r[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},r[i]=s),s}}M(UVe,"createDFACache");var w4,YVe=(w4=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=cVe(e.rules),this.dfas=jVe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,l=Fy(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Yf(pY({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Yf(f,p=>p[0]));if(RY(d,!1)&&!s){const f=Tme(d,(p,g,m)=>(Xz(g,y=>{y&&(p[y.tokenTypeIdx]=m,Xz(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new YVe,g=f===void 0?0:f.length;for(let y=0;yYf(f,p=>p[0]));if(RY(d)&&d[0][0]&&!s){const f=d[0],p=Glr(f);if(p.length===1&&Klr(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Tme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,Xz(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=_R.call(this,a,h,Cme,o);return typeof f=="object"?!1:f===0}}},M(T4,"LLStarLookaheadStrategy"),T4);function RY(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const s of n){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}M(RY,"isLL1Sequence");function jVe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nny(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${JVe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}M(UVe,"buildAmbiguityError");function YVe(t){if(t instanceof Ll)return"SUBRULE";if(t instanceof Eo)return"OPTION";if(t instanceof bc)return"OR";if(t instanceof Xc)return"AT_LEAST_ONE";if(t instanceof Kc)return"AT_LEAST_ONE_SEP";if(t instanceof vc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(YVe,"getProductionDslName");function jVe(t,e,r){const n=flr(e.configs.elements,s=>s.state.transitions),i=Elr(n.filter(s=>s instanceof yre).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}M(jVe,"buildAdaptivePredictError");function XVe(t,e){return t.edges[e.tokenTypeIdx]}M(XVe,"getExistingTargetState");function KVe(t,e,r){const n=new kY,i=[];for(const a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===Y7){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l0&&!tHe(s))for(const a of i)s.add(a);return s}M(KVe,"computeReachSet");function ZVe(t,e){if(t instanceof yre&&Zte(e,t.tokenType))return t.target}M(ZVe,"getReachableTarget");function QVe(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}M(QVe,"getUniqueAlt");function kre(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}M(kre,"newDFAState");function EY(t,e,r,n){return n=Sre(t,n),e.edges[r.tokenTypeIdx]=n,n}M(EY,"addDFAEdge");function Sre(t,e){if(e===CI)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}M(Sre,"addDFAState");function JVe(t){const e=new kY,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};hE(a,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}M(sHe,"hasConflictingAltSet");function aHe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}M(aHe,"hasStateAssociatedWithOneAlt");A7();var w4,oHe=(w4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Are(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new uP;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new kI(e.startOffset,e.image.length,Q6(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 s of e){const a=new kI(s.startOffset,s.image.length,Q6(s),s.tokenType,!0);a.root=this.rootNode,r.push(a)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const s=n.container.content.indexOf(n);if(s>0){n.container.content.splice(s,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},M(w4,"CstNodeBuilder"),w4),T4,Ere=(T4=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},M(T4,"AbstractCstNode"),T4),C4,kI=(C4=class extends Ere{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},M(C4,"LeafCstNodeImpl"),C4),k4,uP=(k4=class extends Ere{constructor(){super(...arguments),this.content=new Blr(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},M(k4,"CompositeCstNodeImpl"),k4),sy,Blr=(sy=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,sy.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},M(sy,"CstNodeContainer"),sy),S4,Are=(S4=class extends uP{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},M(S4,"RootCstNodeImpl"),S4),SI=Symbol("Datatype");function AR(t){return t.$type===SI}M(AR,"isDataTypeNode");var vme="​",lHe=M(t=>t.endsWith(vme)?t:t+vme,"withRuleSuffix"),E4,Mre=(E4=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new zlr(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new dHe(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},M(E4,"AbstractLangiumParser"),E4),A4,cHe=(A4=class extends Mre{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new oHe,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;L5(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(lHe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,s),_l(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===SI?a.value="":r!==void 0&&(a.$infixName=r)}return n(i),s?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=C0(n)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,h,a,l)}else if(AR(u)){let h=i.image;C0(n)||(h=this.converter.convert(h,a).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,s){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,s)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:s}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,s);else if(!i){const a=this.current;if(AR(a))a.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const s={$type:e};this.stack.push(s),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):AR(e)?this.converter.convert(e.value,e.$cstNode):(Eee(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let s=0,a=-1;for(let m=0;ma?(a=v.precedence,s=m):v.precedence===a&&(v.rightAssoc||(s=m))}const o=i.slice(0,s),l=i.slice(s+1),u=n.slice(0,s+1),h=n.slice(s+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[s],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=lv(e,T0);this.assignmentMap.set(e,{assignment:r,crossRef:r&&uv(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,s){const a=this.current;let o;switch(s==="single"&&typeof n=="string"?o=this.linker.buildReference(a,r,i,n):s==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(a,r,i,n):o=n,e){case"=":{a[r]=o;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(o)}}assignWithoutOverride(e,r){for(const[i,s]of Object.entries(r)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},M(A4,"LangiumParser"),A4),M4,uHe=(M4=class{buildMismatchTokenMessage(e){return db.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return db.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return db.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return db.buildEarlyExitMessage(e)}},M(M4,"AbstractParserErrorMessageProvider"),M4),R4,Rre=(R4=class extends uHe{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},M(R4,"LangiumParserErrorMessageProvider"),R4),_4,hHe=(_4=class extends Mre{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(lHe(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,s){this.before(i),this.wrapper.wrapSubrule(e,r,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},M(_4,"LangiumCompletionParser"),_4),Flr={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Rre},L4,dHe=(L4=class extends Cir{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Flr,lookaheadStrategy:n?new ire({maxLookahead:r.maxLookahead}):new $lr({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},M(L4,"ChevrotainWrapper"),L4),I4,zlr=(I4=class extends dHe{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},M(I4,"ProfilerWrapper"),I4);function hP(t,e,r){return fHe({parser:e,tokens:r,ruleNames:new Map},t),e}M(hP,"createParser");function fHe(t,e){const r=EO(e,!1),n=yi(e.rules).filter(_l).filter(s=>r.has(s));for(const s of n){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,Og(a,s.definition))}const i=yi(e.rules).filter(L5).filter(s=>r.has(s));for(const s of i)t.parser.rule(s,pHe(t,s))}M(fHe,"buildRules");function pHe(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Ou(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const l={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...s,$container:a};a.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:M(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=dP(t,r)),t.parser.subrule(0,f,!1,s,p),t.parser.many(0,{DEF:M(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}M(pHe,"buildInfixRule");function Og(t,e,r=!1){let n;if(C0(e))n=wHe(t,e);else if(Lg(e))n=gHe(t,e);else if(T0(e))n=Og(t,e.terminal);else if(uv(e))n=_re(t,e);else if(k0(e))n=mHe(t,e);else if(yO(e))n=vHe(t,e);else if(wO(e))n=bHe(t,e);else if(hv(e))n=xHe(t,e);else if(Nee(e)){const i=t.consume++;n=M(()=>t.parser.consume(i,Ng,e),"method")}else throw new CO(e.$cstNode,`Unexpected element type: ${e.$type}`);return Lre(t,r?void 0:dE(e),n,e.cardinality)}M(Og,"buildElement");function gHe(t,e){const r=Dy(e);return()=>t.parser.action(r,e)}M(gHe,"buildAction");function mHe(t,e){const r=e.rule.ref;if(cv(r)){const n=t.subrule++,i=_l(r)&&r.fragment,s=e.arguments.length>0?yHe(r,e.arguments):()=>({});let a;return o=>{a??(a=dP(t,r)),t.parser.subrule(n,a,i,e,s(o))}}else if(Ou(r)){const n=t.consume++,i=EI(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)lm();else throw new CO(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}M(mHe,"buildRuleCall");function yHe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var s,a;return{parameterName:(a=(s=i.parameter)==null?void 0:s.ref)==null?void 0:a.name,predicate:sh(i.value)}});return i=>{const s={};for(const{parameterName:a,predicate:o}of n)a&&(s[a]=o(i));return s}}else{const n=e.map(i=>sh(i.value));return i=>{const s={};for(let a=0;ae(n)||r(n)}else if(Lee(t)){const e=sh(t.left),r=sh(t.right);return n=>e(n)&&r(n)}else if(Pee(t)){const e=sh(t.value);return r=>!e(r)}else if($ee(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Ree(t)){const e=!!t.true;return()=>e}lm()}M(sh,"buildPredicate");function vHe(t,e){if(e.elements.length===1)return Og(t,e.elements[0]);{const r=[];for(const i of e.elements){const s={ALT:Og(t,i,!0)},a=dE(i);a&&(s.GATE=sh(a)),r.push(s)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(s=>{const a={ALT:M(()=>s.ALT(i),"ALT")},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}M(vHe,"buildAlternatives");function bHe(t,e){if(e.elements.length===1)return Og(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Og(t,o,!0)},u=dE(o);u&&(l.GATE=sh(u)),r.push(l)}const n=t.or++,i=M((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),s=M(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:M(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),a=Lre(t,dE(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}M(bHe,"buildUnorderedGroup");function xHe(t,e){const r=e.elements.map(n=>Og(t,n));return n=>r.forEach(i=>i(n))}M(xHe,"buildGroup");function dE(t){if(hv(t))return t.guardCondition}M(dE,"getGuardCondition");function _re(t,e,r=e.terminal){if(r)if(k0(r)&&_l(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let s;return a=>{s??(s=dP(t,n)),t.parser.subrule(i,s,!1,e,a)}}else if(k0(r)&&Ou(r.rule.ref)){const n=t.consume++,i=EI(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(C0(r)){const n=t.consume++,i=EI(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=_O(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Dy(e.type.ref));return _re(t,e,i)}}M(_re,"buildCrossReference");function wHe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}M(wHe,"buildKeyword");function Lre(t,e,r,n){const i=e&&sh(e);if(!n)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:M(()=>r(a),"ALT"),GATE:M(()=>i(a),"GATE")},{ALT:bY(),GATE:M(()=>!i(a),"GATE")}])}else return r;if(n==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:M(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else if(n==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:M(()=>t.parser.atLeastOne(s,{DEF:M(()=>r(o),"DEF")}),"ALT"),GATE:M(()=>i(o),"GATE")},{ALT:bY(),GATE:M(()=>!i(o),"GATE")}])}else return a=>t.parser.atLeastOne(s,{DEF:M(()=>r(a),"DEF")})}else if(n==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:M(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else lm()}M(Lre,"wrap");function dP(t,e){const r=THe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}M(dP,"getRule");function THe(t,e){if(cv(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!_l(n);)(hv(n)||yO(n)||wO(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}M(THe,"getRuleName");function EI(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}M(EI,"getToken");function Ire(t){const e=t.Grammar,r=t.parser.Lexer,n=new hHe(t);return hP(e,n,r.definition),n.finalize(),n}M(Ire,"createCompletionParser");function Nre(t){const e=Dre(t);return e.finalize(),e}M(Nre,"createLangiumParser");function Dre(t){const e=t.Grammar,r=t.parser.Lexer,n=new cHe(t);return hP(e,n,r.definition)}M(Dre,"prepareLangiumParser");var N4,fP=(N4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=yi(EO(e,!1)),i=this.buildTerminalTokens(n),s=this.buildKeywordTokens(n,i,r);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Ou).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=N7(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=SO(r)?Sl.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(cv).flatMap(i=>j0(i).filter(C0)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,r){return r?new RegExp(M3(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&ste("^"+s.source+"$",e.value)&&n.push(i),n},[])}},M(N4,"DefaultTokenBuilder"),N4),D4,Ore=(D4=class{convert(e,r){let n=r.grammarSource;if(uv(n)&&(n=ute(n)),k0(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return id.convertInt(r);case"STRING":return id.convertString(r);case"ID":return id.convertID(r)}switch((i=bte(e))==null?void 0:i.toLowerCase()){case"number":return id.convertNumber(r);case"boolean":return id.convertBoolean(r);case"bigint":return id.convertBigint(r);case"date":return id.convertDate(r);default:return r}}},M(D4,"DefaultValueConverter"),D4),id;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}M(pP,"delayNextTick");var MR=0,CHe=10;function gP(){return MR=performance.now(),new $i.CancellationTokenSource}M(gP,"startCancelableOperation");function Pre(t){CHe=t}M(Pre,"setInterruptionPeriod");var yd=Symbol("OperationCancelled");function Ev(t){return t===yd}M(Ev,"isOperationCancelled");async function za(t){if(t===$i.CancellationToken.None)return;const e=performance.now();if(e-MR>=CHe&&(MR=e,await pP(),MR=performance.now()),t.isCancellationRequested)throw yd}M(za,"interruptAndCheck");var O4,R0=(O4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},M(O4,"Deferred"),O4),ig,bme=(ig=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(ig.isIncremental(n)){const i=Bre(n.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=AY(n.text,!1,s);if(l-o===h.length)for(let f=0,p=h.length;fe?i=a:n=a+1}const s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&$re(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}},M(ig,"FullTextDocument"),ig),AI;(function(t){function e(i,s,a,o){return new bme(i,s,a,o)}M(e,"create"),t.create=e;function r(i,s,a){if(i instanceof bme)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}M(r,"update"),t.update=r;function n(i,s){const a=i.getText(),o=MI(s.map(kHe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(a.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(a.substr(l)),u.join("")}M(n,"applyEdits"),t.applyEdits=n})(AI||(AI={}));function MI(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);MI(n,e),MI(i,e);let s=0,a=0,o=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}M(Bre,"getWellformedRange");function kHe(t){const e=Bre(t.range);return e!==t.range?{newText:t.newText,range:e}:t}M(kHe,"getWellformedEdit");var SHe;(()=>{var t={975:N=>{function L(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}M(L,"e");function I(O,D){for(var F,z="",V=0,B=-1,H=0,G=0;G<=O.length;++G){if(G2){var W=z.lastIndexOf("/");if(W!==z.length-1){W===-1?(z="",V=0):V=(z=z.slice(0,W)).length-1-z.lastIndexOf("/"),B=G,H=0;continue}}else if(z.length===2||z.length===1){z="",V=0,B=G,H=0;continue}}D&&(z.length>0?z+="/..":z="..",V=2)}else z.length>0?z+="/"+O.slice(B+1,G):z=O.slice(B+1,G),V=G-B-1;B=G,H=0}else F===46&&H!==-1?++H:H=-1}return z}M(I,"r");var $={resolve:M(function(){for(var O,D="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var V;z>=0?V=arguments[z]:(O===void 0&&(O=process.cwd()),V=O),L(V),V.length!==0&&(D=V+"/"+D,F=V.charCodeAt(0)===47)}return D=I(D,!F),F?D.length>0?"/"+D:"/":D.length>0?D:"."},"resolve"),normalize:M(function(O){if(L(O),O.length===0)return".";var D=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=I(O,!D)).length!==0||D||(O="."),O.length>0&&F&&(O+="/"),D?"/"+O:O},"normalize"),isAbsolute:M(function(O){return L(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:M(function(){if(arguments.length===0)return".";for(var O,D=0;D0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":$.normalize(O)},"join"),relative:M(function(O,D){if(L(O),L(D),O===D||(O=$.resolve(O))===(D=$.resolve(D)))return"";for(var F=1;FG){if(D.charCodeAt(B+K)===47)return D.slice(B+K+1);if(K===0)return D.slice(B+K)}else V>G&&(O.charCodeAt(F+K)===47?W=K:K===0&&(W=0));break}var q=O.charCodeAt(F+K);if(q!==D.charCodeAt(B+K))break;q===47&&(W=K)}var oe="";for(K=F+W+1;K<=z;++K)K!==z&&O.charCodeAt(K)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+D.slice(B+W):(B+=W,D.charCodeAt(B)===47&&++B,D.slice(B))},"relative"),_makeLong:M(function(O){return O},"_makeLong"),dirname:M(function(O){if(L(O),O.length===0)return".";for(var D=O.charCodeAt(0),F=D===47,z=-1,V=!0,B=O.length-1;B>=1;--B)if((D=O.charCodeAt(B))===47){if(!V){z=B;break}}else V=!1;return z===-1?F?"/":".":F&&z===1?"//":O.slice(0,z)},"dirname"),basename:M(function(O,D){if(D!==void 0&&typeof D!="string")throw new TypeError('"ext" argument must be a string');L(O);var F,z=0,V=-1,B=!0;if(D!==void 0&&D.length>0&&D.length<=O.length){if(D.length===O.length&&D===O)return"";var H=D.length-1,G=-1;for(F=O.length-1;F>=0;--F){var W=O.charCodeAt(F);if(W===47){if(!B){z=F+1;break}}else G===-1&&(B=!1,G=F+1),H>=0&&(W===D.charCodeAt(H)?--H==-1&&(V=F):(H=-1,V=G))}return z===V?V=G:V===-1&&(V=O.length),O.slice(z,V)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!B){z=F+1;break}}else V===-1&&(B=!1,V=F+1);return V===-1?"":O.slice(z,V)},"basename"),extname:M(function(O){L(O);for(var D=-1,F=0,z=-1,V=!0,B=0,H=O.length-1;H>=0;--H){var G=O.charCodeAt(H);if(G!==47)z===-1&&(V=!1,z=H+1),G===46?D===-1?D=H:B!==1&&(B=1):D!==-1&&(B=-1);else if(!V){F=H+1;break}}return D===-1||z===-1||B===0||B===1&&D===z-1&&D===F+1?"":O.slice(D,z)},"extname"),format:M(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(D,F){var z=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+V:z+"/"+V:V})(0,O)},"format"),parse:M(function(O){L(O);var D={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return D;var F,z=O.charCodeAt(0),V=z===47;V?(D.root="/",F=1):F=0;for(var B=-1,H=0,G=-1,W=!0,K=O.length-1,q=0;K>=F;--K)if((z=O.charCodeAt(K))!==47)G===-1&&(W=!1,G=K+1),z===46?B===-1?B=K:q!==1&&(q=1):B!==-1&&(q=-1);else if(!W){H=K+1;break}return B===-1||G===-1||q===0||q===1&&B===G-1&&B===H+1?G!==-1&&(D.base=D.name=H===0&&V?O.slice(1,G):O.slice(H,G)):(H===0&&V?(D.name=O.slice(1,B),D.base=O.slice(1,G)):(D.name=O.slice(H,B),D.base=O.slice(H,G)),D.ext=O.slice(B,G)),H>0?D.dir=O.slice(0,H-1):V&&(D.dir="/"),D},"parse"),sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,N.exports=$}},e={};function r(N){var L=e[N];if(L!==void 0)return L.exports;var I=e[N]={exports:{}};return t[N](I,I.exports,r),I.exports}M(r,"r"),r.d=(N,L)=>{for(var I in L)r.o(L,I)&&!r.o(N,I)&&Object.defineProperty(N,I,{enumerable:!0,get:L[I]})},r.o=(N,L)=>Object.prototype.hasOwnProperty.call(N,L),r.r=N=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:M(()=>f,"URI"),Utils:M(()=>R,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l(N,L){if(!N.scheme&&L)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!s.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!a.test(N.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}M(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_=class _{constructor(L,I,$,O,D,F=!1){br(this,"scheme");br(this,"authority");br(this,"path");br(this,"query");br(this,"fragment");typeof L=="object"?(this.scheme=L.scheme||u,this.authority=L.authority||u,this.path=L.path||u,this.query=L.query||u,this.fragment=L.fragment||u):(this.scheme=(function(z,V){return z||V?z:"file"})(L,F),this.authority=I||u,this.path=(function(z,V){switch(z){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,$||u),this.query=O||u,this.fragment=D||u,l(this,F))}static isUri(L){return L instanceof _||!!L&&typeof L.authority=="string"&&typeof L.fragment=="string"&&typeof L.path=="string"&&typeof L.query=="string"&&typeof L.scheme=="string"&&typeof L.fsPath=="string"&&typeof L.with=="function"&&typeof L.toString=="function"}get fsPath(){return x(this,!1)}with(L){if(!L)return this;let{scheme:I,authority:$,path:O,query:D,fragment:F}=L;return I===void 0?I=this.scheme:I===null&&(I=u),$===void 0?$=this.authority:$===null&&($=u),O===void 0?O=this.path:O===null&&(O=u),D===void 0?D=this.query:D===null&&(D=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&$===this.authority&&O===this.path&&D===this.query&&F===this.fragment?this:new g(I,$,O,D,F)}static parse(L,I=!1){const $=d.exec(L);return $?new g($[2]||u,S($[4]||u),S($[5]||u),S($[7]||u),S($[9]||u),I):new g(u,u,u,u,u)}static file(L){let I=u;if(i&&(L=L.replace(/\\/g,h)),L[0]===h&&L[1]===h){const $=L.indexOf(h,2);$===-1?(I=L.substring(2),L=h):(I=L.substring(2,$),L=L.substring($)||h)}return new g("file",I,L,u,u)}static from(L){const I=new g(L.scheme,L.authority,L.path,L.query,L.fragment);return l(I,!0),I}toString(L=!1){return b(this,L)}toJSON(){return this}static revive(L){if(L){if(L instanceof _)return L;{const I=new g(L);return I._formatted=L.external,I._fsPath=L._sep===p?L.fsPath:null,I}}return L}};M(_,"l");let f=_;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);br(this,"_formatted",null);br(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(I=!1){return I?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}};M(P,"d");let g=P;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(N,L,I){let $,O=-1;for(let D=0;D=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||L&&F===47||I&&F===91||I&&F===93||I&&F===58)O!==-1&&($+=encodeURIComponent(N.substring(O,D)),O=-1),$!==void 0&&($+=N.charAt(D));else{$===void 0&&($=N.substr(0,D));const z=m[F];z!==void 0?(O!==-1&&($+=encodeURIComponent(N.substring(O,D)),O=-1),$+=z):O===-1&&(O=D)}}return O!==-1&&($+=encodeURIComponent(N.substring(O))),$!==void 0?$:N}M(y,"m");function v(N){let L;for(let I=0;I1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?L?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}M(x,"v");function b(N,L){const I=L?v:y;let $="",{scheme:O,authority:D,path:F,query:z,fragment:V}=N;if(O&&($+=O,$+=":"),(D||O==="file")&&($+=h,$+=h),D){let B=D.indexOf("@");if(B!==-1){const H=D.substr(0,B);D=D.substr(B+1),B=H.lastIndexOf(":"),B===-1?$+=I(H,!1,!1):($+=I(H.substr(0,B),!1,!1),$+=":",$+=I(H.substr(B+1),!1,!0)),$+="@"}D=D.toLowerCase(),B=D.lastIndexOf(":"),B===-1?$+=I(D,!1,!0):($+=I(D.substr(0,B),!1,!0),$+=D.substr(B))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const B=F.charCodeAt(1);B>=65&&B<=90&&(F=`/${String.fromCharCode(B+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const B=F.charCodeAt(0);B>=65&&B<=90&&(F=`${String.fromCharCode(B+32)}:${F.substr(2)}`)}$+=I(F,!0,!1)}return z&&($+="?",$+=I(z,!1,!1)),V&&($+="#",$+=L?V:y(V,!1,!1)),$}M(b,"b");function T(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+T(N.substr(3)):N}}M(T,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(N){return N.match(C)?N.replace(C,(L=>T(L))):N}M(S,"w");var k=r(975);const E=k.posix||k,A="/";var R;(function(N){N.joinPath=function(L,...I){return L.with({path:E.join(L.path,...I)})},N.resolvePath=function(L,...I){let $=L.path,O=!1;$[0]!==A&&($=A+$,O=!0);let D=E.resolve($,...I);return O&&D[0]===A&&!L.authority&&(D=D.substring(1)),L.with({path:D})},N.dirname=function(L){if(L.path.length===0||L.path===A)return L;let I=E.dirname(L.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),L.with({path:I})},N.basename=function(L){return E.basename(L.path)},N.extname=function(L){return E.extname(L.path)}})(R||(R={})),SHe=n})();var{URI:Fc,Utils:TC}=SHe,Tl;(function(t){t.basename=TC.basename,t.dirname=TC.dirname,t.extname=TC.extname,t.joinPath=TC.joinPath,t.resolvePath=TC.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(a,o){return(a==null?void 0:a.toString())===(o==null?void 0:o.toString())}M(r,"equals"),t.equals=r;function n(a,o){const l=typeof a=="string"?Fc.parse(a).path:a.path,u=typeof o=="string"?Fc.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:Tl.joinPath(Fc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Tl.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const s of n){let a=i.children.get(s);if(!a)if(r)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},M(P4,"UriTrie"),P4),Mn;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Mn||(Mn={}));var $4,EHe=($4=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=$i.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Fc.parse(e.uri),$i.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return $i.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let s;if(n)s={parseResult:e,uri:r,state:Mn.Parsed,references:[],textDocument:n};else{const a=this.createTextDocumentGetter(r,i);s={parseResult:e,uri:r,state:Mn.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,r){var a,o;const n=(a=e.parseResult.value.$cstNode)==null?void 0:a.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:l})}return n!==s&&(e.parseResult=await this.parseAsync(e.uri,s,r),e.parseResult.value.$document=e),e.state=Mn.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=AI.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},M($4,"DefaultLangiumDocumentFactory"),$4),B4,AHe=(B4=class{constructor(e){this.documentTrie=new Fre,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return yi(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Mn.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Mn.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Mn.Changed;return this.documentTrie.delete(r),n}},M(B4,"DefaultLangiumDocuments"),B4),e1=Symbol("RefResolving"),F4,MHe=(F4=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=$i.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const s of bh(e.parseResult.value))await za(r),_5(s).forEach(a=>{const o=`${s.$type}:${a.property}`;i.startSubTask(o);try{this.doLink(a,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of bh(e.parseResult.value))await za(r),_5(i).forEach(s=>this.doLink(s,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=e1;try{const i=this.getCandidate(e);if(h1(i))n._ref=i;else{n._nodeDescription=i;const s=this.loadAstNode(i);n._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const s=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${s}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=e1;try{const i=this.getCandidates(e),s=[];if(h1(i))n._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}n._items=s}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const s=this,a={$refNode:n,$refText:i,_ref:void 0,get ref(){if(aa(this._ref))return this._ref;if(Cee(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=e1;const o=zb(e).$document,l=s.getLinkedNode({reference:a,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:r})}};return a}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(h1(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=zb(e.container).$document;n&&n.stateuv(r)&&r.isMulti)}findDeclarations(e){if(e){const r=pte(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(wl(i)||Sd(i))return UL(i);if(Array.isArray(i)){for(const s of i)if((wl(s)||Sd(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return UL(s)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Yee(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of _5(n))if(Sd(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&n.push(s)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(s=>Tl.equals(s.sourceUri,r.documentUri))),n.push(...i),yi(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const s=this.nameProvider.getNameNode(i);if(s){const a=vh(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:N5(s),local:!0})}}return n}},M(V4,"DefaultReferences"),V4),H4,_0=(H4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Z6.sum(yi(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?yi(r):A5}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return yi(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return yi(this.map.keys())}values(){return yi(this.map.values()).flat()}entriesGroupedByKey(){return yi(this.map.entries())}},M(H4,"MultiMap"),H4),G4,RI=(G4=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},M(G4,"BiMap"),G4),W4,LHe=(W4=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=$i.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=R7,i=$i.CancellationToken.None){const s=[];this.addExportedSymbol(e,s,r);for(const a of n(e))await za(i),this.addExportedSymbol(a,s,r);return s}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=$i.CancellationToken.None){const n=e.parseResult.value,i=new _0;for(const s of j0(n))await za(r),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&n.add(i,this.descriptions.createDescription(e,s,r))}}},M(W4,"DefaultScopeComputation"),W4),q4,MY=(q4=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},M(q4,"StreamScope"),q4),U4,Vlr=(U4=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(s,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?yi(i).concat(this.outerScope.getElements(e)):yi(i)}getAllElements(){let e=yi(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},M(U4,"MapScope"),U4),Y4,IHe=(Y4=class{constructor(e,r,n){this.elements=new _0,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?yi(n).concat(this.outerScope.getElements(e)):yi(n)}getAllElements(){let e=yi(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},M(Y4,"MultiMapScope"),Y4),Hlr={getElement(){},getElements(){return A5},getAllElements(){return A5}},j4,mP=(j4=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},M(j4,"DisposableCache"),j4),X4,Vre=(X4=class extends mP{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},M(X4,"SimpleCache"),X4),K4,yP=(K4=class extends mP{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const s=n();return i.set(r,s),s}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},M(K4,"ContextCache"),K4),Z4,NHe=(Z4=class extends yP{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const s=n.concat(i);for(const a of s)this.clear(a)}))}},M(Z4,"DocumentCache"),Z4),Q4,Hre=(Q4=class extends Vre{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},M(Q4,"WorkspaceCache"),Q4),J4,DHe=(J4=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Hre(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=vh(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&r.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,n))),a=a.$container;while(a)}let s=this.getGlobalScope(n,e);for(let a=r.length-1;a>=0;a--)s=this.createScope(r[a],s);return s}createScope(e,r,n){return new MY(yi(e),r,n)}createScopeForNodes(e,r,n){const i=yi(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new MY(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new IHe(this.indexManager.allElements(e)))}},M(J4,"DefaultScopeProvider"),J4);function Gre(t){return typeof t.$comment=="string"}M(Gre,"isAstNodeWithComment");function RY(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}M(RY,"isIntermediateReference");var ew,OHe=(ew=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,s=M((o,l)=>this.replacer(o,l,n),"defaultReplacer"),a=i?(o,l)=>i(o,l,s):s;try{return this.currentDocument=vh(e),JSON.stringify(e,a,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(wl(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=vh(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Sd(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=vh(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(aa(r)){let d;if(s&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),a){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=M(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=dte(e.$cstNode,s).map(r);a.length!==0&&(i[s]=a)}),e}}linkNode(e,r,n,i,s,a){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,s),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(s){if(Ev(s))throw s;console.error(`${r}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);n("error",`${r}: ${a}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=yi(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,s,a,o)=>{await this.handleException(()=>e.call(n,i,s,a,o),r,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},M(rw,"ValidationRegistry"),rw),BHe=Object.freeze({validateNode:!0,validateChildren:!0}),nw,FHe=(nw=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=$i.CancellationToken.None){const i=e.parseResult,s=[];if(await za(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,s,r),r.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===pu.LexingError})||(this.processParsingErrors(i,s,r),r.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===pu.ParsingError}))||(this.processLinkingErrors(e,s,r),r.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===pu.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,r,n))}catch(a){if(Ev(a))throw a;console.error("An error occurred during validation:",a)}return await za(n),s}processLexingErrors(e,r,n){var s;const i=[...e.lexerErrors,...((s=e.lexerReport)==null?void 0:s.diagnostics)??[]];for(const a of i){const o=a.severity??"error",l={severity:CS(o),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:qre(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=Q6(i.token);if(s){const a={severity:CS("error"),range:s,message:i.message,data:V1(pu.ParsingError),source:this.getSource()};r.push(a)}}}processLinkingErrors(e,r,n){var i;for(const s of e.references){const a=s.error;if(a){const o={node:a.info.container,range:(i=s.$refNode)==null?void 0:i.range,property:a.info.property,index:a.info.index,data:{code:pu.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};r.push(this.toDiagnostic("error",a.message,o))}}}async validateAst(e,r,n=$i.CancellationToken.None){const i=[],s=M((a,o,l)=>{i.push(this.toDiagnostic(a,o,l))},"acceptor");return await this.validateAstBefore(e,r,s,n),await this.validateAstNodes(e,r,s,n),await this.validateAstAfter(e,r,s,n),i}async validateAstBefore(e,r,n,i=$i.CancellationToken.None){const s=this.validationRegistry.checksBefore;for(const a of s)await za(i),await a(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=$i.CancellationToken.None){var s;if((s=this.profiler)!=null&&s.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const o=bh(e).iterator();for(const l of o){a.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{a.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{a.stop()}}else{const a=bh(e).iterator();for(const o of a){await za(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||a.prune()}}}validateSingleNodeOptions(e,r){return BHe}async validateAstAfter(e,r,n,i=$i.CancellationToken.None){const s=this.validationRegistry.checksAfter;for(const a of s)await za(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Wre(n),severity:CS(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},M(nw,"DefaultDocumentValidator"),nw);function Wre(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=AO(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=fte(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}M(Wre,"getDiagnosticRange");function CS(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}M(CS,"toDiagnosticSeverity");function qre(t){switch(t){case"error":return V1(pu.LexingError);case"warning":return V1(pu.LexingWarning);case"info":return V1(pu.LexingInfo);case"hint":return V1(pu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}M(qre,"toDiagnosticData");var pu;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(pu||(pu={}));var iw,zHe=(iw=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??vh(e);r??(r=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${s} has no name.`);let a;const o=M(()=>a??(a=N5(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:N5(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},M(iw,"DefaultAstNodeDescriptionProvider"),iw),sw,VHe=(sw=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=$i.CancellationToken.None){const n=[],i=e.parseResult.value;for(const s of bh(i))await za(r),_5(s).forEach(a=>{a.reference.error||n.push(...this.createInfoDescriptions(a))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];wl(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Sd(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=vh(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=N5(r.$refNode);for(const l of n)a.push({sourceUri:i,sourcePath:s,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Tl.equals(l.documentUri,i)});return a}},M(sw,"DefaultReferenceDescriptionProvider"),sw),aw,HHe=(aw=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),l=parseInt(s.substring(a+1)),u=i[o];return u==null?void 0:u[l]}return i[s]},e)}},M(aw,"DefaultAstNodeLocator"),aw),vP={};dO(vP,bee(E3()));var ow,GHe=(ow=class{constructor(e){this._ready=new R0,this.onConfigurationSectionUpdateEmitter=new vP.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,s)=>{this.updateSectionConfiguration(i.section,n[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},M(ow,"DefaultConfigurationProvider"),ow),H8=bee(xZt()),ry;(function(t){function e(r){return{dispose:M(async()=>await r(),"dispose")}}M(e,"create"),t.create=e})(ry||(ry={}));var lw,WHe=(lw=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new _0,this.documentPhaseListeners=new _0,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Mn.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=$i.CancellationToken.None){var i;for(const s of e){const a=s.uri.toString();if(s.state===Mn.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(s,Mn.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(s,r);o.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(a))==null?void 0:i.result}),s.state=Mn.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=Mn.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=$i.CancellationToken.None){this.currentState=Mn.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const s=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of s){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Mn.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Mn.Changed)}const a=yi(s).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!a.has(l.uri.toString())&&this.shouldRelink(l,a)).forEach(l=>this.resetToState(l,Mn.ComputedScopes)),await this.emitUpdate(s,i),await za(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,a=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return yi(a).filter(u=>!s.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),ry.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Mn.Changed:case Mn.Parsed:this.indexManager.removeContent(e.uri);case Mn.IndexedContent:e.localSymbols=void 0;case Mn.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Mn.Linked:this.indexManager.removeReferences(e.uri);case Mn.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Mn.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Mn.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Mn.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,Mn.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,Mn.ComputedScopes,n,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,n)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,Mn.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(i,Mn.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,Mn.Validated,n,async a=>{await this.validate(a,n),this.markAsCompleted(a)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:r,result:s==null?void 0:s.result})}}async runCancelable(e,r,n,i){for(const a of e)a.statea.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),ry.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),ry.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=$i.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(yd);if(this.currentState>=e&&e>i.state)return Promise.reject(new H8.ResponseError(H8.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Mn[i.state]}, requiring ${Mn[e]}, but workspace state is already ${Mn[this.currentState]}. Returning undefined.`))}else return Promise.reject(new H8.ResponseError(H8.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,u=>{Tl.equals(u.uri,r)&&(o.dispose(),l.dispose(),s(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),a(yd)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(yd):new Promise((n,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),n()}),a=r.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(yd)})})}async notifyDocumentPhase(e,r,n){const s=this.documentPhaseListeners.get(r).slice();for(const a of s)try{await za(n),await a(e,n)}catch(o){if(!Ev(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const s=this.buildPhaseListeners.get(r).slice();for(const a of s)await za(n),await a(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await n.validateDocument(e,s,r);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=yi(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},M(lw,"DefaultDocumentBuilder"),lw),cw,qHe=(cw=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new yP,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=vh(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{Tl.equals(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),yi(i)}allElements(e,r){let n=yi(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=$i.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,r=$i.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},M(cw,"DefaultIndexManager"),cw),uw,UHe=(uw=class{constructor(e){this.initialBuildOptions={},this._ready=new R0,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=$i.CancellationToken.None){const n=await this.performStartup(e);await za(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=M(a=>{r.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=yi(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Fc.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Tl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},M(uw,"DefaultWorkspaceManager"),uw),hw,YHe=(hw=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return cY.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return cY.buildUnableToPopLexerModeMessage(e)}},M(hw,"DefaultLexerErrorMessageProvider"),hw),Ure={mode:"full"},dw,Yre=(dw=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=LI(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Sl(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Ure){var i,s;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(s=(i=this.tokenBuilder).flushLexingReport)==null?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(LI(e))return e;const r=xP(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},M(dw,"DefaultLexer"),dw);function bP(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}M(bP,"isTokenTypeArray");function xP(t){return t&&"modes"in t&&"defaultMode"in t}M(xP,"isIMultiModeLexerDefinition");function LI(t){return!bP(t)&&!xP(t)}M(LI,"isTokenTypeDictionary");A7();function jre(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ai.create(0,0));const s=Kre(t),a=wP(n),o=jHe({lines:s,position:i,options:a});return ZHe({index:0,tokens:o,position:i})}M(jre,"parseJSDoc");function Xre(t,e){const r=wP(e),n=Kre(t);if(n.length===0)return!1;const i=n[0],s=n[n.length-1],a=r.start,o=r.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}M(Xre,"isJSDoc");function Kre(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(QIe)}M(Kre,"getLines");var xme=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Glr=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function jHe(t){var i,s,a;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=ai.create(r,n);e.push({type:"break",content:"",range:$n.create(p,p)})}}else{xme.lastIndex=d;const p=xme.exec(h);if(p){const g=p[0],m=p[1],y=ai.create(r,n+d),v=ai.create(r,n+d+g.length);e.push({type:"tag",content:m,range:$n.create(y,v)}),d+=g.length,d=II(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}M(jHe,"tokenize");function XHe(t,e,r,n){const i=[];if(t.length===0){const s=ai.create(r,n),a=ai.create(r,n+e.length);i.push({type:"text",content:e,range:$n.create(s,a)})}else{let s=0;for(const o of t){const l=o.index,u=e.substring(s,l);u.length>0&&i.push({type:"text",content:e.substring(s,l),range:$n.create(ai.create(r,s+n),ai.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:$n.create(ai.create(r,s+h+n),ai.create(r,s+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:$n.create(ai.create(r,s+h+n),ai.create(r,s+h+f.length+n))})}else i.push({type:"text",content:"",range:$n.create(ai.create(r,s+h+n),ai.create(r,s+h+n))});s=l+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:$n.create(ai.create(r,s+n),ai.create(r,s+n+a.length))})}return i}M(XHe,"buildInlineTokens");var Wlr=/\S/,qlr=/\s*$/;function II(t,e){const r=t.substring(e).match(Wlr);return r?e+r.index:t.length}M(II,"skipWhitespace");function KHe(t){const e=t.match(qlr);if(e&&typeof e.index=="number")return e.index}M(KHe,"lastCharacter");function ZHe(t){var s,a;const e=ai.create(t.position.line,t.position.character);if(t.tokens.length===0)return new wme([],$n.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=LY(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=LY(r)+i}return r.trim()}},M(fw,"JSDocCommentImpl"),fw),pw,Uz=(pw=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} -${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const s=tGe(this.name,r,e??{});if(typeof s=="string")return s}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} -${r}`),this.inline?`{${i}}`:i}},M(pw,"JSDocTagImpl"),pw);function tGe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=II(e,i);s=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),((n=r.renderLink)==null?void 0:n.call(r,e,s))??rGe(e,s)}}M(tGe,"renderInlineTag");function rGe(t,e){try{return Fc.parse(t,!0),`[${e}](${t})`}catch{return t}}M(rGe,"renderLinkDefault");var gw,_Y=(gw=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +For Further details.`,n}M(QVe,"buildAmbiguityError");function JVe(t){if(t instanceof Nl)return"SUBRULE";if(t instanceof Eo)return"OPTION";if(t instanceof Tc)return"OR";if(t instanceof Qc)return"AT_LEAST_ONE";if(t instanceof Jc)return"AT_LEAST_ONE_SEP";if(t instanceof wc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(JVe,"getProductionDslName");function eHe(t,e,r){const n=Rlr(e.configs.elements,s=>s.state.transitions),i=Hlr(n.filter(s=>s instanceof wre).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}M(eHe,"buildAdaptivePredictError");function tHe(t,e){return t.edges[e.tokenTypeIdx]}M(tHe,"getExistingTargetState");function rHe(t,e,r){const n=new MY,i=[];for(const a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===K7){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l0&&!oHe(s))for(const a of i)s.add(a);return s}M(rHe,"computeReachSet");function nHe(t,e){if(t instanceof wre&&tre(e,t.tokenType))return t.target}M(nHe,"getReachableTarget");function iHe(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}M(iHe,"getUniqueAlt");function Mre(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}M(Mre,"newDFAState");function _Y(t,e,r,n){return n=Rre(t,n),e.edges[r.tokenTypeIdx]=n,n}M(_Y,"addDFAEdge");function Rre(t,e){if(e===EI)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}M(Rre,"addDFAState");function sHe(t){const e=new MY,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};pE(a,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}M(hHe,"hasConflictingAltSet");function dHe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}M(dHe,"hasStateAssociatedWithOneAlt");_7();var C4,fHe=(C4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Lre(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new fP;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new AI(e.startOffset,e.image.length,tE(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 s of e){const a=new AI(s.startOffset,s.image.length,tE(s),s.tokenType,!0);a.root=this.rootNode,r.push(a)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const s=n.container.content.indexOf(n);if(s>0){n.container.content.splice(s,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},M(C4,"CstNodeBuilder"),C4),k4,_re=(k4=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},M(k4,"AbstractCstNode"),k4),S4,AI=(S4=class extends _re{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},M(S4,"LeafCstNodeImpl"),S4),E4,fP=(E4=class extends _re{constructor(){super(...arguments),this.content=new ecr(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},M(E4,"CompositeCstNodeImpl"),E4),oy,ecr=(oy=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,oy.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},M(oy,"CstNodeContainer"),oy),A4,Lre=(A4=class extends fP{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},M(A4,"RootCstNodeImpl"),A4),MI=Symbol("Datatype");function LR(t){return t.$type===MI}M(LR,"isDataTypeNode");var kme="​",pHe=M(t=>t.endsWith(kme)?t:t+kme,"withRuleSuffix"),M4,Ire=(M4=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new rcr(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new vHe(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},M(M4,"AbstractLangiumParser"),M4),R4,gHe=(R4=class extends Ire{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new fHe,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;D5(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(pHe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,s),Il(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===MI?a.value="":r!==void 0&&(a.$infixName=r)}return n(i),s?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=M0(n)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,h,a,l)}else if(LR(u)){let h=i.image;M0(n)||(h=this.converter.convert(h,a).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,s){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,s)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:s}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,s);else if(!i){const a=this.current;if(LR(a))a.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const s={$type:e};this.stack.push(s),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):LR(e)?this.converter.convert(e.value,e.$cstNode):(_ee(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let s=0,a=-1;for(let m=0;ma?(a=v.precedence,s=m):v.precedence===a&&(v.rightAssoc||(s=m))}const o=i.slice(0,s),l=i.slice(s+1),u=n.slice(0,s+1),h=n.slice(s+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[s],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=uv(e,A0);this.assignmentMap.set(e,{assignment:r,crossRef:r&&dv(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,s){const a=this.current;let o;switch(s==="single"&&typeof n=="string"?o=this.linker.buildReference(a,r,i,n):s==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(a,r,i,n):o=n,e){case"=":{a[r]=o;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(o)}}assignWithoutOverride(e,r){for(const[i,s]of Object.entries(r)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},M(R4,"LangiumParser"),R4),_4,mHe=(_4=class{buildMismatchTokenMessage(e){return pb.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return pb.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return pb.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return pb.buildEarlyExitMessage(e)}},M(_4,"AbstractParserErrorMessageProvider"),_4),L4,Nre=(L4=class extends mHe{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},M(L4,"LangiumParserErrorMessageProvider"),L4),I4,yHe=(I4=class extends Ire{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(pHe(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,s){this.before(i),this.wrapper.wrapSubrule(e,r,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},M(I4,"LangiumCompletionParser"),I4),tcr={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Nre},N4,vHe=(N4=class extends Fir{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...tcr,lookaheadStrategy:n?new lre({maxLookahead:r.maxLookahead}):new Jlr({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},M(N4,"ChevrotainWrapper"),N4),D4,rcr=(D4=class extends vHe{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},M(D4,"ProfilerWrapper"),D4);function pP(t,e,r){return bHe({parser:e,tokens:r,ruleNames:new Map},t),e}M(pP,"createParser");function bHe(t,e){const r=RO(e,!1),n=yi(e.rules).filter(Il).filter(s=>r.has(s));for(const s of n){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,Bg(a,s.definition))}const i=yi(e.rules).filter(D5).filter(s=>r.has(s));for(const s of i)t.parser.rule(s,xHe(t,s))}M(bHe,"buildRules");function xHe(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Bu(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const l={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...s,$container:a};a.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:M(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=gP(t,r)),t.parser.subrule(0,f,!1,s,p),t.parser.many(0,{DEF:M(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}M(xHe,"buildInfixRule");function Bg(t,e,r=!1){let n;if(M0(e))n=AHe(t,e);else if(Dg(e))n=wHe(t,e);else if(A0(e))n=Bg(t,e.terminal);else if(dv(e))n=Dre(t,e);else if(R0(e))n=THe(t,e);else if(xO(e))n=kHe(t,e);else if(kO(e))n=SHe(t,e);else if(fv(e))n=EHe(t,e);else if($ee(e)){const i=t.consume++;n=M(()=>t.parser.consume(i,Pg,e),"method")}else throw new EO(e.$cstNode,`Unexpected element type: ${e.$type}`);return Ore(t,r?void 0:gE(e),n,e.cardinality)}M(Bg,"buildElement");function wHe(t,e){const r=Py(e);return()=>t.parser.action(r,e)}M(wHe,"buildAction");function THe(t,e){const r=e.rule.ref;if(hv(r)){const n=t.subrule++,i=Il(r)&&r.fragment,s=e.arguments.length>0?CHe(r,e.arguments):()=>({});let a;return o=>{a??(a=gP(t,r)),t.parser.subrule(n,a,i,e,s(o))}}else if(Bu(r)){const n=t.consume++,i=RI(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)hm();else throw new EO(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}M(THe,"buildRuleCall");function CHe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var s,a;return{parameterName:(a=(s=i.parameter)==null?void 0:s.ref)==null?void 0:a.name,predicate:lh(i.value)}});return i=>{const s={};for(const{parameterName:a,predicate:o}of n)a&&(s[a]=o(i));return s}}else{const n=e.map(i=>lh(i.value));return i=>{const s={};for(let a=0;ae(n)||r(n)}else if(Oee(t)){const e=lh(t.left),r=lh(t.right);return n=>e(n)&&r(n)}else if(zee(t)){const e=lh(t.value);return r=>!e(r)}else if(Vee(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Nee(t)){const e=!!t.true;return()=>e}hm()}M(lh,"buildPredicate");function kHe(t,e){if(e.elements.length===1)return Bg(t,e.elements[0]);{const r=[];for(const i of e.elements){const s={ALT:Bg(t,i,!0)},a=gE(i);a&&(s.GATE=lh(a)),r.push(s)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(s=>{const a={ALT:M(()=>s.ALT(i),"ALT")},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}M(kHe,"buildAlternatives");function SHe(t,e){if(e.elements.length===1)return Bg(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Bg(t,o,!0)},u=gE(o);u&&(l.GATE=lh(u)),r.push(l)}const n=t.or++,i=M((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),s=M(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:M(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),a=Ore(t,gE(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}M(SHe,"buildUnorderedGroup");function EHe(t,e){const r=e.elements.map(n=>Bg(t,n));return n=>r.forEach(i=>i(n))}M(EHe,"buildGroup");function gE(t){if(fv(t))return t.guardCondition}M(gE,"getGuardCondition");function Dre(t,e,r=e.terminal){if(r)if(R0(r)&&Il(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let s;return a=>{s??(s=gP(t,n)),t.parser.subrule(i,s,!1,e,a)}}else if(R0(r)&&Bu(r.rule.ref)){const n=t.consume++,i=RI(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(M0(r)){const n=t.consume++,i=RI(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=NO(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Py(e.type.ref));return Dre(t,e,i)}}M(Dre,"buildCrossReference");function AHe(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}M(AHe,"buildKeyword");function Ore(t,e,r,n){const i=e&&lh(e);if(!n)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:M(()=>r(a),"ALT"),GATE:M(()=>i(a),"GATE")},{ALT:CY(),GATE:M(()=>!i(a),"GATE")}])}else return r;if(n==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:M(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else if(n==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:M(()=>t.parser.atLeastOne(s,{DEF:M(()=>r(o),"DEF")}),"ALT"),GATE:M(()=>i(o),"GATE")},{ALT:CY(),GATE:M(()=>!i(o),"GATE")}])}else return a=>t.parser.atLeastOne(s,{DEF:M(()=>r(a),"DEF")})}else if(n==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:M(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else hm()}M(Ore,"wrap");function gP(t,e){const r=MHe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}M(gP,"getRule");function MHe(t,e){if(hv(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Il(n);)(fv(n)||xO(n)||kO(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}M(MHe,"getRuleName");function RI(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}M(RI,"getToken");function Pre(t){const e=t.Grammar,r=t.parser.Lexer,n=new yHe(t);return pP(e,n,r.definition),n.finalize(),n}M(Pre,"createCompletionParser");function $re(t){const e=Bre(t);return e.finalize(),e}M($re,"createLangiumParser");function Bre(t){const e=t.Grammar,r=t.parser.Lexer,n=new gHe(t);return pP(e,n,r.definition)}M(Bre,"prepareLangiumParser");var O4,mP=(O4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=yi(RO(e,!1)),i=this.buildTerminalTokens(n),s=this.buildKeywordTokens(n,i,r);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Bu).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=P7(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=MO(r)?Al.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(hv).flatMap(i=>Q0(i).filter(M0)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,r){return r?new RegExp(L3(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&cte("^"+s.source+"$",e.value)&&n.push(i),n},[])}},M(O4,"DefaultTokenBuilder"),O4),P4,Fre=(P4=class{convert(e,r){let n=r.grammarSource;if(dv(n)&&(n=pte(n)),R0(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return od.convertInt(r);case"STRING":return od.convertString(r);case"ID":return od.convertID(r)}switch((i=Cte(e))==null?void 0:i.toLowerCase()){case"number":return od.convertNumber(r);case"boolean":return od.convertBoolean(r);case"bigint":return od.convertBigint(r);case"date":return od.convertDate(r);default:return r}}},M(P4,"DefaultValueConverter"),P4),od;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}M(yP,"delayNextTick");var IR=0,RHe=10;function vP(){return IR=performance.now(),new $i.CancellationTokenSource}M(vP,"startCancelableOperation");function zre(t){RHe=t}M(zre,"setInterruptionPeriod");var xd=Symbol("OperationCancelled");function Mv(t){return t===xd}M(Mv,"isOperationCancelled");async function za(t){if(t===$i.CancellationToken.None)return;const e=performance.now();if(e-IR>=RHe&&(IR=e,await yP(),IR=performance.now()),t.isCancellationRequested)throw xd}M(za,"interruptAndCheck");var $4,D0=($4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},M($4,"Deferred"),$4),og,Sme=(og=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(og.isIncremental(n)){const i=Hre(n.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=LY(n.text,!1,s);if(l-o===h.length)for(let f=0,p=h.length;fe?i=a:n=a+1}const s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&Vre(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}},M(og,"FullTextDocument"),og),_I;(function(t){function e(i,s,a,o){return new Sme(i,s,a,o)}M(e,"create"),t.create=e;function r(i,s,a){if(i instanceof Sme)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}M(r,"update"),t.update=r;function n(i,s){const a=i.getText(),o=LI(s.map(_He),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(a.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(a.substr(l)),u.join("")}M(n,"applyEdits"),t.applyEdits=n})(_I||(_I={}));function LI(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);LI(n,e),LI(i,e);let s=0,a=0,o=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}M(Hre,"getWellformedRange");function _He(t){const e=Hre(t.range);return e!==t.range?{newText:t.newText,range:e}:t}M(_He,"getWellformedEdit");var LHe;(()=>{var t={975:N=>{function L(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}M(L,"e");function I(O,D){for(var F,z="",V=0,B=-1,H=0,G=0;G<=O.length;++G){if(G2){var W=z.lastIndexOf("/");if(W!==z.length-1){W===-1?(z="",V=0):V=(z=z.slice(0,W)).length-1-z.lastIndexOf("/"),B=G,H=0;continue}}else if(z.length===2||z.length===1){z="",V=0,B=G,H=0;continue}}D&&(z.length>0?z+="/..":z="..",V=2)}else z.length>0?z+="/"+O.slice(B+1,G):z=O.slice(B+1,G),V=G-B-1;B=G,H=0}else F===46&&H!==-1?++H:H=-1}return z}M(I,"r");var $={resolve:M(function(){for(var O,D="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var V;z>=0?V=arguments[z]:(O===void 0&&(O=process.cwd()),V=O),L(V),V.length!==0&&(D=V+"/"+D,F=V.charCodeAt(0)===47)}return D=I(D,!F),F?D.length>0?"/"+D:"/":D.length>0?D:"."},"resolve"),normalize:M(function(O){if(L(O),O.length===0)return".";var D=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=I(O,!D)).length!==0||D||(O="."),O.length>0&&F&&(O+="/"),D?"/"+O:O},"normalize"),isAbsolute:M(function(O){return L(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:M(function(){if(arguments.length===0)return".";for(var O,D=0;D0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":$.normalize(O)},"join"),relative:M(function(O,D){if(L(O),L(D),O===D||(O=$.resolve(O))===(D=$.resolve(D)))return"";for(var F=1;FG){if(D.charCodeAt(B+K)===47)return D.slice(B+K+1);if(K===0)return D.slice(B+K)}else V>G&&(O.charCodeAt(F+K)===47?W=K:K===0&&(W=0));break}var q=O.charCodeAt(F+K);if(q!==D.charCodeAt(B+K))break;q===47&&(W=K)}var oe="";for(K=F+W+1;K<=z;++K)K!==z&&O.charCodeAt(K)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+D.slice(B+W):(B+=W,D.charCodeAt(B)===47&&++B,D.slice(B))},"relative"),_makeLong:M(function(O){return O},"_makeLong"),dirname:M(function(O){if(L(O),O.length===0)return".";for(var D=O.charCodeAt(0),F=D===47,z=-1,V=!0,B=O.length-1;B>=1;--B)if((D=O.charCodeAt(B))===47){if(!V){z=B;break}}else V=!1;return z===-1?F?"/":".":F&&z===1?"//":O.slice(0,z)},"dirname"),basename:M(function(O,D){if(D!==void 0&&typeof D!="string")throw new TypeError('"ext" argument must be a string');L(O);var F,z=0,V=-1,B=!0;if(D!==void 0&&D.length>0&&D.length<=O.length){if(D.length===O.length&&D===O)return"";var H=D.length-1,G=-1;for(F=O.length-1;F>=0;--F){var W=O.charCodeAt(F);if(W===47){if(!B){z=F+1;break}}else G===-1&&(B=!1,G=F+1),H>=0&&(W===D.charCodeAt(H)?--H==-1&&(V=F):(H=-1,V=G))}return z===V?V=G:V===-1&&(V=O.length),O.slice(z,V)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!B){z=F+1;break}}else V===-1&&(B=!1,V=F+1);return V===-1?"":O.slice(z,V)},"basename"),extname:M(function(O){L(O);for(var D=-1,F=0,z=-1,V=!0,B=0,H=O.length-1;H>=0;--H){var G=O.charCodeAt(H);if(G!==47)z===-1&&(V=!1,z=H+1),G===46?D===-1?D=H:B!==1&&(B=1):D!==-1&&(B=-1);else if(!V){F=H+1;break}}return D===-1||z===-1||B===0||B===1&&D===z-1&&D===F+1?"":O.slice(D,z)},"extname"),format:M(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(D,F){var z=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+V:z+"/"+V:V})(0,O)},"format"),parse:M(function(O){L(O);var D={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return D;var F,z=O.charCodeAt(0),V=z===47;V?(D.root="/",F=1):F=0;for(var B=-1,H=0,G=-1,W=!0,K=O.length-1,q=0;K>=F;--K)if((z=O.charCodeAt(K))!==47)G===-1&&(W=!1,G=K+1),z===46?B===-1?B=K:q!==1&&(q=1):B!==-1&&(q=-1);else if(!W){H=K+1;break}return B===-1||G===-1||q===0||q===1&&B===G-1&&B===H+1?G!==-1&&(D.base=D.name=H===0&&V?O.slice(1,G):O.slice(H,G)):(H===0&&V?(D.name=O.slice(1,B),D.base=O.slice(1,G)):(D.name=O.slice(H,B),D.base=O.slice(H,G)),D.ext=O.slice(B,G)),H>0?D.dir=O.slice(0,H-1):V&&(D.dir="/"),D},"parse"),sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,N.exports=$}},e={};function r(N){var L=e[N];if(L!==void 0)return L.exports;var I=e[N]={exports:{}};return t[N](I,I.exports,r),I.exports}M(r,"r"),r.d=(N,L)=>{for(var I in L)r.o(L,I)&&!r.o(N,I)&&Object.defineProperty(N,I,{enumerable:!0,get:L[I]})},r.o=(N,L)=>Object.prototype.hasOwnProperty.call(N,L),r.r=N=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:M(()=>f,"URI"),Utils:M(()=>R,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l(N,L){if(!N.scheme&&L)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!s.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!a.test(N.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}M(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_=class _{constructor(L,I,$,O,D,F=!1){xr(this,"scheme");xr(this,"authority");xr(this,"path");xr(this,"query");xr(this,"fragment");typeof L=="object"?(this.scheme=L.scheme||u,this.authority=L.authority||u,this.path=L.path||u,this.query=L.query||u,this.fragment=L.fragment||u):(this.scheme=(function(z,V){return z||V?z:"file"})(L,F),this.authority=I||u,this.path=(function(z,V){switch(z){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,$||u),this.query=O||u,this.fragment=D||u,l(this,F))}static isUri(L){return L instanceof _||!!L&&typeof L.authority=="string"&&typeof L.fragment=="string"&&typeof L.path=="string"&&typeof L.query=="string"&&typeof L.scheme=="string"&&typeof L.fsPath=="string"&&typeof L.with=="function"&&typeof L.toString=="function"}get fsPath(){return x(this,!1)}with(L){if(!L)return this;let{scheme:I,authority:$,path:O,query:D,fragment:F}=L;return I===void 0?I=this.scheme:I===null&&(I=u),$===void 0?$=this.authority:$===null&&($=u),O===void 0?O=this.path:O===null&&(O=u),D===void 0?D=this.query:D===null&&(D=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&$===this.authority&&O===this.path&&D===this.query&&F===this.fragment?this:new g(I,$,O,D,F)}static parse(L,I=!1){const $=d.exec(L);return $?new g($[2]||u,S($[4]||u),S($[5]||u),S($[7]||u),S($[9]||u),I):new g(u,u,u,u,u)}static file(L){let I=u;if(i&&(L=L.replace(/\\/g,h)),L[0]===h&&L[1]===h){const $=L.indexOf(h,2);$===-1?(I=L.substring(2),L=h):(I=L.substring(2,$),L=L.substring($)||h)}return new g("file",I,L,u,u)}static from(L){const I=new g(L.scheme,L.authority,L.path,L.query,L.fragment);return l(I,!0),I}toString(L=!1){return b(this,L)}toJSON(){return this}static revive(L){if(L){if(L instanceof _)return L;{const I=new g(L);return I._formatted=L.external,I._fsPath=L._sep===p?L.fsPath:null,I}}return L}};M(_,"l");let f=_;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);xr(this,"_formatted",null);xr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(I=!1){return I?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}};M(P,"d");let g=P;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(N,L,I){let $,O=-1;for(let D=0;D=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||L&&F===47||I&&F===91||I&&F===93||I&&F===58)O!==-1&&($+=encodeURIComponent(N.substring(O,D)),O=-1),$!==void 0&&($+=N.charAt(D));else{$===void 0&&($=N.substr(0,D));const z=m[F];z!==void 0?(O!==-1&&($+=encodeURIComponent(N.substring(O,D)),O=-1),$+=z):O===-1&&(O=D)}}return O!==-1&&($+=encodeURIComponent(N.substring(O))),$!==void 0?$:N}M(y,"m");function v(N){let L;for(let I=0;I1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?L?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}M(x,"v");function b(N,L){const I=L?v:y;let $="",{scheme:O,authority:D,path:F,query:z,fragment:V}=N;if(O&&($+=O,$+=":"),(D||O==="file")&&($+=h,$+=h),D){let B=D.indexOf("@");if(B!==-1){const H=D.substr(0,B);D=D.substr(B+1),B=H.lastIndexOf(":"),B===-1?$+=I(H,!1,!1):($+=I(H.substr(0,B),!1,!1),$+=":",$+=I(H.substr(B+1),!1,!0)),$+="@"}D=D.toLowerCase(),B=D.lastIndexOf(":"),B===-1?$+=I(D,!1,!0):($+=I(D.substr(0,B),!1,!0),$+=D.substr(B))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const B=F.charCodeAt(1);B>=65&&B<=90&&(F=`/${String.fromCharCode(B+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const B=F.charCodeAt(0);B>=65&&B<=90&&(F=`${String.fromCharCode(B+32)}:${F.substr(2)}`)}$+=I(F,!0,!1)}return z&&($+="?",$+=I(z,!1,!1)),V&&($+="#",$+=L?V:y(V,!1,!1)),$}M(b,"b");function T(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+T(N.substr(3)):N}}M(T,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(N){return N.match(C)?N.replace(C,(L=>T(L))):N}M(S,"w");var k=r(975);const E=k.posix||k,A="/";var R;(function(N){N.joinPath=function(L,...I){return L.with({path:E.join(L.path,...I)})},N.resolvePath=function(L,...I){let $=L.path,O=!1;$[0]!==A&&($=A+$,O=!0);let D=E.resolve($,...I);return O&&D[0]===A&&!L.authority&&(D=D.substring(1)),L.with({path:D})},N.dirname=function(L){if(L.path.length===0||L.path===A)return L;let I=E.dirname(L.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),L.with({path:I})},N.basename=function(L){return E.basename(L.path)},N.extname=function(L){return E.extname(L.path)}})(R||(R={})),LHe=n})();var{URI:Hc,Utils:SC}=LHe,kl;(function(t){t.basename=SC.basename,t.dirname=SC.dirname,t.extname=SC.extname,t.joinPath=SC.joinPath,t.resolvePath=SC.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(a,o){return(a==null?void 0:a.toString())===(o==null?void 0:o.toString())}M(r,"equals"),t.equals=r;function n(a,o){const l=typeof a=="string"?Hc.parse(a).path:a.path,u=typeof o=="string"?Hc.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:kl.joinPath(Hc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(kl.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const s of n){let a=i.children.get(s);if(!a)if(r)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},M(B4,"UriTrie"),B4),Mn;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Mn||(Mn={}));var F4,IHe=(F4=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=$i.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Hc.parse(e.uri),$i.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return $i.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let s;if(n)s={parseResult:e,uri:r,state:Mn.Parsed,references:[],textDocument:n};else{const a=this.createTextDocumentGetter(r,i);s={parseResult:e,uri:r,state:Mn.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,r){var a,o;const n=(a=e.parseResult.value.$cstNode)==null?void 0:a.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:l})}return n!==s&&(e.parseResult=await this.parseAsync(e.uri,s,r),e.parseResult.value.$document=e),e.state=Mn.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=_I.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},M(F4,"DefaultLangiumDocumentFactory"),F4),z4,NHe=(z4=class{constructor(e){this.documentTrie=new Gre,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return yi(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Mn.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Mn.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Mn.Changed;return this.documentTrie.delete(r),n}},M(z4,"DefaultLangiumDocuments"),z4),n1=Symbol("RefResolving"),V4,DHe=(V4=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=$i.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const s of Th(e.parseResult.value))await za(r),N5(s).forEach(a=>{const o=`${s.$type}:${a.property}`;i.startSubTask(o);try{this.doLink(a,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Th(e.parseResult.value))await za(r),N5(i).forEach(s=>this.doLink(s,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=n1;try{const i=this.getCandidate(e);if(p1(i))n._ref=i;else{n._nodeDescription=i;const s=this.loadAstNode(i);n._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const s=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${s}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=n1;try{const i=this.getCandidates(e),s=[];if(p1(i))n._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}n._items=s}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const s=this,a={$refNode:n,$refText:i,_ref:void 0,get ref(){if(aa(this._ref))return this._ref;if(Aee(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=n1;const o=Hb(e).$document,l=s.getLinkedNode({reference:a,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:r})}};return a}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(p1(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Hb(e.container).$document;n&&n.statedv(r)&&r.isMulti)}findDeclarations(e){if(e){const r=vte(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Cl(i)||Md(i))return XL(i);if(Array.isArray(i)){for(const s of i)if((Cl(s)||Md(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return XL(s)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Zee(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of N5(n))if(Md(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&n.push(s)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(s=>kl.equals(s.sourceUri,r.documentUri))),n.push(...i),yi(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const s=this.nameProvider.getNameNode(i);if(s){const a=wh(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:P5(s),local:!0})}}return n}},M(G4,"DefaultReferences"),G4),W4,O0=(W4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return eE.sum(yi(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?yi(r):_5}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return yi(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return yi(this.map.keys())}values(){return yi(this.map.values()).flat()}entriesGroupedByKey(){return yi(this.map.entries())}},M(W4,"MultiMap"),W4),q4,II=(q4=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},M(q4,"BiMap"),q4),U4,$He=(U4=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=$i.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=I7,i=$i.CancellationToken.None){const s=[];this.addExportedSymbol(e,s,r);for(const a of n(e))await za(i),this.addExportedSymbol(a,s,r);return s}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=$i.CancellationToken.None){const n=e.parseResult.value,i=new O0;for(const s of Q0(n))await za(r),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&n.add(i,this.descriptions.createDescription(e,s,r))}}},M(U4,"DefaultScopeComputation"),U4),Y4,IY=(Y4=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},M(Y4,"StreamScope"),Y4),j4,ncr=(j4=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(s,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?yi(i).concat(this.outerScope.getElements(e)):yi(i)}getAllElements(){let e=yi(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},M(j4,"MapScope"),j4),X4,BHe=(X4=class{constructor(e,r,n){this.elements=new O0,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?yi(n).concat(this.outerScope.getElements(e)):yi(n)}getAllElements(){let e=yi(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},M(X4,"MultiMapScope"),X4),icr={getElement(){},getElements(){return _5},getAllElements(){return _5}},K4,bP=(K4=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},M(K4,"DisposableCache"),K4),Z4,qre=(Z4=class extends bP{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},M(Z4,"SimpleCache"),Z4),Q4,xP=(Q4=class extends bP{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const s=n();return i.set(r,s),s}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},M(Q4,"ContextCache"),Q4),J4,FHe=(J4=class extends xP{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const s=n.concat(i);for(const a of s)this.clear(a)}))}},M(J4,"DocumentCache"),J4),ew,Ure=(ew=class extends qre{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},M(ew,"WorkspaceCache"),ew),tw,zHe=(tw=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Ure(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=wh(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&r.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,n))),a=a.$container;while(a)}let s=this.getGlobalScope(n,e);for(let a=r.length-1;a>=0;a--)s=this.createScope(r[a],s);return s}createScope(e,r,n){return new IY(yi(e),r,n)}createScopeForNodes(e,r,n){const i=yi(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new IY(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new BHe(this.indexManager.allElements(e)))}},M(tw,"DefaultScopeProvider"),tw);function Yre(t){return typeof t.$comment=="string"}M(Yre,"isAstNodeWithComment");function NY(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}M(NY,"isIntermediateReference");var rw,VHe=(rw=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,s=M((o,l)=>this.replacer(o,l,n),"defaultReplacer"),a=i?(o,l)=>i(o,l,s):s;try{return this.currentDocument=wh(e),JSON.stringify(e,a,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Cl(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=wh(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Md(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=wh(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(aa(r)){let d;if(s&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),a){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=M(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=mte(e.$cstNode,s).map(r);a.length!==0&&(i[s]=a)}),e}}linkNode(e,r,n,i,s,a){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,s),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(s){if(Mv(s))throw s;console.error(`${r}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);n("error",`${r}: ${a}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=yi(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,s,a,o)=>{await this.handleException(()=>e.call(n,i,s,a,o),r,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},M(iw,"ValidationRegistry"),iw),WHe=Object.freeze({validateNode:!0,validateChildren:!0}),sw,qHe=(sw=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=$i.CancellationToken.None){const i=e.parseResult,s=[];if(await za(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,s,r),r.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===yu.LexingError})||(this.processParsingErrors(i,s,r),r.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===yu.ParsingError}))||(this.processLinkingErrors(e,s,r),r.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===yu.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,r,n))}catch(a){if(Mv(a))throw a;console.error("An error occurred during validation:",a)}return await za(n),s}processLexingErrors(e,r,n){var s;const i=[...e.lexerErrors,...((s=e.lexerReport)==null?void 0:s.diagnostics)??[]];for(const a of i){const o=a.severity??"error",l={severity:ES(o),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Xre(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=tE(i.token);if(s){const a={severity:ES("error"),range:s,message:i.message,data:G1(yu.ParsingError),source:this.getSource()};r.push(a)}}}processLinkingErrors(e,r,n){var i;for(const s of e.references){const a=s.error;if(a){const o={node:a.info.container,range:(i=s.$refNode)==null?void 0:i.range,property:a.info.property,index:a.info.index,data:{code:yu.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};r.push(this.toDiagnostic("error",a.message,o))}}}async validateAst(e,r,n=$i.CancellationToken.None){const i=[],s=M((a,o,l)=>{i.push(this.toDiagnostic(a,o,l))},"acceptor");return await this.validateAstBefore(e,r,s,n),await this.validateAstNodes(e,r,s,n),await this.validateAstAfter(e,r,s,n),i}async validateAstBefore(e,r,n,i=$i.CancellationToken.None){const s=this.validationRegistry.checksBefore;for(const a of s)await za(i),await a(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=$i.CancellationToken.None){var s;if((s=this.profiler)!=null&&s.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const o=Th(e).iterator();for(const l of o){a.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{a.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{a.stop()}}else{const a=Th(e).iterator();for(const o of a){await za(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||a.prune()}}}validateSingleNodeOptions(e,r){return WHe}async validateAstAfter(e,r,n,i=$i.CancellationToken.None){const s=this.validationRegistry.checksAfter;for(const a of s)await za(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:jre(n),severity:ES(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},M(sw,"DefaultDocumentValidator"),sw);function jre(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=_O(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=yte(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}M(jre,"getDiagnosticRange");function ES(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}M(ES,"toDiagnosticSeverity");function Xre(t){switch(t){case"error":return G1(yu.LexingError);case"warning":return G1(yu.LexingWarning);case"info":return G1(yu.LexingInfo);case"hint":return G1(yu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}M(Xre,"toDiagnosticData");var yu;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(yu||(yu={}));var aw,UHe=(aw=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??wh(e);r??(r=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${s} has no name.`);let a;const o=M(()=>a??(a=P5(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:P5(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},M(aw,"DefaultAstNodeDescriptionProvider"),aw),ow,YHe=(ow=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=$i.CancellationToken.None){const n=[],i=e.parseResult.value;for(const s of Th(i))await za(r),N5(s).forEach(a=>{a.reference.error||n.push(...this.createInfoDescriptions(a))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Cl(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Md(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=wh(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=P5(r.$refNode);for(const l of n)a.push({sourceUri:i,sourcePath:s,targetUri:l.documentUri,targetPath:l.path,segment:o,local:kl.equals(l.documentUri,i)});return a}},M(ow,"DefaultReferenceDescriptionProvider"),ow),lw,jHe=(lw=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),l=parseInt(s.substring(a+1)),u=i[o];return u==null?void 0:u[l]}return i[s]},e)}},M(lw,"DefaultAstNodeLocator"),lw),wP={};gO(wP,Cee(R3()));var cw,XHe=(cw=class{constructor(e){this._ready=new D0,this.onConfigurationSectionUpdateEmitter=new wP.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,s)=>{this.updateSectionConfiguration(i.section,n[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},M(cw,"DefaultConfigurationProvider"),cw),U8=Cee(PZt()),iy;(function(t){function e(r){return{dispose:M(async()=>await r(),"dispose")}}M(e,"create"),t.create=e})(iy||(iy={}));var uw,KHe=(uw=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new O0,this.documentPhaseListeners=new O0,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Mn.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=$i.CancellationToken.None){var i;for(const s of e){const a=s.uri.toString();if(s.state===Mn.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(s,Mn.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(s,r);o.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(a))==null?void 0:i.result}),s.state=Mn.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=Mn.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=$i.CancellationToken.None){this.currentState=Mn.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const s=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of s){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Mn.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Mn.Changed)}const a=yi(s).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!a.has(l.uri.toString())&&this.shouldRelink(l,a)).forEach(l=>this.resetToState(l,Mn.ComputedScopes)),await this.emitUpdate(s,i),await za(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,a=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return yi(a).filter(u=>!s.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),iy.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Mn.Changed:case Mn.Parsed:this.indexManager.removeContent(e.uri);case Mn.IndexedContent:e.localSymbols=void 0;case Mn.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Mn.Linked:this.indexManager.removeReferences(e.uri);case Mn.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Mn.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Mn.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Mn.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,Mn.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,Mn.ComputedScopes,n,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,n)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,Mn.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(i,Mn.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,Mn.Validated,n,async a=>{await this.validate(a,n),this.markAsCompleted(a)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:r,result:s==null?void 0:s.result})}}async runCancelable(e,r,n,i){for(const a of e)a.statea.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),iy.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),iy.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=$i.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(xd);if(this.currentState>=e&&e>i.state)return Promise.reject(new U8.ResponseError(U8.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Mn[i.state]}, requiring ${Mn[e]}, but workspace state is already ${Mn[this.currentState]}. Returning undefined.`))}else return Promise.reject(new U8.ResponseError(U8.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,u=>{kl.equals(u.uri,r)&&(o.dispose(),l.dispose(),s(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),a(xd)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(xd):new Promise((n,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),n()}),a=r.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(xd)})})}async notifyDocumentPhase(e,r,n){const s=this.documentPhaseListeners.get(r).slice();for(const a of s)try{await za(n),await a(e,n)}catch(o){if(!Mv(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const s=this.buildPhaseListeners.get(r).slice();for(const a of s)await za(n),await a(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await n.validateDocument(e,s,r);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=yi(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},M(uw,"DefaultDocumentBuilder"),uw),hw,ZHe=(hw=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new xP,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=wh(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{kl.equals(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),yi(i)}allElements(e,r){let n=yi(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=$i.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,r=$i.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},M(hw,"DefaultIndexManager"),hw),dw,QHe=(dw=class{constructor(e){this.initialBuildOptions={},this._ready=new D0,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=$i.CancellationToken.None){const n=await this.performStartup(e);await za(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=M(a=>{r.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=yi(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Hc.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=kl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},M(dw,"DefaultWorkspaceManager"),dw),fw,JHe=(fw=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return fY.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return fY.buildUnableToPopLexerModeMessage(e)}},M(fw,"DefaultLexerErrorMessageProvider"),fw),Kre={mode:"full"},pw,Zre=(pw=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=DI(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Al(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Kre){var i,s;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(s=(i=this.tokenBuilder).flushLexingReport)==null?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(DI(e))return e;const r=CP(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},M(pw,"DefaultLexer"),pw);function TP(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}M(TP,"isTokenTypeArray");function CP(t){return t&&"modes"in t&&"defaultMode"in t}M(CP,"isIMultiModeLexerDefinition");function DI(t){return!TP(t)&&!CP(t)}M(DI,"isTokenTypeDictionary");_7();function Qre(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=oi.create(0,0));const s=ene(t),a=kP(n),o=eGe({lines:s,position:i,options:a});return nGe({index:0,tokens:o,position:i})}M(Qre,"parseJSDoc");function Jre(t,e){const r=kP(e),n=ene(t);if(n.length===0)return!1;const i=n[0],s=n[n.length-1],a=r.start,o=r.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}M(Jre,"isJSDoc");function ene(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(iNe)}M(ene,"getLines");var Eme=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,scr=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function eGe(t){var i,s,a;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=oi.create(r,n);e.push({type:"break",content:"",range:$n.create(p,p)})}}else{Eme.lastIndex=d;const p=Eme.exec(h);if(p){const g=p[0],m=p[1],y=oi.create(r,n+d),v=oi.create(r,n+d+g.length);e.push({type:"tag",content:m,range:$n.create(y,v)}),d+=g.length,d=OI(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}M(eGe,"tokenize");function tGe(t,e,r,n){const i=[];if(t.length===0){const s=oi.create(r,n),a=oi.create(r,n+e.length);i.push({type:"text",content:e,range:$n.create(s,a)})}else{let s=0;for(const o of t){const l=o.index,u=e.substring(s,l);u.length>0&&i.push({type:"text",content:e.substring(s,l),range:$n.create(oi.create(r,s+n),oi.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:$n.create(oi.create(r,s+h+n),oi.create(r,s+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:$n.create(oi.create(r,s+h+n),oi.create(r,s+h+f.length+n))})}else i.push({type:"text",content:"",range:$n.create(oi.create(r,s+h+n),oi.create(r,s+h+n))});s=l+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:$n.create(oi.create(r,s+n),oi.create(r,s+n+a.length))})}return i}M(tGe,"buildInlineTokens");var acr=/\S/,ocr=/\s*$/;function OI(t,e){const r=t.substring(e).match(acr);return r?e+r.index:t.length}M(OI,"skipWhitespace");function rGe(t){const e=t.match(ocr);if(e&&typeof e.index=="number")return e.index}M(rGe,"lastCharacter");function nGe(t){var s,a;const e=oi.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Ame([],$n.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=OY(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=OY(r)+i}return r.trim()}},M(gw,"JSDocCommentImpl"),gw),mw,Kz=(mw=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const s=oGe(this.name,r,e??{});if(typeof s=="string")return s}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} +${r}`),this.inline?`{${i}}`:i}},M(mw,"JSDocTagImpl"),mw);function oGe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=OI(e,i);s=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),((n=r.renderLink)==null?void 0:n.call(r,e,s))??lGe(e,s)}}M(oGe,"renderInlineTag");function lGe(t,e){try{return Hc.parse(t,!0),`[${e}](${t})`}catch{return t}}M(lGe,"renderLinkDefault");var yw,DY=(yw=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` -`)}return r}},M(gw,"JSDocTextImpl"),gw),mw,nGe=(mw=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},M(mw,"JSDocLineImpl"),mw);function LY(t){return t.endsWith(` +`)}return r}},M(yw,"JSDocTextImpl"),yw),vw,cGe=(vw=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},M(vw,"JSDocLineImpl"),vw);function OY(t){return t.endsWith(` `)?` `:` -`}M(LY,"fillNewlines");var yw,iGe=(yw=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Xre(r))return jre(r).toMarkdown({renderLink:M((i,s)=>this.documentationLinkRenderer(e,i,s),"renderLink"),renderTag:M(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=vh(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(l=>l.name===r);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},M(yw,"JSDocDocumentationProvider"),yw),vw,sGe=(vw=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Gre(e)?e.$comment:(r=Zee(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},M(vw,"DefaultCommentProvider"),vw),bw,aGe=(bw=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},M(bw,"DefaultAsyncParser"),bw),xw,Ulr=(xw=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new R0;let s;const a=r.onCancellationRequested(()=>{s=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{a.dispose(),clearTimeout(s)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new R0;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(yd)}),this.queue.push(r),r.promise}},M(xw,"AbstractThreadedAsyncParser"),xw),ww,Ylr=(ww=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new vP.Emitter,this.deferred=new R0,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(s=>{const a=s;this.deferred.resolve(a),this.unlock()}),n(s=>{this.deferred.reject(s),this.unlock()})}terminate(){this.deferred.reject(yd),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 R0,this.sendMessage(e),this.deferred.promise}},M(ww,"ParserWorker"),ww),Tw,oGe=(Tw=class{constructor(){this.previousTokenSource=new $i.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=gP();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=$i.CancellationToken.None){const i=new R0,s={action:r,deferred:i,cancellationToken:n};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>r(i));n.resolve(s)}catch(s){Ev(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},M(Tw,"DefaultWorkspaceLock"),Tw),Cw,lGe=(Cw=class{constructor(e){this.grammarElementIdMap=new RI,this.tokenTypeIdMap=new RI,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of bh(e))r.set(i,{});if(e.$cstNode)for(const i of I5(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];n[i]=a;for(const o of s)aa(o)?a.push(this.dehydrateAstNode(o,r)):wl(o)?a.push(this.dehydrateReference(o,r)):a.push(o)}else aa(s)?n[i]=this.dehydrateAstNode(s,r):wl(s)?n[i]=this.dehydrateReference(s,r):s!==void 0&&(n[i]=s);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return gO(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),w0(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):ov(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const s of bh(e))r.set(s,{});let i;if(e.$cstNode)for(const s of I5(e.$cstNode)){let a;"fullText"in s?(a=new Are(s.fullText),i=a):"content"in s?a=new uP:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(n.set(s,a),a.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];n[i]=a;for(const o of s)aa(o)?a.push(this.setParent(this.hydrateAstNode(o,r),n)):wl(o)?a.push(this.hydrateReference(o,n,i,r)):a.push(o)}else aa(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):wl(s)?n[i]=this.hydrateReference(s,n,i,r):s!==void 0&&(n[i]=s);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),w0(i))for(const s of e.content){const a=this.hydrateCstNode(s,r,n++);i.content.push(a)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new kI(n,i,{start:{line:s,character:a},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of bh(this.grammar))mO(r)&&this.grammarElementIdMap.set(r,e++)}},M(Cw,"DefaultHydrator"),Cw);function ro(t){return{documentation:{CommentProvider:M(e=>new sGe(e),"CommentProvider"),DocumentationProvider:M(e=>new iGe(e),"DocumentationProvider")},parser:{AsyncParser:M(e=>new aGe(e),"AsyncParser"),GrammarConfig:M(e=>wte(e),"GrammarConfig"),LangiumParser:M(e=>Nre(e),"LangiumParser"),CompletionParser:M(e=>Ire(e),"CompletionParser"),ValueConverter:M(()=>new Ore,"ValueConverter"),TokenBuilder:M(()=>new fP,"TokenBuilder"),Lexer:M(e=>new Yre(e),"Lexer"),ParserErrorMessageProvider:M(()=>new Rre,"ParserErrorMessageProvider"),LexerErrorMessageProvider:M(()=>new YHe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:M(()=>new HHe,"AstNodeLocator"),AstNodeDescriptionProvider:M(e=>new zHe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:M(e=>new VHe(e),"ReferenceDescriptionProvider")},references:{Linker:M(e=>new MHe(e),"Linker"),NameProvider:M(()=>new RHe,"NameProvider"),ScopeProvider:M(e=>new DHe(e),"ScopeProvider"),ScopeComputation:M(e=>new LHe(e),"ScopeComputation"),References:M(e=>new _He(e),"References")},serializer:{Hydrator:M(e=>new lGe(e),"Hydrator"),JsonSerializer:M(e=>new OHe(e),"JsonSerializer")},validation:{DocumentValidator:M(e=>new FHe(e),"DocumentValidator"),ValidationRegistry:M(e=>new $He(e),"ValidationRegistry")},shared:M(()=>t.shared,"shared")}}M(ro,"createDefaultCoreModule");function no(t){return{ServiceRegistry:M(e=>new PHe(e),"ServiceRegistry"),workspace:{LangiumDocuments:M(e=>new AHe(e),"LangiumDocuments"),LangiumDocumentFactory:M(e=>new EHe(e),"LangiumDocumentFactory"),DocumentBuilder:M(e=>new WHe(e),"DocumentBuilder"),IndexManager:M(e=>new qHe(e),"IndexManager"),WorkspaceManager:M(e=>new UHe(e),"WorkspaceManager"),FileSystemProvider:M(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:M(()=>new oGe,"WorkspaceLock"),ConfigurationProvider:M(e=>new GHe(e),"ConfigurationProvider")},profilers:{}}}M(no,"createDefaultSharedCoreModule");var IY;(function(t){t.merge=(e,r)=>$5($5({},e),r)})(IY||(IY={}));function Hn(t,e,r,n,i,s,a,o,l){const u=[t,e,r,n,i,s,a,o,l].reduce($5,{});return tne(u)}M(Hn,"inject");var cGe=Symbol("isProxy");function ene(t){if(t&&t[cGe])for(const e of Object.values(t))ene(e);return t}M(ene,"eagerLoad");function tne(t,e){const r=new Proxy({},{deleteProperty:M(()=>!1,"deleteProperty"),set:M(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:M((n,i)=>i===cGe?!0:NY(n,i,t,e||r),"get"),getOwnPropertyDescriptor:M((n,i)=>(NY(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:M((n,i)=>i in t,"has"),ownKeys:M(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}M(tne,"_inject");var Tme=Symbol();function NY(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===Tme)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=Tme;try{t[e]=typeof i=="function"?i(n):tne(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}M(NY,"_resolve");function $5(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=$5(i,n):t[r]=$5({},n)}else t[r]=n}return t}M($5,"_merge");var DY={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},H1;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(H1||(H1={}));var kw,uGe=(kw=class extends fP{constructor(e=DY){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...DY,...e},this.indentTokenType=Hb({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Hb({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!bP(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:s,whitespaceTokenName:a,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=H1.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===s?l=f:f.name===i?u=f:f.name===a?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[H1.REGULAR]:[l,u,...d,h],[H1.IGNORE_INDENTATION]:[...d,h]},defaultMode:H1.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r -`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const s=this.whitespaceRegExp.exec(e);return{currIndentLevel:(s==null?void 0:s[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:s}}createIndentationTokenInstance(e,r,n,i){const s=this.getLineNumber(r,i);return W7(e,n,i,i+n.length,s,s,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);return s<=a?null:(this.indentationStack.push(s),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);if(s>=a)return null;const l=this.indentationStack.lastIndexOf(s);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${s} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},M(kw,"IndentationAwareTokenBuilder"),kw),Sw,jlr=(Sw=class extends Yre{constructor(e){if(super(e),e.parser.TokenBuilder instanceof uGe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Ure){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:s,dedentTokenType:a}=this.indentationTokenBuilder,o=s.tokenTypeIdx,l=a.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},M(Sw,"IndentationAwareLexer"),Sw),rne={};om(rne,{AstUtils:()=>See,BiMap:()=>RI,Cancellation:()=>$i,ContextCache:()=>yP,CstUtils:()=>Tee,DONE_RESULT:()=>hl,Deferred:()=>R0,Disposable:()=>ry,DisposableCache:()=>mP,DocumentCache:()=>NHe,EMPTY_STREAM:()=>A5,ErrorWithLocation:()=>CO,GrammarUtils:()=>tte,MultiMap:()=>_0,OperationCancelled:()=>yd,Reduction:()=>Z6,RegExpUtils:()=>nte,SimpleCache:()=>Vre,StreamImpl:()=>md,TreeStreamImpl:()=>M5,URI:()=>Fc,UriTrie:()=>Fre,UriUtils:()=>Tl,WorkspaceCache:()=>Hre,assertCondition:()=>rte,assertUnreachable:()=>lm,delayNextTick:()=>pP,interruptAndCheck:()=>za,isOperationCancelled:()=>Ev,loadGrammarFromJson:()=>io,setInterruptionPeriod:()=>Pre,startCancelableOperation:()=>gP,stream:()=>yi});dO(rne,vP);var Ew,hGe=(Ew=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[]}},M(Ew,"EmptyFileSystemProvider"),Ew),_o={fileSystemProvider:M(()=>new hGe,"fileSystemProvider")},Xlr={Grammar:M(()=>{},"Grammar"),LanguageMetaData:M(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Klr={AstReflection:M(()=>new Uee,"AstReflection")};function dGe(){const t=Hn(no(_o),Klr),e=Hn(ro({shared:t}),Xlr);return t.ServiceRegistry.register(e),e}M(dGe,"createMinimalGrammarServices");function io(t){const e=dGe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Fc.parse(`memory:/${r.name??"grammar"}.langium`)),r}M(io,"loadGrammarFromJson");dO(CIe,rne);var Aw,Zlr=(Aw=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new _0}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 fGe(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const a of r.entries.keys()){const o=r.entries.get(a),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${a}`,count:o.length,duration:l})}const i=r.duration-n.map(a=>a.duration).reduce((a,o)=>a+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((a,o)=>o.duration-a.duration);function s(a){return Math.round(100*a)/100}return M(s,"Round"),console.table(n.map(a=>({Element:a.name,Count:a.count,"Self %":s(100*a.duration/r.duration),"Time (ms)":s(a.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},M(Aw,"DefaultLangiumProfiler"),Aw),Mw,fGe=(Mw=class{constructor(e,r){this.stack=[],this.entries=new _0,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},M(Mw,"ProfilingTask"),Mw),OY;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(OY||(OY={}));var PY;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(PY||(PY={}));var $Y;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})($Y||($Y={}));var BY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(BY||(BY={}));var FY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(FY||(FY={}));var zY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(zY||(zY={}));var VY;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(VY||(VY={}));var HY;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(HY||(HY={}));var GY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(GY||(GY={}));var WY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(WY||(WY={}));var qY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(qY||(qY={}));var UY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(UY||(UY={}));var YY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(YY||(YY={}));var jY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(jY||(jY={}));var XY;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(XY||(XY={}));({...OY.Terminals,...PY.Terminals,...$Y.Terminals,...BY.Terminals,...FY.Terminals,...zY.Terminals,...VY.Terminals,...HY.Terminals,...GY.Terminals,...WY.Terminals,...qY.Terminals,...UY.Terminals,...jY.Terminals,...YY.Terminals,...XY.Terminals});var Cme={$type:"AbnfAlternation",alternatives:"alternatives"},kme={$type:"AbnfConcatenation",elements:"elements"},Yz={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Sme={$type:"AbnfGroup",element:"element"},Eme={$type:"AbnfNumVal",value:"value"},Ame={$type:"AbnfOptionalGroup",element:"element"},t2={$type:"AbnfPrimary"},jz={$type:"AbnfRule",definition:"definition",name:"name"},Mme={$type:"AbnfRuleName",name:"name"},Rme={$type:"AbnfStringLiteral",value:"value"},G8={$type:"Accelerator",name:"name",x:"x",y:"y"},Xz={$type:"Alignment",direction:"direction",members:"members"},W8={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},CC={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},Kz={$type:"Annotations",x:"x",y:"y"},Yh={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Qlr(t){return Qs.isInstance(t,Yh.$type)}M(Qlr,"isArchitecture");var q8={$type:"Axis",label:"label",name:"name"},_R={$type:"Branch",name:"name",order:"order"};function Jlr(t){return Qs.isInstance(t,_R.$type)}M(Jlr,"isBranch");var _me={$type:"Checkout",branch:"branch"},U8={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Zz={$type:"ClassDefStatement",className:"className",styleText:"styleText"},I2={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function ecr(t){return Qs.isInstance(t,I2.$type)}M(ecr,"isCommit");var Y8={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Dm={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},j8={$type:"Curve",entries:"entries",label:"label",name:"name"},t1={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function tcr(t){return Qs.isInstance(t,t1.$type)}M(tcr,"isCynefin");var X8={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Lme={$type:"Decorator",strategy:"strategy"},r2={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},LR={$type:"DomainBlock",domain:"domain",items:"items"};function rcr(t){return Qs.isInstance(t,LR.$type)}M(rcr,"isDomainBlock");var KY={$type:"DomainItem",label:"label"};function ncr(t){return Qs.isInstance(t,KY.$type)}M(ncr,"isDomainItem");var Ime={$type:"EbnfChoice",alternatives:"alternatives"},Nme={$type:"EbnfExceptionPostfix",except:"except"},Dme={$type:"EbnfGroup",element:"element"},Ome={$type:"EbnfNonTerminal",name:"name"},Pme={$type:"EbnfOneOrMorePostfix",operator:"operator"},$me={$type:"EbnfOptional",element:"element"},Bme={$type:"EbnfOptionalPostfix",operator:"operator"},kC={$type:"EbnfPostfix"},Om={$type:"EbnfPrimary"},Fme={$type:"EbnfRepetition",element:"element"},Qz={$type:"EbnfRule",definition:"definition",name:"name"},zme={$type:"EbnfSequence",elements:"elements"},Vme={$type:"EbnfSpecial",text:"text"},Jz={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Hme={$type:"EbnfTerminal",value:"value"},Gme={$type:"EbnfZeroOrMorePostfix",operator:"operator"},zh={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},n2={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Pm={$type:"EmFrame"},SC={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Wme={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},eV={$type:"EmModelEntity",name:"name"};function icr(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}M(icr,"isEmModelEntityType");var K8={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Tf={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function pGe(t){return Qs.isInstance(t,Tf.$type)}M(pGe,"isEmResetFrame");var pp={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},tV={$type:"Entry",axis:"axis",value:"value"},ff={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},qme={$type:"Evolution",stages:"stages"},Z8={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},rV={$type:"Evolve",component:"component",target:"target"},r1={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function scr(t){return Qs.isInstance(t,r1.$type)}M(scr,"isGitGraph");var EC={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Tk={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function acr(t){return Qs.isInstance(t,Tk.$type)}M(acr,"isInfo");var AC={$type:"Item",classSelector:"classSelector",name:"name"},nV={$type:"Junction",id:"id",in:"in"},MC={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},Q8={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},$m={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},N2={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function ocr(t){return Qs.isInstance(t,N2.$type)}M(ocr,"isMerge");var J8={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},iV={$type:"Option",name:"name",value:"value"},D2={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function lcr(t){return Qs.isInstance(t,D2.$type)}M(lcr,"isPacket");var O2={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function ccr(t){return Qs.isInstance(t,O2.$type)}M(ccr,"isPacketBlock");var Ume={$type:"PegAny",dot:"dot"},Yme={$type:"PegGroup",element:"element"},jme={$type:"PegIdentifier",name:"name"},Xme={$type:"PegLiteral",value:"value"},Kme={$type:"PegOrderedChoice",alternatives:"alternatives"},sV={$type:"PegPrefix",operator:"operator",suffix:"suffix"},RC={$type:"PegPrimary"},aV={$type:"PegRule",definition:"definition",name:"name"},Zme={$type:"PegSequence",elements:"elements"},oV={$type:"PegSuffix",operator:"operator",primary:"primary"},n1={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function ucr(t){return Qs.isInstance(t,n1.$type)}M(ucr,"isPie");var IR={$type:"PieSection",label:"label",value:"value"};function hcr(t){return Qs.isInstance(t,IR.$type)}M(hcr,"isPieSection");var lV={$type:"Pipeline",components:"components",parent:"parent"},eM={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Bm={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},P2={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function dcr(t){return Qs.isInstance(t,P2.$type)}M(dcr,"isRailroad");var $2={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function fcr(t){return Qs.isInstance(t,$2.$type)}M(fcr,"isRailroadAbnf");var Qme={$type:"RailroadChoiceExpr",alternatives:"alternatives"},B2={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function pcr(t){return Qs.isInstance(t,B2.$type)}M(pcr,"isRailroadEbnf");var pf={$type:"RailroadExpression"},Jme={$type:"RailroadNonTerminalExpr",name:"name"},e1e={$type:"RailroadOneOrMoreExpr",element:"element"},t1e={$type:"RailroadOptionalExpr",element:"element"},F2={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function gcr(t){return Qs.isInstance(t,F2.$type)}M(gcr,"isRailroadPeg");var cV={$type:"RailroadRule",definition:"definition",name:"name"},r1e={$type:"RailroadSequenceExpr",elements:"elements"},n1e={$type:"RailroadSpecialExpr",text:"text"},i1e={$type:"RailroadTerminalExpr",value:"value"},s1e={$type:"RailroadZeroOrMoreExpr",element:"element"},uV={$type:"Section",classSelector:"classSelector",name:"name"},i2={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},hV={$type:"Size",height:"height",width:"width"},s2={$type:"Statement"},Ck={$type:"Transition",from:"from",label:"label",to:"to"};function mcr(t){return Qs.isInstance(t,Ck.$type)}M(mcr,"isTransition");var z2={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function ycr(t){return Qs.isInstance(t,z2.$type)}M(ycr,"isTreemap");var dV={$type:"TreemapRow",indent:"indent",item:"item"},a2={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},_C={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},ho={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function vcr(t){return Qs.isInstance(t,ho.$type)}M(vcr,"isWardley");var Rw,gGe=(Rw=class extends kee{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Cme.$type,properties:{alternatives:{name:Cme.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:kme.$type,properties:{elements:{name:kme.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Yz.$type,properties:{primary:{name:Yz.primary},repeat:{name:Yz.repeat}},superTypes:[]},AbnfGroup:{name:Sme.$type,properties:{element:{name:Sme.element}},superTypes:[t2.$type]},AbnfNumVal:{name:Eme.$type,properties:{value:{name:Eme.value}},superTypes:[t2.$type]},AbnfOptionalGroup:{name:Ame.$type,properties:{element:{name:Ame.element}},superTypes:[t2.$type]},AbnfPrimary:{name:t2.$type,properties:{},superTypes:[]},AbnfRule:{name:jz.$type,properties:{definition:{name:jz.definition},name:{name:jz.name}},superTypes:[]},AbnfRuleName:{name:Mme.$type,properties:{name:{name:Mme.name}},superTypes:[t2.$type]},AbnfStringLiteral:{name:Rme.$type,properties:{value:{name:Rme.value}},superTypes:[t2.$type]},Accelerator:{name:G8.$type,properties:{name:{name:G8.name},x:{name:G8.x},y:{name:G8.y}},superTypes:[]},Alignment:{name:Xz.$type,properties:{direction:{name:Xz.direction},members:{name:Xz.members,defaultValue:[]}},superTypes:[]},Anchor:{name:W8.$type,properties:{evolution:{name:W8.evolution},name:{name:W8.name},visibility:{name:W8.visibility}},superTypes:[]},Annotation:{name:CC.$type,properties:{number:{name:CC.number},text:{name:CC.text},x:{name:CC.x},y:{name:CC.y}},superTypes:[]},Annotations:{name:Kz.$type,properties:{x:{name:Kz.x},y:{name:Kz.y}},superTypes:[]},Architecture:{name:Yh.$type,properties:{accDescr:{name:Yh.accDescr},accTitle:{name:Yh.accTitle},alignments:{name:Yh.alignments,defaultValue:[]},edges:{name:Yh.edges,defaultValue:[]},groups:{name:Yh.groups,defaultValue:[]},junctions:{name:Yh.junctions,defaultValue:[]},services:{name:Yh.services,defaultValue:[]},title:{name:Yh.title}},superTypes:[]},Axis:{name:q8.$type,properties:{label:{name:q8.label},name:{name:q8.name}},superTypes:[]},Branch:{name:_R.$type,properties:{name:{name:_R.name},order:{name:_R.order}},superTypes:[s2.$type]},Checkout:{name:_me.$type,properties:{branch:{name:_me.branch}},superTypes:[s2.$type]},CherryPicking:{name:U8.$type,properties:{id:{name:U8.id},parent:{name:U8.parent},tags:{name:U8.tags,defaultValue:[]}},superTypes:[s2.$type]},ClassDefStatement:{name:Zz.$type,properties:{className:{name:Zz.className},styleText:{name:Zz.styleText}},superTypes:[]},Commit:{name:I2.$type,properties:{id:{name:I2.id},message:{name:I2.message},tags:{name:I2.tags,defaultValue:[]},type:{name:I2.type}},superTypes:[s2.$type]},Common:{name:Y8.$type,properties:{accDescr:{name:Y8.accDescr},accTitle:{name:Y8.accTitle},title:{name:Y8.title}},superTypes:[]},Component:{name:Dm.$type,properties:{decorator:{name:Dm.decorator},evolution:{name:Dm.evolution},inertia:{name:Dm.inertia,defaultValue:!1},label:{name:Dm.label},name:{name:Dm.name},visibility:{name:Dm.visibility}},superTypes:[]},Curve:{name:j8.$type,properties:{entries:{name:j8.entries,defaultValue:[]},label:{name:j8.label},name:{name:j8.name}},superTypes:[]},Cynefin:{name:t1.$type,properties:{accDescr:{name:t1.accDescr},accTitle:{name:t1.accTitle},domains:{name:t1.domains,defaultValue:[]},title:{name:t1.title},transitions:{name:t1.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:X8.$type,properties:{name:{name:X8.name},x:{name:X8.x},y:{name:X8.y}},superTypes:[]},Decorator:{name:Lme.$type,properties:{strategy:{name:Lme.strategy}},superTypes:[]},Direction:{name:r2.$type,properties:{accDescr:{name:r2.accDescr},accTitle:{name:r2.accTitle},dir:{name:r2.dir},statements:{name:r2.statements,defaultValue:[]},title:{name:r2.title}},superTypes:[r1.$type]},DomainBlock:{name:LR.$type,properties:{domain:{name:LR.domain},items:{name:LR.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:KY.$type,properties:{label:{name:KY.label}},superTypes:[]},EbnfChoice:{name:Ime.$type,properties:{alternatives:{name:Ime.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Nme.$type,properties:{except:{name:Nme.except}},superTypes:[kC.$type]},EbnfGroup:{name:Dme.$type,properties:{element:{name:Dme.element}},superTypes:[Om.$type]},EbnfNonTerminal:{name:Ome.$type,properties:{name:{name:Ome.name}},superTypes:[Om.$type]},EbnfOneOrMorePostfix:{name:Pme.$type,properties:{operator:{name:Pme.operator}},superTypes:[kC.$type]},EbnfOptional:{name:$me.$type,properties:{element:{name:$me.element}},superTypes:[Om.$type]},EbnfOptionalPostfix:{name:Bme.$type,properties:{operator:{name:Bme.operator}},superTypes:[kC.$type]},EbnfPostfix:{name:kC.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Om.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Fme.$type,properties:{element:{name:Fme.element}},superTypes:[Om.$type]},EbnfRule:{name:Qz.$type,properties:{definition:{name:Qz.definition},name:{name:Qz.name}},superTypes:[]},EbnfSequence:{name:zme.$type,properties:{elements:{name:zme.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Vme.$type,properties:{text:{name:Vme.text}},superTypes:[Om.$type]},EbnfTerm:{name:Jz.$type,properties:{base:{name:Jz.base},postfixes:{name:Jz.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Hme.$type,properties:{value:{name:Hme.value}},superTypes:[Om.$type]},EbnfZeroOrMorePostfix:{name:Gme.$type,properties:{operator:{name:Gme.operator}},superTypes:[kC.$type]},Edge:{name:zh.$type,properties:{lhsDir:{name:zh.lhsDir},lhsGroup:{name:zh.lhsGroup,defaultValue:!1},lhsId:{name:zh.lhsId},lhsInto:{name:zh.lhsInto,defaultValue:!1},rhsDir:{name:zh.rhsDir},rhsGroup:{name:zh.rhsGroup,defaultValue:!1},rhsId:{name:zh.rhsId},rhsInto:{name:zh.rhsInto,defaultValue:!1},title:{name:zh.title}},superTypes:[]},EmDataEntity:{name:n2.$type,properties:{dataBlockValue:{name:n2.dataBlockValue},dataType:{name:n2.dataType},name:{name:n2.name}},superTypes:[]},EmFrame:{name:Pm.$type,properties:{},superTypes:[]},EmGwt:{name:SC.$type,properties:{givenStatements:{name:SC.givenStatements,defaultValue:[]},sourceFrame:{name:SC.sourceFrame,referenceType:Pm.$type},thenStatements:{name:SC.thenStatements,defaultValue:[]},whenStatements:{name:SC.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Wme.$type,properties:{entityIdentifier:{name:Wme.entityIdentifier,referenceType:eV.$type}},superTypes:[]},EmModelEntity:{name:eV.$type,properties:{name:{name:eV.name}},superTypes:[]},EmNoteEntity:{name:K8.$type,properties:{dataBlockValue:{name:K8.dataBlockValue},dataType:{name:K8.dataType},sourceFrame:{name:K8.sourceFrame,referenceType:Pm.$type}},superTypes:[]},EmResetFrame:{name:Tf.$type,properties:{dataInlineValue:{name:Tf.dataInlineValue},dataReference:{name:Tf.dataReference,referenceType:n2.$type},dataType:{name:Tf.dataType},entityIdentifier:{name:Tf.entityIdentifier},modelEntityType:{name:Tf.modelEntityType},name:{name:Tf.name},sourceFrames:{name:Tf.sourceFrames,defaultValue:[],referenceType:Pm.$type}},superTypes:[Pm.$type]},EmTimeFrame:{name:pp.$type,properties:{dataInlineValue:{name:pp.dataInlineValue},dataReference:{name:pp.dataReference,referenceType:n2.$type},dataType:{name:pp.dataType},entityIdentifier:{name:pp.entityIdentifier},modelEntityType:{name:pp.modelEntityType},name:{name:pp.name},sourceFrames:{name:pp.sourceFrames,defaultValue:[],referenceType:Pm.$type}},superTypes:[Pm.$type]},Entry:{name:tV.$type,properties:{axis:{name:tV.axis,referenceType:q8.$type},value:{name:tV.value}},superTypes:[]},EventModel:{name:ff.$type,properties:{accDescr:{name:ff.accDescr},accTitle:{name:ff.accTitle},dataEntities:{name:ff.dataEntities,defaultValue:[]},frames:{name:ff.frames,defaultValue:[]},gwtEntities:{name:ff.gwtEntities,defaultValue:[]},modelEntities:{name:ff.modelEntities,defaultValue:[]},noteEntities:{name:ff.noteEntities,defaultValue:[]},title:{name:ff.title}},superTypes:[]},Evolution:{name:qme.$type,properties:{stages:{name:qme.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:Z8.$type,properties:{boundary:{name:Z8.boundary},name:{name:Z8.name},secondName:{name:Z8.secondName}},superTypes:[]},Evolve:{name:rV.$type,properties:{component:{name:rV.component},target:{name:rV.target}},superTypes:[]},GitGraph:{name:r1.$type,properties:{accDescr:{name:r1.accDescr},accTitle:{name:r1.accTitle},statements:{name:r1.statements,defaultValue:[]},title:{name:r1.title}},superTypes:[]},Group:{name:EC.$type,properties:{icon:{name:EC.icon},id:{name:EC.id},in:{name:EC.in},title:{name:EC.title}},superTypes:[]},Info:{name:Tk.$type,properties:{accDescr:{name:Tk.accDescr},accTitle:{name:Tk.accTitle},title:{name:Tk.title}},superTypes:[]},Item:{name:AC.$type,properties:{classSelector:{name:AC.classSelector},name:{name:AC.name}},superTypes:[]},Junction:{name:nV.$type,properties:{id:{name:nV.id},in:{name:nV.in}},superTypes:[]},Label:{name:MC.$type,properties:{negX:{name:MC.negX,defaultValue:!1},negY:{name:MC.negY,defaultValue:!1},offsetX:{name:MC.offsetX},offsetY:{name:MC.offsetY}},superTypes:[]},Leaf:{name:Q8.$type,properties:{classSelector:{name:Q8.classSelector},name:{name:Q8.name},value:{name:Q8.value}},superTypes:[AC.$type]},Link:{name:$m.$type,properties:{arrow:{name:$m.arrow},from:{name:$m.from},fromPort:{name:$m.fromPort},linkLabel:{name:$m.linkLabel},to:{name:$m.to},toPort:{name:$m.toPort}},superTypes:[]},Merge:{name:N2.$type,properties:{branch:{name:N2.branch},id:{name:N2.id},tags:{name:N2.tags,defaultValue:[]},type:{name:N2.type}},superTypes:[s2.$type]},Note:{name:J8.$type,properties:{evolution:{name:J8.evolution},text:{name:J8.text},visibility:{name:J8.visibility}},superTypes:[]},Option:{name:iV.$type,properties:{name:{name:iV.name},value:{name:iV.value,defaultValue:!1}},superTypes:[]},Packet:{name:D2.$type,properties:{accDescr:{name:D2.accDescr},accTitle:{name:D2.accTitle},blocks:{name:D2.blocks,defaultValue:[]},title:{name:D2.title}},superTypes:[]},PacketBlock:{name:O2.$type,properties:{bits:{name:O2.bits},end:{name:O2.end},label:{name:O2.label},start:{name:O2.start}},superTypes:[]},PegAny:{name:Ume.$type,properties:{dot:{name:Ume.dot}},superTypes:[RC.$type]},PegGroup:{name:Yme.$type,properties:{element:{name:Yme.element}},superTypes:[RC.$type]},PegIdentifier:{name:jme.$type,properties:{name:{name:jme.name}},superTypes:[RC.$type]},PegLiteral:{name:Xme.$type,properties:{value:{name:Xme.value}},superTypes:[RC.$type]},PegOrderedChoice:{name:Kme.$type,properties:{alternatives:{name:Kme.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:sV.$type,properties:{operator:{name:sV.operator},suffix:{name:sV.suffix}},superTypes:[]},PegPrimary:{name:RC.$type,properties:{},superTypes:[]},PegRule:{name:aV.$type,properties:{definition:{name:aV.definition},name:{name:aV.name}},superTypes:[]},PegSequence:{name:Zme.$type,properties:{elements:{name:Zme.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:oV.$type,properties:{operator:{name:oV.operator},primary:{name:oV.primary}},superTypes:[]},Pie:{name:n1.$type,properties:{accDescr:{name:n1.accDescr},accTitle:{name:n1.accTitle},sections:{name:n1.sections,defaultValue:[]},showData:{name:n1.showData,defaultValue:!1},title:{name:n1.title}},superTypes:[]},PieSection:{name:IR.$type,properties:{label:{name:IR.label},value:{name:IR.value}},superTypes:[]},Pipeline:{name:lV.$type,properties:{components:{name:lV.components,defaultValue:[]},parent:{name:lV.parent}},superTypes:[]},PipelineComponent:{name:eM.$type,properties:{evolution:{name:eM.evolution},label:{name:eM.label},name:{name:eM.name}},superTypes:[]},Radar:{name:Bm.$type,properties:{accDescr:{name:Bm.accDescr},accTitle:{name:Bm.accTitle},axes:{name:Bm.axes,defaultValue:[]},curves:{name:Bm.curves,defaultValue:[]},options:{name:Bm.options,defaultValue:[]},title:{name:Bm.title}},superTypes:[]},Railroad:{name:P2.$type,properties:{accDescr:{name:P2.accDescr},accTitle:{name:P2.accTitle},rules:{name:P2.rules,defaultValue:[]},title:{name:P2.title}},superTypes:[]},RailroadAbnf:{name:$2.$type,properties:{accDescr:{name:$2.accDescr},accTitle:{name:$2.accTitle},rules:{name:$2.rules,defaultValue:[]},title:{name:$2.title}},superTypes:[]},RailroadChoiceExpr:{name:Qme.$type,properties:{alternatives:{name:Qme.alternatives,defaultValue:[]}},superTypes:[pf.$type]},RailroadEbnf:{name:B2.$type,properties:{accDescr:{name:B2.accDescr},accTitle:{name:B2.accTitle},rules:{name:B2.rules,defaultValue:[]},title:{name:B2.title}},superTypes:[]},RailroadExpression:{name:pf.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Jme.$type,properties:{name:{name:Jme.name}},superTypes:[pf.$type]},RailroadOneOrMoreExpr:{name:e1e.$type,properties:{element:{name:e1e.element}},superTypes:[pf.$type]},RailroadOptionalExpr:{name:t1e.$type,properties:{element:{name:t1e.element}},superTypes:[pf.$type]},RailroadPeg:{name:F2.$type,properties:{accDescr:{name:F2.accDescr},accTitle:{name:F2.accTitle},rules:{name:F2.rules,defaultValue:[]},title:{name:F2.title}},superTypes:[]},RailroadRule:{name:cV.$type,properties:{definition:{name:cV.definition},name:{name:cV.name}},superTypes:[]},RailroadSequenceExpr:{name:r1e.$type,properties:{elements:{name:r1e.elements,defaultValue:[]}},superTypes:[pf.$type]},RailroadSpecialExpr:{name:n1e.$type,properties:{text:{name:n1e.text}},superTypes:[pf.$type]},RailroadTerminalExpr:{name:i1e.$type,properties:{value:{name:i1e.value}},superTypes:[pf.$type]},RailroadZeroOrMoreExpr:{name:s1e.$type,properties:{element:{name:s1e.element}},superTypes:[pf.$type]},Section:{name:uV.$type,properties:{classSelector:{name:uV.classSelector},name:{name:uV.name}},superTypes:[AC.$type]},Service:{name:i2.$type,properties:{icon:{name:i2.icon},iconText:{name:i2.iconText},id:{name:i2.id},in:{name:i2.in},title:{name:i2.title}},superTypes:[]},Size:{name:hV.$type,properties:{height:{name:hV.height},width:{name:hV.width}},superTypes:[]},Statement:{name:s2.$type,properties:{},superTypes:[]},Transition:{name:Ck.$type,properties:{from:{name:Ck.from},label:{name:Ck.label},to:{name:Ck.to}},superTypes:[]},TreeNode:{name:a2.$type,properties:{classAnnotation:{name:a2.classAnnotation},descAnnotation:{name:a2.descAnnotation},iconAnnotation:{name:a2.iconAnnotation},indent:{name:a2.indent},name:{name:a2.name}},superTypes:[]},TreeView:{name:_C.$type,properties:{accDescr:{name:_C.accDescr},accTitle:{name:_C.accTitle},nodes:{name:_C.nodes,defaultValue:[]},title:{name:_C.title}},superTypes:[]},Treemap:{name:z2.$type,properties:{accDescr:{name:z2.accDescr},accTitle:{name:z2.accTitle},title:{name:z2.title},TreemapRows:{name:z2.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:dV.$type,properties:{indent:{name:dV.indent},item:{name:dV.item}},superTypes:[]},Wardley:{name:ho.$type,properties:{accDescr:{name:ho.accDescr},accelerators:{name:ho.accelerators,defaultValue:[]},accTitle:{name:ho.accTitle},anchors:{name:ho.anchors,defaultValue:[]},annotation:{name:ho.annotation,defaultValue:[]},annotations:{name:ho.annotations,defaultValue:[]},components:{name:ho.components,defaultValue:[]},deaccelerators:{name:ho.deaccelerators,defaultValue:[]},evolution:{name:ho.evolution},evolves:{name:ho.evolves,defaultValue:[]},links:{name:ho.links,defaultValue:[]},notes:{name:ho.notes,defaultValue:[]},pipelines:{name:ho.pipelines,defaultValue:[]},size:{name:ho.size},title:{name:ho.title}},superTypes:[]}}}},M(Rw,"MermaidAstReflection"),Rw),Qs=new gGe,a1e,bcr=M(()=>a1e??(a1e=io(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),o1e,xcr=M(()=>o1e??(o1e=io(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),l1e,wcr=M(()=>l1e??(l1e=io('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),c1e,Tcr=M(()=>c1e??(c1e=io(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),u1e,Ccr=M(()=>u1e??(u1e=io(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),h1e,kcr=M(()=>h1e??(h1e=io(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),d1e,Scr=M(()=>d1e??(d1e=io(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),f1e,Ecr=M(()=>f1e??(f1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),p1e,Acr=M(()=>p1e??(p1e=io('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),g1e,Mcr=M(()=>g1e??(g1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),m1e,Rcr=M(()=>m1e??(m1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),y1e,_cr=M(()=>y1e??(y1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),v1e,Lcr=M(()=>v1e??(v1e=io(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),b1e,Icr=M(()=>b1e??(b1e=io(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),x1e,Ncr=M(()=>x1e??(x1e=io(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Dcr={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ocr={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Pcr={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$cr={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bcr={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Fcr={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zcr={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vcr={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Hcr={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gcr={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wcr={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qcr={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ucr={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ycr={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jcr={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vl={AstReflection:M(()=>new gGe,"AstReflection")},Xcr={Grammar:M(()=>bcr(),"Grammar"),LanguageMetaData:M(()=>Dcr,"LanguageMetaData"),parser:{}},Kcr={Grammar:M(()=>xcr(),"Grammar"),LanguageMetaData:M(()=>Ocr,"LanguageMetaData"),parser:{}},Zcr={Grammar:M(()=>wcr(),"Grammar"),LanguageMetaData:M(()=>Pcr,"LanguageMetaData"),parser:{}},Qcr={Grammar:M(()=>Tcr(),"Grammar"),LanguageMetaData:M(()=>$cr,"LanguageMetaData"),parser:{}},Jcr={Grammar:M(()=>Ccr(),"Grammar"),LanguageMetaData:M(()=>Bcr,"LanguageMetaData"),parser:{}},eur={Grammar:M(()=>kcr(),"Grammar"),LanguageMetaData:M(()=>Fcr,"LanguageMetaData"),parser:{}},tur={Grammar:M(()=>Scr(),"Grammar"),LanguageMetaData:M(()=>zcr,"LanguageMetaData"),parser:{}},rur={Grammar:M(()=>Ecr(),"Grammar"),LanguageMetaData:M(()=>Vcr,"LanguageMetaData"),parser:{}},nur={Grammar:M(()=>Acr(),"Grammar"),LanguageMetaData:M(()=>Hcr,"LanguageMetaData"),parser:{}},iur={Grammar:M(()=>Mcr(),"Grammar"),LanguageMetaData:M(()=>Gcr,"LanguageMetaData"),parser:{}},sur={Grammar:M(()=>Rcr(),"Grammar"),LanguageMetaData:M(()=>Wcr,"LanguageMetaData"),parser:{}},aur={Grammar:M(()=>_cr(),"Grammar"),LanguageMetaData:M(()=>qcr,"LanguageMetaData"),parser:{}},our={Grammar:M(()=>Lcr(),"Grammar"),LanguageMetaData:M(()=>Ucr,"LanguageMetaData"),parser:{}},lur={Grammar:M(()=>Icr(),"Grammar"),LanguageMetaData:M(()=>Ycr,"LanguageMetaData"),parser:{}},cur={Grammar:M(()=>Ncr(),"Grammar"),LanguageMetaData:M(()=>jcr,"LanguageMetaData"),parser:{}},uur=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,hur=/accTitle[\t ]*:([^\n\r]*)/,dur=/title([\t ][^\n\r]*|)/,fur={ACC_DESCR:uur,ACC_TITLE:hur,TITLE:dur},_w,tf=(_w=class extends Ore{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=fur[e.name];if(i===void 0)return;const s=i.exec(r);if(s!==null){if(s[1]!==void 0)return s[1].trim().replace(/[\t ]{2,}/gm," ");if(s[2]!==void 0)return s[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},M(_w,"AbstractMermaidValueConverter"),_w),Lw,P3=(Lw=class extends tf{runCustomConverter(e,r,n){}},M(Lw,"CommonValueConverter"),Lw),Iw,Hl=(Iw=class extends fP{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},M(Iw,"AbstractMermaidTokenBuilder"),Iw),Nw;Nw=class extends Hl{},M(Nw,"CommonTokenBuilder");/*! Bundled license information: +`}M(OY,"fillNewlines");var bw,uGe=(bw=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Jre(r))return Qre(r).toMarkdown({renderLink:M((i,s)=>this.documentationLinkRenderer(e,i,s),"renderLink"),renderTag:M(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=wh(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(l=>l.name===r);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},M(bw,"JSDocDocumentationProvider"),bw),xw,hGe=(xw=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Yre(e)?e.$comment:(r=tte(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},M(xw,"DefaultCommentProvider"),xw),ww,dGe=(ww=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},M(ww,"DefaultAsyncParser"),ww),Tw,lcr=(Tw=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new D0;let s;const a=r.onCancellationRequested(()=>{s=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{a.dispose(),clearTimeout(s)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new D0;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(xd)}),this.queue.push(r),r.promise}},M(Tw,"AbstractThreadedAsyncParser"),Tw),Cw,ccr=(Cw=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new wP.Emitter,this.deferred=new D0,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(s=>{const a=s;this.deferred.resolve(a),this.unlock()}),n(s=>{this.deferred.reject(s),this.unlock()})}terminate(){this.deferred.reject(xd),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 D0,this.sendMessage(e),this.deferred.promise}},M(Cw,"ParserWorker"),Cw),kw,fGe=(kw=class{constructor(){this.previousTokenSource=new $i.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=vP();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=$i.CancellationToken.None){const i=new D0,s={action:r,deferred:i,cancellationToken:n};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>r(i));n.resolve(s)}catch(s){Mv(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},M(kw,"DefaultWorkspaceLock"),kw),Sw,pGe=(Sw=class{constructor(e){this.grammarElementIdMap=new II,this.tokenTypeIdMap=new II,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Th(e))r.set(i,{});if(e.$cstNode)for(const i of O5(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];n[i]=a;for(const o of s)aa(o)?a.push(this.dehydrateAstNode(o,r)):Cl(o)?a.push(this.dehydrateReference(o,r)):a.push(o)}else aa(s)?n[i]=this.dehydrateAstNode(s,r):Cl(s)?n[i]=this.dehydrateReference(s,r):s!==void 0&&(n[i]=s);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return vO(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),E0(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):cv(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const s of Th(e))r.set(s,{});let i;if(e.$cstNode)for(const s of O5(e.$cstNode)){let a;"fullText"in s?(a=new Lre(s.fullText),i=a):"content"in s?a=new fP:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(n.set(s,a),a.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];n[i]=a;for(const o of s)aa(o)?a.push(this.setParent(this.hydrateAstNode(o,r),n)):Cl(o)?a.push(this.hydrateReference(o,n,i,r)):a.push(o)}else aa(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):Cl(s)?n[i]=this.hydrateReference(s,n,i,r):s!==void 0&&(n[i]=s);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),E0(i))for(const s of e.content){const a=this.hydrateCstNode(s,r,n++);i.content.push(a)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new AI(n,i,{start:{line:s,character:a},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Th(this.grammar))bO(r)&&this.grammarElementIdMap.set(r,e++)}},M(Sw,"DefaultHydrator"),Sw);function ro(t){return{documentation:{CommentProvider:M(e=>new hGe(e),"CommentProvider"),DocumentationProvider:M(e=>new uGe(e),"DocumentationProvider")},parser:{AsyncParser:M(e=>new dGe(e),"AsyncParser"),GrammarConfig:M(e=>Ste(e),"GrammarConfig"),LangiumParser:M(e=>$re(e),"LangiumParser"),CompletionParser:M(e=>Pre(e),"CompletionParser"),ValueConverter:M(()=>new Fre,"ValueConverter"),TokenBuilder:M(()=>new mP,"TokenBuilder"),Lexer:M(e=>new Zre(e),"Lexer"),ParserErrorMessageProvider:M(()=>new Nre,"ParserErrorMessageProvider"),LexerErrorMessageProvider:M(()=>new JHe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:M(()=>new jHe,"AstNodeLocator"),AstNodeDescriptionProvider:M(e=>new UHe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:M(e=>new YHe(e),"ReferenceDescriptionProvider")},references:{Linker:M(e=>new DHe(e),"Linker"),NameProvider:M(()=>new OHe,"NameProvider"),ScopeProvider:M(e=>new zHe(e),"ScopeProvider"),ScopeComputation:M(e=>new $He(e),"ScopeComputation"),References:M(e=>new PHe(e),"References")},serializer:{Hydrator:M(e=>new pGe(e),"Hydrator"),JsonSerializer:M(e=>new VHe(e),"JsonSerializer")},validation:{DocumentValidator:M(e=>new qHe(e),"DocumentValidator"),ValidationRegistry:M(e=>new GHe(e),"ValidationRegistry")},shared:M(()=>t.shared,"shared")}}M(ro,"createDefaultCoreModule");function no(t){return{ServiceRegistry:M(e=>new HHe(e),"ServiceRegistry"),workspace:{LangiumDocuments:M(e=>new NHe(e),"LangiumDocuments"),LangiumDocumentFactory:M(e=>new IHe(e),"LangiumDocumentFactory"),DocumentBuilder:M(e=>new KHe(e),"DocumentBuilder"),IndexManager:M(e=>new ZHe(e),"IndexManager"),WorkspaceManager:M(e=>new QHe(e),"WorkspaceManager"),FileSystemProvider:M(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:M(()=>new fGe,"WorkspaceLock"),ConfigurationProvider:M(e=>new XHe(e),"ConfigurationProvider")},profilers:{}}}M(no,"createDefaultSharedCoreModule");var PY;(function(t){t.merge=(e,r)=>z5(z5({},e),r)})(PY||(PY={}));function Hn(t,e,r,n,i,s,a,o,l){const u=[t,e,r,n,i,s,a,o,l].reduce(z5,{});return sne(u)}M(Hn,"inject");var gGe=Symbol("isProxy");function ine(t){if(t&&t[gGe])for(const e of Object.values(t))ine(e);return t}M(ine,"eagerLoad");function sne(t,e){const r=new Proxy({},{deleteProperty:M(()=>!1,"deleteProperty"),set:M(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:M((n,i)=>i===gGe?!0:$Y(n,i,t,e||r),"get"),getOwnPropertyDescriptor:M((n,i)=>($Y(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:M((n,i)=>i in t,"has"),ownKeys:M(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}M(sne,"_inject");var Mme=Symbol();function $Y(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===Mme)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=Mme;try{t[e]=typeof i=="function"?i(n):sne(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}M($Y,"_resolve");function z5(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=z5(i,n):t[r]=z5({},n)}else t[r]=n}return t}M(z5,"_merge");var BY={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},W1;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(W1||(W1={}));var Ew,mGe=(Ew=class extends mP{constructor(e=BY){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...BY,...e},this.indentTokenType=Wb({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Wb({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!TP(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:s,whitespaceTokenName:a,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=W1.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===s?l=f:f.name===i?u=f:f.name===a?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[W1.REGULAR]:[l,u,...d,h],[W1.IGNORE_INDENTATION]:[...d,h]},defaultMode:W1.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const s=this.whitespaceRegExp.exec(e);return{currIndentLevel:(s==null?void 0:s[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:s}}createIndentationTokenInstance(e,r,n,i){const s=this.getLineNumber(r,i);return Y7(e,n,i,i+n.length,s,s,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);return s<=a?null:(this.indentationStack.push(s),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);if(s>=a)return null;const l=this.indentationStack.lastIndexOf(s);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${s} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},M(Ew,"IndentationAwareTokenBuilder"),Ew),Aw,ucr=(Aw=class extends Zre{constructor(e){if(super(e),e.parser.TokenBuilder instanceof mGe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Kre){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:s,dedentTokenType:a}=this.indentationTokenBuilder,o=s.tokenTypeIdx,l=a.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},M(Aw,"IndentationAwareLexer"),Aw),ane={};um(ane,{AstUtils:()=>Ree,BiMap:()=>II,Cancellation:()=>$i,ContextCache:()=>xP,CstUtils:()=>Eee,DONE_RESULT:()=>fl,Deferred:()=>D0,Disposable:()=>iy,DisposableCache:()=>bP,DocumentCache:()=>FHe,EMPTY_STREAM:()=>_5,ErrorWithLocation:()=>EO,GrammarUtils:()=>ste,MultiMap:()=>O0,OperationCancelled:()=>xd,Reduction:()=>eE,RegExpUtils:()=>ote,SimpleCache:()=>qre,StreamImpl:()=>bd,TreeStreamImpl:()=>L5,URI:()=>Hc,UriTrie:()=>Gre,UriUtils:()=>kl,WorkspaceCache:()=>Ure,assertCondition:()=>ate,assertUnreachable:()=>hm,delayNextTick:()=>yP,interruptAndCheck:()=>za,isOperationCancelled:()=>Mv,loadGrammarFromJson:()=>io,setInterruptionPeriod:()=>zre,startCancelableOperation:()=>vP,stream:()=>yi});gO(ane,wP);var Mw,yGe=(Mw=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[]}},M(Mw,"EmptyFileSystemProvider"),Mw),_o={fileSystemProvider:M(()=>new yGe,"fileSystemProvider")},hcr={Grammar:M(()=>{},"Grammar"),LanguageMetaData:M(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},dcr={AstReflection:M(()=>new Kee,"AstReflection")};function vGe(){const t=Hn(no(_o),dcr),e=Hn(ro({shared:t}),hcr);return t.ServiceRegistry.register(e),e}M(vGe,"createMinimalGrammarServices");function io(t){const e=vGe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Hc.parse(`memory:/${r.name??"grammar"}.langium`)),r}M(io,"loadGrammarFromJson");gO(RIe,ane);var Rw,fcr=(Rw=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new O0}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 bGe(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const a of r.entries.keys()){const o=r.entries.get(a),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${a}`,count:o.length,duration:l})}const i=r.duration-n.map(a=>a.duration).reduce((a,o)=>a+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((a,o)=>o.duration-a.duration);function s(a){return Math.round(100*a)/100}return M(s,"Round"),console.table(n.map(a=>({Element:a.name,Count:a.count,"Self %":s(100*a.duration/r.duration),"Time (ms)":s(a.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},M(Rw,"DefaultLangiumProfiler"),Rw),_w,bGe=(_w=class{constructor(e,r){this.stack=[],this.entries=new O0,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},M(_w,"ProfilingTask"),_w),FY;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(FY||(FY={}));var zY;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(zY||(zY={}));var VY;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(VY||(VY={}));var HY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(HY||(HY={}));var GY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(GY||(GY={}));var WY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(WY||(WY={}));var qY;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(qY||(qY={}));var UY;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(UY||(UY={}));var YY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(YY||(YY={}));var jY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(jY||(jY={}));var XY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(XY||(XY={}));var KY;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(KY||(KY={}));var ZY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(ZY||(ZY={}));var QY;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(QY||(QY={}));var JY;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(JY||(JY={}));({...FY.Terminals,...zY.Terminals,...VY.Terminals,...HY.Terminals,...GY.Terminals,...WY.Terminals,...qY.Terminals,...UY.Terminals,...YY.Terminals,...jY.Terminals,...XY.Terminals,...KY.Terminals,...QY.Terminals,...ZY.Terminals,...JY.Terminals});var Rme={$type:"AbnfAlternation",alternatives:"alternatives"},_me={$type:"AbnfConcatenation",elements:"elements"},Zz={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Lme={$type:"AbnfGroup",element:"element"},Ime={$type:"AbnfNumVal",value:"value"},Nme={$type:"AbnfOptionalGroup",element:"element"},n2={$type:"AbnfPrimary"},Qz={$type:"AbnfRule",definition:"definition",name:"name"},Dme={$type:"AbnfRuleName",name:"name"},Ome={$type:"AbnfStringLiteral",value:"value"},Y8={$type:"Accelerator",name:"name",x:"x",y:"y"},Jz={$type:"Alignment",direction:"direction",members:"members"},j8={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},EC={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},eV={$type:"Annotations",x:"x",y:"y"},Kh={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function pcr(t){return Qs.isInstance(t,Kh.$type)}M(pcr,"isArchitecture");var X8={$type:"Axis",label:"label",name:"name"},DR={$type:"Branch",name:"name",order:"order"};function gcr(t){return Qs.isInstance(t,DR.$type)}M(gcr,"isBranch");var Pme={$type:"Checkout",branch:"branch"},K8={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},tV={$type:"ClassDefStatement",className:"className",styleText:"styleText"},D2={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function mcr(t){return Qs.isInstance(t,D2.$type)}M(mcr,"isCommit");var Z8={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},$m={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},Q8={$type:"Curve",entries:"entries",label:"label",name:"name"},i1={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function ycr(t){return Qs.isInstance(t,i1.$type)}M(ycr,"isCynefin");var J8={$type:"Deaccelerator",name:"name",x:"x",y:"y"},$me={$type:"Decorator",strategy:"strategy"},i2={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},OR={$type:"DomainBlock",domain:"domain",items:"items"};function vcr(t){return Qs.isInstance(t,OR.$type)}M(vcr,"isDomainBlock");var ej={$type:"DomainItem",label:"label"};function bcr(t){return Qs.isInstance(t,ej.$type)}M(bcr,"isDomainItem");var Bme={$type:"EbnfChoice",alternatives:"alternatives"},Fme={$type:"EbnfExceptionPostfix",except:"except"},zme={$type:"EbnfGroup",element:"element"},Vme={$type:"EbnfNonTerminal",name:"name"},Hme={$type:"EbnfOneOrMorePostfix",operator:"operator"},Gme={$type:"EbnfOptional",element:"element"},Wme={$type:"EbnfOptionalPostfix",operator:"operator"},AC={$type:"EbnfPostfix"},Bm={$type:"EbnfPrimary"},qme={$type:"EbnfRepetition",element:"element"},rV={$type:"EbnfRule",definition:"definition",name:"name"},Ume={$type:"EbnfSequence",elements:"elements"},Yme={$type:"EbnfSpecial",text:"text"},nV={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},jme={$type:"EbnfTerminal",value:"value"},Xme={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Gh={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},s2={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Fm={$type:"EmFrame"},MC={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Kme={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},iV={$type:"EmModelEntity",name:"name"};function xcr(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}M(xcr,"isEmModelEntityType");var eM={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Sf={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function xGe(t){return Qs.isInstance(t,Sf.$type)}M(xGe,"isEmResetFrame");var vp={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},sV={$type:"Entry",axis:"axis",value:"value"},mf={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Zme={$type:"Evolution",stages:"stages"},tM={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},aV={$type:"Evolve",component:"component",target:"target"},s1={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function wcr(t){return Qs.isInstance(t,s1.$type)}M(wcr,"isGitGraph");var RC={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Sk={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Tcr(t){return Qs.isInstance(t,Sk.$type)}M(Tcr,"isInfo");var _C={$type:"Item",classSelector:"classSelector",name:"name"},oV={$type:"Junction",id:"id",in:"in"},LC={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},rM={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},zm={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},O2={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Ccr(t){return Qs.isInstance(t,O2.$type)}M(Ccr,"isMerge");var nM={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},lV={$type:"Option",name:"name",value:"value"},P2={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function kcr(t){return Qs.isInstance(t,P2.$type)}M(kcr,"isPacket");var $2={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function Scr(t){return Qs.isInstance(t,$2.$type)}M(Scr,"isPacketBlock");var Qme={$type:"PegAny",dot:"dot"},Jme={$type:"PegGroup",element:"element"},e1e={$type:"PegIdentifier",name:"name"},t1e={$type:"PegLiteral",value:"value"},r1e={$type:"PegOrderedChoice",alternatives:"alternatives"},cV={$type:"PegPrefix",operator:"operator",suffix:"suffix"},IC={$type:"PegPrimary"},uV={$type:"PegRule",definition:"definition",name:"name"},n1e={$type:"PegSequence",elements:"elements"},hV={$type:"PegSuffix",operator:"operator",primary:"primary"},a1={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Ecr(t){return Qs.isInstance(t,a1.$type)}M(Ecr,"isPie");var PR={$type:"PieSection",label:"label",value:"value"};function Acr(t){return Qs.isInstance(t,PR.$type)}M(Acr,"isPieSection");var dV={$type:"Pipeline",components:"components",parent:"parent"},iM={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Vm={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},B2={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Mcr(t){return Qs.isInstance(t,B2.$type)}M(Mcr,"isRailroad");var F2={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Rcr(t){return Qs.isInstance(t,F2.$type)}M(Rcr,"isRailroadAbnf");var i1e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},z2={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function _cr(t){return Qs.isInstance(t,z2.$type)}M(_cr,"isRailroadEbnf");var yf={$type:"RailroadExpression"},s1e={$type:"RailroadNonTerminalExpr",name:"name"},a1e={$type:"RailroadOneOrMoreExpr",element:"element"},o1e={$type:"RailroadOptionalExpr",element:"element"},V2={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Lcr(t){return Qs.isInstance(t,V2.$type)}M(Lcr,"isRailroadPeg");var fV={$type:"RailroadRule",definition:"definition",name:"name"},l1e={$type:"RailroadSequenceExpr",elements:"elements"},c1e={$type:"RailroadSpecialExpr",text:"text"},u1e={$type:"RailroadTerminalExpr",value:"value"},h1e={$type:"RailroadZeroOrMoreExpr",element:"element"},pV={$type:"Section",classSelector:"classSelector",name:"name"},a2={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},gV={$type:"Size",height:"height",width:"width"},o2={$type:"Statement"},Ek={$type:"Transition",from:"from",label:"label",to:"to"};function Icr(t){return Qs.isInstance(t,Ek.$type)}M(Icr,"isTransition");var H2={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Ncr(t){return Qs.isInstance(t,H2.$type)}M(Ncr,"isTreemap");var mV={$type:"TreemapRow",indent:"indent",item:"item"},l2={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},NC={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},ho={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function Dcr(t){return Qs.isInstance(t,ho.$type)}M(Dcr,"isWardley");var Lw,wGe=(Lw=class extends Mee{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Rme.$type,properties:{alternatives:{name:Rme.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:_me.$type,properties:{elements:{name:_me.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Zz.$type,properties:{primary:{name:Zz.primary},repeat:{name:Zz.repeat}},superTypes:[]},AbnfGroup:{name:Lme.$type,properties:{element:{name:Lme.element}},superTypes:[n2.$type]},AbnfNumVal:{name:Ime.$type,properties:{value:{name:Ime.value}},superTypes:[n2.$type]},AbnfOptionalGroup:{name:Nme.$type,properties:{element:{name:Nme.element}},superTypes:[n2.$type]},AbnfPrimary:{name:n2.$type,properties:{},superTypes:[]},AbnfRule:{name:Qz.$type,properties:{definition:{name:Qz.definition},name:{name:Qz.name}},superTypes:[]},AbnfRuleName:{name:Dme.$type,properties:{name:{name:Dme.name}},superTypes:[n2.$type]},AbnfStringLiteral:{name:Ome.$type,properties:{value:{name:Ome.value}},superTypes:[n2.$type]},Accelerator:{name:Y8.$type,properties:{name:{name:Y8.name},x:{name:Y8.x},y:{name:Y8.y}},superTypes:[]},Alignment:{name:Jz.$type,properties:{direction:{name:Jz.direction},members:{name:Jz.members,defaultValue:[]}},superTypes:[]},Anchor:{name:j8.$type,properties:{evolution:{name:j8.evolution},name:{name:j8.name},visibility:{name:j8.visibility}},superTypes:[]},Annotation:{name:EC.$type,properties:{number:{name:EC.number},text:{name:EC.text},x:{name:EC.x},y:{name:EC.y}},superTypes:[]},Annotations:{name:eV.$type,properties:{x:{name:eV.x},y:{name:eV.y}},superTypes:[]},Architecture:{name:Kh.$type,properties:{accDescr:{name:Kh.accDescr},accTitle:{name:Kh.accTitle},alignments:{name:Kh.alignments,defaultValue:[]},edges:{name:Kh.edges,defaultValue:[]},groups:{name:Kh.groups,defaultValue:[]},junctions:{name:Kh.junctions,defaultValue:[]},services:{name:Kh.services,defaultValue:[]},title:{name:Kh.title}},superTypes:[]},Axis:{name:X8.$type,properties:{label:{name:X8.label},name:{name:X8.name}},superTypes:[]},Branch:{name:DR.$type,properties:{name:{name:DR.name},order:{name:DR.order}},superTypes:[o2.$type]},Checkout:{name:Pme.$type,properties:{branch:{name:Pme.branch}},superTypes:[o2.$type]},CherryPicking:{name:K8.$type,properties:{id:{name:K8.id},parent:{name:K8.parent},tags:{name:K8.tags,defaultValue:[]}},superTypes:[o2.$type]},ClassDefStatement:{name:tV.$type,properties:{className:{name:tV.className},styleText:{name:tV.styleText}},superTypes:[]},Commit:{name:D2.$type,properties:{id:{name:D2.id},message:{name:D2.message},tags:{name:D2.tags,defaultValue:[]},type:{name:D2.type}},superTypes:[o2.$type]},Common:{name:Z8.$type,properties:{accDescr:{name:Z8.accDescr},accTitle:{name:Z8.accTitle},title:{name:Z8.title}},superTypes:[]},Component:{name:$m.$type,properties:{decorator:{name:$m.decorator},evolution:{name:$m.evolution},inertia:{name:$m.inertia,defaultValue:!1},label:{name:$m.label},name:{name:$m.name},visibility:{name:$m.visibility}},superTypes:[]},Curve:{name:Q8.$type,properties:{entries:{name:Q8.entries,defaultValue:[]},label:{name:Q8.label},name:{name:Q8.name}},superTypes:[]},Cynefin:{name:i1.$type,properties:{accDescr:{name:i1.accDescr},accTitle:{name:i1.accTitle},domains:{name:i1.domains,defaultValue:[]},title:{name:i1.title},transitions:{name:i1.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:J8.$type,properties:{name:{name:J8.name},x:{name:J8.x},y:{name:J8.y}},superTypes:[]},Decorator:{name:$me.$type,properties:{strategy:{name:$me.strategy}},superTypes:[]},Direction:{name:i2.$type,properties:{accDescr:{name:i2.accDescr},accTitle:{name:i2.accTitle},dir:{name:i2.dir},statements:{name:i2.statements,defaultValue:[]},title:{name:i2.title}},superTypes:[s1.$type]},DomainBlock:{name:OR.$type,properties:{domain:{name:OR.domain},items:{name:OR.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:ej.$type,properties:{label:{name:ej.label}},superTypes:[]},EbnfChoice:{name:Bme.$type,properties:{alternatives:{name:Bme.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Fme.$type,properties:{except:{name:Fme.except}},superTypes:[AC.$type]},EbnfGroup:{name:zme.$type,properties:{element:{name:zme.element}},superTypes:[Bm.$type]},EbnfNonTerminal:{name:Vme.$type,properties:{name:{name:Vme.name}},superTypes:[Bm.$type]},EbnfOneOrMorePostfix:{name:Hme.$type,properties:{operator:{name:Hme.operator}},superTypes:[AC.$type]},EbnfOptional:{name:Gme.$type,properties:{element:{name:Gme.element}},superTypes:[Bm.$type]},EbnfOptionalPostfix:{name:Wme.$type,properties:{operator:{name:Wme.operator}},superTypes:[AC.$type]},EbnfPostfix:{name:AC.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Bm.$type,properties:{},superTypes:[]},EbnfRepetition:{name:qme.$type,properties:{element:{name:qme.element}},superTypes:[Bm.$type]},EbnfRule:{name:rV.$type,properties:{definition:{name:rV.definition},name:{name:rV.name}},superTypes:[]},EbnfSequence:{name:Ume.$type,properties:{elements:{name:Ume.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Yme.$type,properties:{text:{name:Yme.text}},superTypes:[Bm.$type]},EbnfTerm:{name:nV.$type,properties:{base:{name:nV.base},postfixes:{name:nV.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:jme.$type,properties:{value:{name:jme.value}},superTypes:[Bm.$type]},EbnfZeroOrMorePostfix:{name:Xme.$type,properties:{operator:{name:Xme.operator}},superTypes:[AC.$type]},Edge:{name:Gh.$type,properties:{lhsDir:{name:Gh.lhsDir},lhsGroup:{name:Gh.lhsGroup,defaultValue:!1},lhsId:{name:Gh.lhsId},lhsInto:{name:Gh.lhsInto,defaultValue:!1},rhsDir:{name:Gh.rhsDir},rhsGroup:{name:Gh.rhsGroup,defaultValue:!1},rhsId:{name:Gh.rhsId},rhsInto:{name:Gh.rhsInto,defaultValue:!1},title:{name:Gh.title}},superTypes:[]},EmDataEntity:{name:s2.$type,properties:{dataBlockValue:{name:s2.dataBlockValue},dataType:{name:s2.dataType},name:{name:s2.name}},superTypes:[]},EmFrame:{name:Fm.$type,properties:{},superTypes:[]},EmGwt:{name:MC.$type,properties:{givenStatements:{name:MC.givenStatements,defaultValue:[]},sourceFrame:{name:MC.sourceFrame,referenceType:Fm.$type},thenStatements:{name:MC.thenStatements,defaultValue:[]},whenStatements:{name:MC.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Kme.$type,properties:{entityIdentifier:{name:Kme.entityIdentifier,referenceType:iV.$type}},superTypes:[]},EmModelEntity:{name:iV.$type,properties:{name:{name:iV.name}},superTypes:[]},EmNoteEntity:{name:eM.$type,properties:{dataBlockValue:{name:eM.dataBlockValue},dataType:{name:eM.dataType},sourceFrame:{name:eM.sourceFrame,referenceType:Fm.$type}},superTypes:[]},EmResetFrame:{name:Sf.$type,properties:{dataInlineValue:{name:Sf.dataInlineValue},dataReference:{name:Sf.dataReference,referenceType:s2.$type},dataType:{name:Sf.dataType},entityIdentifier:{name:Sf.entityIdentifier},modelEntityType:{name:Sf.modelEntityType},name:{name:Sf.name},sourceFrames:{name:Sf.sourceFrames,defaultValue:[],referenceType:Fm.$type}},superTypes:[Fm.$type]},EmTimeFrame:{name:vp.$type,properties:{dataInlineValue:{name:vp.dataInlineValue},dataReference:{name:vp.dataReference,referenceType:s2.$type},dataType:{name:vp.dataType},entityIdentifier:{name:vp.entityIdentifier},modelEntityType:{name:vp.modelEntityType},name:{name:vp.name},sourceFrames:{name:vp.sourceFrames,defaultValue:[],referenceType:Fm.$type}},superTypes:[Fm.$type]},Entry:{name:sV.$type,properties:{axis:{name:sV.axis,referenceType:X8.$type},value:{name:sV.value}},superTypes:[]},EventModel:{name:mf.$type,properties:{accDescr:{name:mf.accDescr},accTitle:{name:mf.accTitle},dataEntities:{name:mf.dataEntities,defaultValue:[]},frames:{name:mf.frames,defaultValue:[]},gwtEntities:{name:mf.gwtEntities,defaultValue:[]},modelEntities:{name:mf.modelEntities,defaultValue:[]},noteEntities:{name:mf.noteEntities,defaultValue:[]},title:{name:mf.title}},superTypes:[]},Evolution:{name:Zme.$type,properties:{stages:{name:Zme.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:tM.$type,properties:{boundary:{name:tM.boundary},name:{name:tM.name},secondName:{name:tM.secondName}},superTypes:[]},Evolve:{name:aV.$type,properties:{component:{name:aV.component},target:{name:aV.target}},superTypes:[]},GitGraph:{name:s1.$type,properties:{accDescr:{name:s1.accDescr},accTitle:{name:s1.accTitle},statements:{name:s1.statements,defaultValue:[]},title:{name:s1.title}},superTypes:[]},Group:{name:RC.$type,properties:{icon:{name:RC.icon},id:{name:RC.id},in:{name:RC.in},title:{name:RC.title}},superTypes:[]},Info:{name:Sk.$type,properties:{accDescr:{name:Sk.accDescr},accTitle:{name:Sk.accTitle},title:{name:Sk.title}},superTypes:[]},Item:{name:_C.$type,properties:{classSelector:{name:_C.classSelector},name:{name:_C.name}},superTypes:[]},Junction:{name:oV.$type,properties:{id:{name:oV.id},in:{name:oV.in}},superTypes:[]},Label:{name:LC.$type,properties:{negX:{name:LC.negX,defaultValue:!1},negY:{name:LC.negY,defaultValue:!1},offsetX:{name:LC.offsetX},offsetY:{name:LC.offsetY}},superTypes:[]},Leaf:{name:rM.$type,properties:{classSelector:{name:rM.classSelector},name:{name:rM.name},value:{name:rM.value}},superTypes:[_C.$type]},Link:{name:zm.$type,properties:{arrow:{name:zm.arrow},from:{name:zm.from},fromPort:{name:zm.fromPort},linkLabel:{name:zm.linkLabel},to:{name:zm.to},toPort:{name:zm.toPort}},superTypes:[]},Merge:{name:O2.$type,properties:{branch:{name:O2.branch},id:{name:O2.id},tags:{name:O2.tags,defaultValue:[]},type:{name:O2.type}},superTypes:[o2.$type]},Note:{name:nM.$type,properties:{evolution:{name:nM.evolution},text:{name:nM.text},visibility:{name:nM.visibility}},superTypes:[]},Option:{name:lV.$type,properties:{name:{name:lV.name},value:{name:lV.value,defaultValue:!1}},superTypes:[]},Packet:{name:P2.$type,properties:{accDescr:{name:P2.accDescr},accTitle:{name:P2.accTitle},blocks:{name:P2.blocks,defaultValue:[]},title:{name:P2.title}},superTypes:[]},PacketBlock:{name:$2.$type,properties:{bits:{name:$2.bits},end:{name:$2.end},label:{name:$2.label},start:{name:$2.start}},superTypes:[]},PegAny:{name:Qme.$type,properties:{dot:{name:Qme.dot}},superTypes:[IC.$type]},PegGroup:{name:Jme.$type,properties:{element:{name:Jme.element}},superTypes:[IC.$type]},PegIdentifier:{name:e1e.$type,properties:{name:{name:e1e.name}},superTypes:[IC.$type]},PegLiteral:{name:t1e.$type,properties:{value:{name:t1e.value}},superTypes:[IC.$type]},PegOrderedChoice:{name:r1e.$type,properties:{alternatives:{name:r1e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:cV.$type,properties:{operator:{name:cV.operator},suffix:{name:cV.suffix}},superTypes:[]},PegPrimary:{name:IC.$type,properties:{},superTypes:[]},PegRule:{name:uV.$type,properties:{definition:{name:uV.definition},name:{name:uV.name}},superTypes:[]},PegSequence:{name:n1e.$type,properties:{elements:{name:n1e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:hV.$type,properties:{operator:{name:hV.operator},primary:{name:hV.primary}},superTypes:[]},Pie:{name:a1.$type,properties:{accDescr:{name:a1.accDescr},accTitle:{name:a1.accTitle},sections:{name:a1.sections,defaultValue:[]},showData:{name:a1.showData,defaultValue:!1},title:{name:a1.title}},superTypes:[]},PieSection:{name:PR.$type,properties:{label:{name:PR.label},value:{name:PR.value}},superTypes:[]},Pipeline:{name:dV.$type,properties:{components:{name:dV.components,defaultValue:[]},parent:{name:dV.parent}},superTypes:[]},PipelineComponent:{name:iM.$type,properties:{evolution:{name:iM.evolution},label:{name:iM.label},name:{name:iM.name}},superTypes:[]},Radar:{name:Vm.$type,properties:{accDescr:{name:Vm.accDescr},accTitle:{name:Vm.accTitle},axes:{name:Vm.axes,defaultValue:[]},curves:{name:Vm.curves,defaultValue:[]},options:{name:Vm.options,defaultValue:[]},title:{name:Vm.title}},superTypes:[]},Railroad:{name:B2.$type,properties:{accDescr:{name:B2.accDescr},accTitle:{name:B2.accTitle},rules:{name:B2.rules,defaultValue:[]},title:{name:B2.title}},superTypes:[]},RailroadAbnf:{name:F2.$type,properties:{accDescr:{name:F2.accDescr},accTitle:{name:F2.accTitle},rules:{name:F2.rules,defaultValue:[]},title:{name:F2.title}},superTypes:[]},RailroadChoiceExpr:{name:i1e.$type,properties:{alternatives:{name:i1e.alternatives,defaultValue:[]}},superTypes:[yf.$type]},RailroadEbnf:{name:z2.$type,properties:{accDescr:{name:z2.accDescr},accTitle:{name:z2.accTitle},rules:{name:z2.rules,defaultValue:[]},title:{name:z2.title}},superTypes:[]},RailroadExpression:{name:yf.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:s1e.$type,properties:{name:{name:s1e.name}},superTypes:[yf.$type]},RailroadOneOrMoreExpr:{name:a1e.$type,properties:{element:{name:a1e.element}},superTypes:[yf.$type]},RailroadOptionalExpr:{name:o1e.$type,properties:{element:{name:o1e.element}},superTypes:[yf.$type]},RailroadPeg:{name:V2.$type,properties:{accDescr:{name:V2.accDescr},accTitle:{name:V2.accTitle},rules:{name:V2.rules,defaultValue:[]},title:{name:V2.title}},superTypes:[]},RailroadRule:{name:fV.$type,properties:{definition:{name:fV.definition},name:{name:fV.name}},superTypes:[]},RailroadSequenceExpr:{name:l1e.$type,properties:{elements:{name:l1e.elements,defaultValue:[]}},superTypes:[yf.$type]},RailroadSpecialExpr:{name:c1e.$type,properties:{text:{name:c1e.text}},superTypes:[yf.$type]},RailroadTerminalExpr:{name:u1e.$type,properties:{value:{name:u1e.value}},superTypes:[yf.$type]},RailroadZeroOrMoreExpr:{name:h1e.$type,properties:{element:{name:h1e.element}},superTypes:[yf.$type]},Section:{name:pV.$type,properties:{classSelector:{name:pV.classSelector},name:{name:pV.name}},superTypes:[_C.$type]},Service:{name:a2.$type,properties:{icon:{name:a2.icon},iconText:{name:a2.iconText},id:{name:a2.id},in:{name:a2.in},title:{name:a2.title}},superTypes:[]},Size:{name:gV.$type,properties:{height:{name:gV.height},width:{name:gV.width}},superTypes:[]},Statement:{name:o2.$type,properties:{},superTypes:[]},Transition:{name:Ek.$type,properties:{from:{name:Ek.from},label:{name:Ek.label},to:{name:Ek.to}},superTypes:[]},TreeNode:{name:l2.$type,properties:{classAnnotation:{name:l2.classAnnotation},descAnnotation:{name:l2.descAnnotation},iconAnnotation:{name:l2.iconAnnotation},indent:{name:l2.indent},name:{name:l2.name}},superTypes:[]},TreeView:{name:NC.$type,properties:{accDescr:{name:NC.accDescr},accTitle:{name:NC.accTitle},nodes:{name:NC.nodes,defaultValue:[]},title:{name:NC.title}},superTypes:[]},Treemap:{name:H2.$type,properties:{accDescr:{name:H2.accDescr},accTitle:{name:H2.accTitle},title:{name:H2.title},TreemapRows:{name:H2.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:mV.$type,properties:{indent:{name:mV.indent},item:{name:mV.item}},superTypes:[]},Wardley:{name:ho.$type,properties:{accDescr:{name:ho.accDescr},accelerators:{name:ho.accelerators,defaultValue:[]},accTitle:{name:ho.accTitle},anchors:{name:ho.anchors,defaultValue:[]},annotation:{name:ho.annotation,defaultValue:[]},annotations:{name:ho.annotations,defaultValue:[]},components:{name:ho.components,defaultValue:[]},deaccelerators:{name:ho.deaccelerators,defaultValue:[]},evolution:{name:ho.evolution},evolves:{name:ho.evolves,defaultValue:[]},links:{name:ho.links,defaultValue:[]},notes:{name:ho.notes,defaultValue:[]},pipelines:{name:ho.pipelines,defaultValue:[]},size:{name:ho.size},title:{name:ho.title}},superTypes:[]}}}},M(Lw,"MermaidAstReflection"),Lw),Qs=new wGe,d1e,Ocr=M(()=>d1e??(d1e=io(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),f1e,Pcr=M(()=>f1e??(f1e=io(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),p1e,$cr=M(()=>p1e??(p1e=io('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),g1e,Bcr=M(()=>g1e??(g1e=io(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),m1e,Fcr=M(()=>m1e??(m1e=io(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),y1e,zcr=M(()=>y1e??(y1e=io(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),v1e,Vcr=M(()=>v1e??(v1e=io(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),b1e,Hcr=M(()=>b1e??(b1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),x1e,Gcr=M(()=>x1e??(x1e=io('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),w1e,Wcr=M(()=>w1e??(w1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),T1e,qcr=M(()=>T1e??(T1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),C1e,Ucr=M(()=>C1e??(C1e=io(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),k1e,Ycr=M(()=>k1e??(k1e=io(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),S1e,jcr=M(()=>S1e??(S1e=io(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),E1e,Xcr=M(()=>E1e??(E1e=io(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),Kcr={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Zcr={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Qcr={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Jcr={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},eur={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tur={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rur={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nur={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iur={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sur={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},aur={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},our={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lur={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cur={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uur={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gl={AstReflection:M(()=>new wGe,"AstReflection")},hur={Grammar:M(()=>Ocr(),"Grammar"),LanguageMetaData:M(()=>Kcr,"LanguageMetaData"),parser:{}},dur={Grammar:M(()=>Pcr(),"Grammar"),LanguageMetaData:M(()=>Zcr,"LanguageMetaData"),parser:{}},fur={Grammar:M(()=>$cr(),"Grammar"),LanguageMetaData:M(()=>Qcr,"LanguageMetaData"),parser:{}},pur={Grammar:M(()=>Bcr(),"Grammar"),LanguageMetaData:M(()=>Jcr,"LanguageMetaData"),parser:{}},gur={Grammar:M(()=>Fcr(),"Grammar"),LanguageMetaData:M(()=>eur,"LanguageMetaData"),parser:{}},mur={Grammar:M(()=>zcr(),"Grammar"),LanguageMetaData:M(()=>tur,"LanguageMetaData"),parser:{}},yur={Grammar:M(()=>Vcr(),"Grammar"),LanguageMetaData:M(()=>rur,"LanguageMetaData"),parser:{}},vur={Grammar:M(()=>Hcr(),"Grammar"),LanguageMetaData:M(()=>nur,"LanguageMetaData"),parser:{}},bur={Grammar:M(()=>Gcr(),"Grammar"),LanguageMetaData:M(()=>iur,"LanguageMetaData"),parser:{}},xur={Grammar:M(()=>Wcr(),"Grammar"),LanguageMetaData:M(()=>sur,"LanguageMetaData"),parser:{}},wur={Grammar:M(()=>qcr(),"Grammar"),LanguageMetaData:M(()=>aur,"LanguageMetaData"),parser:{}},Tur={Grammar:M(()=>Ucr(),"Grammar"),LanguageMetaData:M(()=>our,"LanguageMetaData"),parser:{}},Cur={Grammar:M(()=>Ycr(),"Grammar"),LanguageMetaData:M(()=>lur,"LanguageMetaData"),parser:{}},kur={Grammar:M(()=>jcr(),"Grammar"),LanguageMetaData:M(()=>cur,"LanguageMetaData"),parser:{}},Sur={Grammar:M(()=>Xcr(),"Grammar"),LanguageMetaData:M(()=>uur,"LanguageMetaData"),parser:{}},Eur=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Aur=/accTitle[\t ]*:([^\n\r]*)/,Mur=/title([\t ][^\n\r]*|)/,Rur={ACC_DESCR:Eur,ACC_TITLE:Aur,TITLE:Mur},Iw,sf=(Iw=class extends Fre{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=Rur[e.name];if(i===void 0)return;const s=i.exec(r);if(s!==null){if(s[1]!==void 0)return s[1].trim().replace(/[\t ]{2,}/gm," ");if(s[2]!==void 0)return s[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},M(Iw,"AbstractMermaidValueConverter"),Iw),Nw,F3=(Nw=class extends sf{runCustomConverter(e,r,n){}},M(Nw,"CommonValueConverter"),Nw),Dw,Wl=(Dw=class extends mP{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},M(Dw,"AbstractMermaidTokenBuilder"),Dw),Ow;Ow=class extends Wl{},M(Ow,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** @@ -3577,39 +3584,39 @@ lodash-es/lodash.js: * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) -*/var Dw,pur=(Dw=class extends Hl{constructor(){super(["radar-beta"])}},M(Dw,"RadarTokenBuilder"),Dw),mGe={parser:{TokenBuilder:M(()=>new pur,"TokenBuilder"),ValueConverter:M(()=>new P3,"ValueConverter")}};function yGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),rur,mGe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}M(yGe,"createRadarServices");var Ow,gur=(Ow=class extends Hl{constructor(){super(["railroad-beta"])}},M(Ow,"RailroadTokenBuilder"),Ow),w1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew gur,"TokenBuilder"),ValueConverter:M(()=>new mur,"ValueConverter")}};function nne(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),sur,vGe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}M(nne,"createRailroadServices");var $w,yur=($w=class extends Hl{constructor(){super(["railroad-ebnf-beta"])}},M($w,"RailroadEbnfTokenBuilder"),$w),T1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew yur,"TokenBuilder"),ValueConverter:M(()=>new vur,"ValueConverter")}};function ine(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),iur,bGe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}M(ine,"createRailroadEbnfServices");var Fw,bur=(Fw=class extends Hl{constructor(){super(["railroad-abnf-beta"])}},M(Fw,"RailroadAbnfTokenBuilder"),Fw),zw,xur=(zw=class extends tf{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const s=i.trim();if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))return s.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},M(zw,"RailroadAbnfValueConverter"),zw),xGe={parser:{TokenBuilder:M(()=>new bur,"TokenBuilder"),ValueConverter:M(()=>new xur,"ValueConverter")}};function sne(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),nur,xGe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}M(sne,"createRailroadAbnfServices");var Vw,wur=(Vw=class extends Hl{constructor(){super(["railroad-peg-beta"])}},M(Vw,"RailroadPegTokenBuilder"),Vw),C1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew wur,"TokenBuilder"),ValueConverter:M(()=>new Tur,"ValueConverter")}};function ane(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),aur,wGe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(ane,"createRailroadPegServices");var Gw,Cur=(Gw=class extends Hl{constructor(){super(["treemap"])}},M(Gw,"TreemapTokenBuilder"),Gw),kur=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Ww,Sur=(Ww=class extends tf{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=kur.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(Ww,"TreemapValueConverter"),Ww);function TGe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(TGe,"registerValidationChecks");var qw,Eur=(qw=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},M(qw,"TreemapValidator"),qw),CGe={parser:{TokenBuilder:M(()=>new Cur,"TokenBuilder"),ValueConverter:M(()=>new Sur,"ValueConverter")},validation:{TreemapValidator:M(()=>new Eur,"TreemapValidator")}};function kGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),our,CGe);return e.ServiceRegistry.register(r),TGe(r),{shared:e,Treemap:r}}M(kGe,"createTreemapServices");var Uw,Aur=(Uw=class extends tf{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(Uw,"WardleyValueConverter"),Uw),SGe={parser:{ValueConverter:M(()=>new Aur,"ValueConverter")}};function EGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),cur,SGe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(EGe,"createWardleyServices");var Yw,Mur=(Yw=class extends Hl{constructor(){super(["cynefin-beta"])}},M(Yw,"CynefinTokenBuilder"),Yw),AGe={parser:{TokenBuilder:M(()=>new Mur,"TokenBuilder"),ValueConverter:M(()=>new P3,"ValueConverter")}};function MGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),Kcr,AGe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M(MGe,"createCynefinServices");var jw,Rur=(jw=class extends Hl{constructor(){super(["gitGraph"])}},M(jw,"GitGraphTokenBuilder"),jw),RGe={parser:{TokenBuilder:M(()=>new Rur,"TokenBuilder"),ValueConverter:M(()=>new P3,"ValueConverter")}};function _Ge(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),Qcr,RGe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(_Ge,"createGitGraphServices");var Xw,_ur=(Xw=class extends Hl{constructor(){super(["info","showInfo"])}},M(Xw,"InfoTokenBuilder"),Xw),LGe={parser:{TokenBuilder:M(()=>new _ur,"TokenBuilder"),ValueConverter:M(()=>new P3,"ValueConverter")}};function IGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),Jcr,LGe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(IGe,"createInfoServices");var Kw,Lur=(Kw=class extends Hl{constructor(){super(["packet"])}},M(Kw,"PacketTokenBuilder"),Kw),NGe={parser:{TokenBuilder:M(()=>new Lur,"TokenBuilder"),ValueConverter:M(()=>new P3,"ValueConverter")}};function DGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),eur,NGe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(DGe,"createPacketServices");var Zw,Iur=(Zw=class extends Hl{constructor(){super(["pie","showData"])}},M(Zw,"PieTokenBuilder"),Zw),Qw,Nur=(Qw=class extends tf{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(Qw,"PieValueConverter"),Qw),OGe={parser:{TokenBuilder:M(()=>new Iur,"TokenBuilder"),ValueConverter:M(()=>new Nur,"ValueConverter")}};function PGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),tur,OGe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(PGe,"createPieServices");var Jw,Dur=(Jw=class extends tf{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},M(Jw,"TreeViewValueConverter"),Jw),eT,Our=(eT=class extends Hl{constructor(){super(["treeView-beta"])}},M(eT,"TreeViewTokenBuilder"),eT),$Ge={parser:{TokenBuilder:M(()=>new Our,"TokenBuilder"),ValueConverter:M(()=>new Dur,"ValueConverter")}};function BGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),lur,$Ge);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(BGe,"createTreeViewServices");var tT,Pur=(tT=class extends Hl{constructor(){super(["architecture"])}},M(tT,"ArchitectureTokenBuilder"),tT),rT,$ur=(rT=class extends tf{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},M(rT,"ArchitectureValueConverter"),rT),FGe={parser:{TokenBuilder:M(()=>new Pur,"TokenBuilder"),ValueConverter:M(()=>new $ur,"ValueConverter")}};function zGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),Xcr,FGe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(zGe,"createArchitectureServices");var nT,Bur=(nT=class extends Hl{constructor(){super(["eventmodeling"])}},M(nT,"EventModelingTokenBuilder"),nT),k1e=new Set(["cmd","command"]),S1e=new Set(["evt","event"]),fV=new Set(["rmo","readmodel"]),E1e=new Set(["pcr","processor"]),A1e=new Set(["ui"]);function VGe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}M(VGe,"registerValidationChecks");var iT,Fur=(iT=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(k1e.has(e.modelEntityType)?this.validateSources(e,new Set([...A1e,...E1e]),"command","ui or processor",r):S1e.has(e.modelEntityType)?this.validateSources(e,k1e,"event","command",r):fV.has(e.modelEntityType)?this.validateSources(e,S1e,"read model","event",r):E1e.has(e.modelEntityType)?this.validateSources(e,fV,"processor","read model",r):A1e.has(e.modelEntityType)&&this.validateSources(e,fV,"ui","read model",r))}validateSources(e,r,n,i,s){for(const a of e.sourceFrames){const o=a.ref;o!==void 0&&!r.has(o.modelEntityType)&&s("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},M(iT,"EventModelingValidator"),iT),HGe={parser:{TokenBuilder:M(()=>new Bur,"TokenBuilder"),ValueConverter:M(()=>new P3,"ValueConverter")},validation:{EventModelingValidator:M(()=>new Fur,"EventModelingValidator")}};function GGe(t=_o){const e=Hn(no(t),Vl),r=Hn(ro({shared:e}),Zcr,HGe);return e.ServiceRegistry.register(r),VGe(r),{shared:e,EventModel:r}}M(GGe,"createEventModelingServices");var po={},zur={info:M(async()=>{const{createInfoServices:t}=await Rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>x4r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;po.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>w4r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;po.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>T4r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;po.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>C4r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;po.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>k4r);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;po.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>S4r);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;po.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Rr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>E4r);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;po.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>A4r);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;po.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Rr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>M4r);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;po.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Rr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>R4r);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;po.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Rr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>_4r);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;po.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Rr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>L4r);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;po.railroadPeg=e},"railroadPeg"),treemap:M(async()=>{const{createTreemapServices:t}=await Rr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>I4r);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;po.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>N4r);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;po.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Rr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>D4r);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;po.cynefin=e},"cynefin")};async function $u(t,e){const r=zur[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);po[t]||await r();const i=po[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new j7(i);return i.value}M($u,"parse");var sT,j7=(sT=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const s=i.line!==void 0&&!isNaN(i.line)?i.line:"?",a=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${s}, column ${a}: ${i.message}`}).join(` +*/var Pw,_ur=(Pw=class extends Wl{constructor(){super(["radar-beta"])}},M(Pw,"RadarTokenBuilder"),Pw),TGe={parser:{TokenBuilder:M(()=>new _ur,"TokenBuilder"),ValueConverter:M(()=>new F3,"ValueConverter")}};function CGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),vur,TGe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}M(CGe,"createRadarServices");var $w,Lur=($w=class extends Wl{constructor(){super(["railroad-beta"])}},M($w,"RailroadTokenBuilder"),$w),A1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Lur,"TokenBuilder"),ValueConverter:M(()=>new Iur,"ValueConverter")}};function one(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),wur,kGe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}M(one,"createRailroadServices");var Fw,Nur=(Fw=class extends Wl{constructor(){super(["railroad-ebnf-beta"])}},M(Fw,"RailroadEbnfTokenBuilder"),Fw),M1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Nur,"TokenBuilder"),ValueConverter:M(()=>new Dur,"ValueConverter")}};function lne(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),xur,SGe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}M(lne,"createRailroadEbnfServices");var Vw,Our=(Vw=class extends Wl{constructor(){super(["railroad-abnf-beta"])}},M(Vw,"RailroadAbnfTokenBuilder"),Vw),Hw,Pur=(Hw=class extends sf{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const s=i.trim();if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))return s.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},M(Hw,"RailroadAbnfValueConverter"),Hw),EGe={parser:{TokenBuilder:M(()=>new Our,"TokenBuilder"),ValueConverter:M(()=>new Pur,"ValueConverter")}};function cne(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),bur,EGe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}M(cne,"createRailroadAbnfServices");var Gw,$ur=(Gw=class extends Wl{constructor(){super(["railroad-peg-beta"])}},M(Gw,"RailroadPegTokenBuilder"),Gw),R1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew $ur,"TokenBuilder"),ValueConverter:M(()=>new Bur,"ValueConverter")}};function une(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),Tur,AGe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(une,"createRailroadPegServices");var qw,Fur=(qw=class extends Wl{constructor(){super(["treemap"])}},M(qw,"TreemapTokenBuilder"),qw),zur=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Uw,Vur=(Uw=class extends sf{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=zur.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(Uw,"TreemapValueConverter"),Uw);function MGe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(MGe,"registerValidationChecks");var Yw,Hur=(Yw=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},M(Yw,"TreemapValidator"),Yw),RGe={parser:{TokenBuilder:M(()=>new Fur,"TokenBuilder"),ValueConverter:M(()=>new Vur,"ValueConverter")},validation:{TreemapValidator:M(()=>new Hur,"TreemapValidator")}};function _Ge(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),Cur,RGe);return e.ServiceRegistry.register(r),MGe(r),{shared:e,Treemap:r}}M(_Ge,"createTreemapServices");var jw,Gur=(jw=class extends sf{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(jw,"WardleyValueConverter"),jw),LGe={parser:{ValueConverter:M(()=>new Gur,"ValueConverter")}};function IGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),Sur,LGe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(IGe,"createWardleyServices");var Xw,Wur=(Xw=class extends Wl{constructor(){super(["cynefin-beta"])}},M(Xw,"CynefinTokenBuilder"),Xw),NGe={parser:{TokenBuilder:M(()=>new Wur,"TokenBuilder"),ValueConverter:M(()=>new F3,"ValueConverter")}};function DGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),dur,NGe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M(DGe,"createCynefinServices");var Kw,qur=(Kw=class extends Wl{constructor(){super(["gitGraph"])}},M(Kw,"GitGraphTokenBuilder"),Kw),OGe={parser:{TokenBuilder:M(()=>new qur,"TokenBuilder"),ValueConverter:M(()=>new F3,"ValueConverter")}};function PGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),pur,OGe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(PGe,"createGitGraphServices");var Zw,Uur=(Zw=class extends Wl{constructor(){super(["info","showInfo"])}},M(Zw,"InfoTokenBuilder"),Zw),$Ge={parser:{TokenBuilder:M(()=>new Uur,"TokenBuilder"),ValueConverter:M(()=>new F3,"ValueConverter")}};function BGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),gur,$Ge);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(BGe,"createInfoServices");var Qw,Yur=(Qw=class extends Wl{constructor(){super(["packet"])}},M(Qw,"PacketTokenBuilder"),Qw),FGe={parser:{TokenBuilder:M(()=>new Yur,"TokenBuilder"),ValueConverter:M(()=>new F3,"ValueConverter")}};function zGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),mur,FGe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(zGe,"createPacketServices");var Jw,jur=(Jw=class extends Wl{constructor(){super(["pie","showData"])}},M(Jw,"PieTokenBuilder"),Jw),eT,Xur=(eT=class extends sf{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(eT,"PieValueConverter"),eT),VGe={parser:{TokenBuilder:M(()=>new jur,"TokenBuilder"),ValueConverter:M(()=>new Xur,"ValueConverter")}};function HGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),yur,VGe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(HGe,"createPieServices");var tT,Kur=(tT=class extends sf{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},M(tT,"TreeViewValueConverter"),tT),rT,Zur=(rT=class extends Wl{constructor(){super(["treeView-beta"])}},M(rT,"TreeViewTokenBuilder"),rT),GGe={parser:{TokenBuilder:M(()=>new Zur,"TokenBuilder"),ValueConverter:M(()=>new Kur,"ValueConverter")}};function WGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),kur,GGe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(WGe,"createTreeViewServices");var nT,Qur=(nT=class extends Wl{constructor(){super(["architecture"])}},M(nT,"ArchitectureTokenBuilder"),nT),iT,Jur=(iT=class extends sf{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},M(iT,"ArchitectureValueConverter"),iT),qGe={parser:{TokenBuilder:M(()=>new Qur,"TokenBuilder"),ValueConverter:M(()=>new Jur,"ValueConverter")}};function UGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),hur,qGe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(UGe,"createArchitectureServices");var sT,ehr=(sT=class extends Wl{constructor(){super(["eventmodeling"])}},M(sT,"EventModelingTokenBuilder"),sT),_1e=new Set(["cmd","command"]),L1e=new Set(["evt","event"]),yV=new Set(["rmo","readmodel"]),I1e=new Set(["pcr","processor"]),N1e=new Set(["ui"]);function YGe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}M(YGe,"registerValidationChecks");var aT,thr=(aT=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(_1e.has(e.modelEntityType)?this.validateSources(e,new Set([...N1e,...I1e]),"command","ui or processor",r):L1e.has(e.modelEntityType)?this.validateSources(e,_1e,"event","command",r):yV.has(e.modelEntityType)?this.validateSources(e,L1e,"read model","event",r):I1e.has(e.modelEntityType)?this.validateSources(e,yV,"processor","read model",r):N1e.has(e.modelEntityType)&&this.validateSources(e,yV,"ui","read model",r))}validateSources(e,r,n,i,s){for(const a of e.sourceFrames){const o=a.ref;o!==void 0&&!r.has(o.modelEntityType)&&s("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},M(aT,"EventModelingValidator"),aT),jGe={parser:{TokenBuilder:M(()=>new ehr,"TokenBuilder"),ValueConverter:M(()=>new F3,"ValueConverter")},validation:{EventModelingValidator:M(()=>new thr,"EventModelingValidator")}};function XGe(t=_o){const e=Hn(no(t),Gl),r=Hn(ro({shared:e}),fur,jGe);return e.ServiceRegistry.register(r),YGe(r),{shared:e,EventModel:r}}M(XGe,"createEventModelingServices");var po={},rhr={info:M(async()=>{const{createInfoServices:t}=await Rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>P4r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;po.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>$4r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;po.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>B4r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;po.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>F4r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;po.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>z4r);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;po.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>V4r);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;po.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Rr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>H4r);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;po.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>G4r);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;po.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Rr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>W4r);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;po.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Rr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>q4r);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;po.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Rr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>U4r);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;po.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Rr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>Y4r);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;po.railroadPeg=e},"railroadPeg"),treemap:M(async()=>{const{createTreemapServices:t}=await Rr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>j4r);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;po.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>X4r);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;po.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Rr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>K4r);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;po.cynefin=e},"cynefin")};async function zu(t,e){const r=rhr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);po[t]||await r();const i=po[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Z7(i);return i.value}M(zu,"parse");var oT,Z7=(oT=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const s=i.line!==void 0&&!isNaN(i.line)?i.line:"?",a=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${s}, column ${a}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const s=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",a=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${s}, column ${a}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},M(sT,"MermaidParseError"),sT),Ci={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Vur=Sn.gitGraph,Av=w(()=>es({...Vur,...vr().gitGraph}),"getConfig"),Qt=new mee(()=>{const t=Av(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function TP(){return FCe({length:7})}w(TP,"getID");function WGe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const s=e(i);return r[s]||(r[s]=!0,n.push(i)),n},[])}w(WGe,"uniqBy");var Hur=w(function(t){Qt.records.direction=t},"setDirection"),Gur=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Qt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),Wur=w(function(){return Qt.records.options},"getOptions"),qur=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;de.info("commit",e,r,n,i),de.debug("Entering commit:",e,r,n,i);const s=Av();r=Vt.sanitizeText(r,s),e=Vt.sanitizeText(e,s),i=i==null?void 0:i.map(o=>Vt.sanitizeText(o,s));const a={id:r||Qt.records.seq+"-"+TP(),message:e,seq:Qt.records.seq++,type:n??Ci.NORMAL,tags:i??[],parents:Qt.records.head==null?[]:[Qt.records.head.id],branch:Qt.records.currBranch};Qt.records.head=a,de.info("main branch",s.mainBranchName),Qt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Qt.records.commits.set(a.id,a),Qt.records.branches.set(Qt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),Uur=w(function(t){let e=t.name;const r=t.order;if(e=Vt.sanitizeText(e,Av()),Qt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Qt.records.branches.set(e,Qt.records.head!=null?Qt.records.head.id:null),Qt.records.branchConfig.set(e,{name:e,order:r}),qGe(e),de.debug("in createBranch")},"branch"),Yur=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=Av();e=Vt.sanitizeText(e,s),r&&(r=Vt.sanitizeText(r,s));const a=Qt.records.branches.get(Qt.records.currBranch),o=Qt.records.branches.get(e),l=a?Qt.records.commits.get(a):void 0,u=o?Qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Qt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Qt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Qt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Qt.records.seq}-${TP()}`,message:`merged branch ${e} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,h],branch:Qt.records.currBranch,type:Ci.MERGE,customType:n,customId:!!r,tags:i??[]};Qt.records.head=d,Qt.records.commits.set(d.id,d),Qt.records.branches.set(Qt.records.currBranch,d.id),de.debug(Qt.records.branches),de.debug("in mergeBranch")},"merge"),jur=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;de.debug("Entering cherryPick:",e,r,n);const s=Av();if(e=Vt.sanitizeText(e,s),r=Vt.sanitizeText(r,s),n=n==null?void 0:n.map(l=>Vt.sanitizeText(l,s)),i=Vt.sanitizeText(i,s),!e||!Qt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const a=Qt.records.commits.get(e);if(a===void 0||!a)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(a.parents)&&a.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=a.branch;if(a.type===Ci.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Qt.records.commits.has(r)){if(o===Qt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Qt.records.branches.get(Qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Qt.records.seq+"-"+TP(),message:`cherry-picked ${a==null?void 0:a.message} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,a.id],branch:Qt.records.currBranch,type:Ci.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ci.MERGE?`|parent:${i}`:""}`]};Qt.records.head=h,Qt.records.commits.set(h.id,h),Qt.records.branches.set(Qt.records.currBranch,h.id),de.debug(Qt.records.branches),de.debug("in cherryPick")}},"cherryPick"),qGe=w(function(t){if(t=Vt.sanitizeText(t,Av()),Qt.records.branches.has(t)){Qt.records.currBranch=t;const e=Qt.records.branches.get(Qt.records.currBranch);e===void 0||!e?Qt.records.head=null:Qt.records.head=Qt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function ZY(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(ZY,"upsert");function one(t){const e=t.reduce((i,s)=>i.seq>s.seq?i:s,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Qt.records.branches)Qt.records.branches.get(i)===e.id&&n.push(i);if(de.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Qt.records.commits.get(e.parents[0]);ZY(t,e,i),e.parents[1]&&t.push(Qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Qt.records.commits.get(e.parents[0]);ZY(t,e,i)}}t=WGe(t,i=>i.id),one(t)}w(one,"prettyPrintCommitHistory");var Xur=w(function(){de.debug(Qt.records.commits);const t=UGe()[0];one([t])},"prettyPrint"),Kur=w(function(){Qt.reset(),Ri()},"clear"),Zur=w(function(){return[...Qt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Qur=w(function(){return Qt.records.branches},"getBranches"),Jur=w(function(){return Qt.records.commits},"getCommits"),UGe=w(function(){const t=[...Qt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),ehr=w(function(){return Qt.records.currBranch},"getCurrentBranch"),thr=w(function(){return Qt.records.direction},"getDirection"),rhr=w(function(){return Qt.records.head},"getHead"),YGe={commitType:Ci,getConfig:Av,setDirection:Hur,setOptions:Gur,getOptions:Wur,commit:qur,branch:Uur,merge:Yur,cherryPick:jur,checkout:qGe,prettyPrint:Xur,clear:Kur,getBranchesAsObjArray:Zur,getBranches:Qur,getCommits:Jur,getCommitsArray:UGe,getCurrentBranch:ehr,getDirection:thr,getHead:rhr,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi},nhr=w((t,e)=>{Fl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)ihr(r,e)},"populate"),ihr=w((t,e)=>{const n={Commit:w(i=>e.commit(shr(i)),"Commit"),Branch:w(i=>e.branch(ahr(i)),"Branch"),Merge:w(i=>e.merge(ohr(i)),"Merge"),Checkout:w(i=>e.checkout(lhr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(chr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),shr=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ci[t.type]:Ci.NORMAL,tags:t.tags??void 0}),"parseCommit"),ahr=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),ohr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ci[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),lhr=w(t=>t.branch,"parseCheckout"),chr=w(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),uhr={parse:w(async t=>{const e=await $u("gitGraph",t);de.debug(e),nhr(e,YGe)},"parse")},qp=10,Up=40,Jh=4,Mf=2,C1=8,CP=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),QY=12,lne=new Set(["redux-color","redux-dark-color"]),hhr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),k1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),sc=new Map,uc=new Map,NI=30,kk=new Map,DI=[],Rf=0,In="LR",dhr=w(()=>{sc.clear(),uc.clear(),kk.clear(),Rf=0,DI=[],In="LR"},"clear"),jGe=w(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),XGe=w(t=>{let e,r,n;return In==="BT"?(r=w((i,s)=>i<=s,"comparisonFunc"),n=1/0):(r=w((i,s)=>i>=s,"comparisonFunc"),n=0),t.forEach(i=>{var a,o;const s=In==="TB"||In=="BT"?(a=uc.get(i))==null?void 0:a.y:(o=uc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),fhr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=uc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),phr=w((t,e,r)=>{let n=r,i=r;const s=[];t.forEach(a=>{const o=e.get(a);if(!o)throw new Error(`Commit not found for key ${a}`);o.parents.length?(n=mhr(o),i=Math.max(n,i)):s.push(o),yhr(o,n)}),n=i,s.forEach(a=>{vhr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=fhr(o.parents);n=uc.get(l).y-Up,n<=i&&(i=n);const u=sc.get(o.branch).pos,h=n-qp;uc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),ghr=w(t=>{var n;const e=XGe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=uc.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),mhr=w(t=>ghr(t)+Up,"calculateCommitPosition"),yhr=w((t,e)=>{const r=sc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+qp;return uc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),vhr=w((t,e,r)=>{const n=sc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;uc.set(t.id,{x:s,y:i})},"setRootPosition"),bhr=w((t,e,r,n,i,s)=>{const{theme:a}=Ve(),o=CP.has(a??""),l=lne.has(a??""),u=hhr.has(a??"");if(s===Ci.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${k1(i,C1,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${k1(i,C1,l)} ${n}-inner`);else if(s===Ci.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${k1(i,C1,l)}`),s===Ci.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${k1(i,C1,l)}`)}if(s===Ci.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${k1(i,C1,l)}`)}}},"drawCommitBullet"),xhr=w((t,e,r,n,i)=>{var s;if(e.type!==Ci.CHERRY_PICK&&(e.customId&&e.type===Ci.MERGE||e.type!==Ci.MERGE)&&i.showCommitLabel){const a=t.append("g"),o=a.insert("rect").attr("class","commit-label-bkg"),l=a.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(s=l.node())==null?void 0:s.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-Mf).attr("y",r.y+13.5).attr("width",u.width+2*Mf).attr("height",u.height+2*Mf),In==="TB"||In==="BT"?(o.attr("x",r.x-(u.width+4*Jh+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Jh)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(In==="TB"||In==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;a.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),whr=w((t,e,r,n)=>{var i;if(e.tags.length>0){let s=0,a=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-s).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:s}),s+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` - ${n-a/2-Jh/2},${g+Mf} - ${n-a/2-Jh/2},${g-Mf} - ${r.posWithOffset-a/2-Jh},${g-p-Mf} - ${r.posWithOffset+a/2+Jh},${g-p-Mf} - ${r.posWithOffset+a/2+Jh},${g+p+Mf} - ${r.posWithOffset-a/2-Jh},${g+p+Mf}`),h.attr("cy",g).attr("cx",n-a/2+Jh/2).attr("r",1.5).attr("class","tag-hole"),In==="TB"||In==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},M(oT,"MermaidParseError"),oT),Ci={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},nhr=Sn.gitGraph,Rv=w(()=>es({...nhr,...br().gitGraph}),"getConfig"),Qt=new xee(()=>{const t=Rv(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function SP(){return qCe({length:7})}w(SP,"getID");function KGe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const s=e(i);return r[s]||(r[s]=!0,n.push(i)),n},[])}w(KGe,"uniqBy");var ihr=w(function(t){Qt.records.direction=t},"setDirection"),shr=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Qt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),ahr=w(function(){return Qt.records.options},"getOptions"),ohr=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;de.info("commit",e,r,n,i),de.debug("Entering commit:",e,r,n,i);const s=Rv();r=Vt.sanitizeText(r,s),e=Vt.sanitizeText(e,s),i=i==null?void 0:i.map(o=>Vt.sanitizeText(o,s));const a={id:r||Qt.records.seq+"-"+SP(),message:e,seq:Qt.records.seq++,type:n??Ci.NORMAL,tags:i??[],parents:Qt.records.head==null?[]:[Qt.records.head.id],branch:Qt.records.currBranch};Qt.records.head=a,de.info("main branch",s.mainBranchName),Qt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Qt.records.commits.set(a.id,a),Qt.records.branches.set(Qt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),lhr=w(function(t){let e=t.name;const r=t.order;if(e=Vt.sanitizeText(e,Rv()),Qt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Qt.records.branches.set(e,Qt.records.head!=null?Qt.records.head.id:null),Qt.records.branchConfig.set(e,{name:e,order:r}),ZGe(e),de.debug("in createBranch")},"branch"),chr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=Rv();e=Vt.sanitizeText(e,s),r&&(r=Vt.sanitizeText(r,s));const a=Qt.records.branches.get(Qt.records.currBranch),o=Qt.records.branches.get(e),l=a?Qt.records.commits.get(a):void 0,u=o?Qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Qt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Qt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Qt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Qt.records.seq}-${SP()}`,message:`merged branch ${e} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,h],branch:Qt.records.currBranch,type:Ci.MERGE,customType:n,customId:!!r,tags:i??[]};Qt.records.head=d,Qt.records.commits.set(d.id,d),Qt.records.branches.set(Qt.records.currBranch,d.id),de.debug(Qt.records.branches),de.debug("in mergeBranch")},"merge"),uhr=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;de.debug("Entering cherryPick:",e,r,n);const s=Rv();if(e=Vt.sanitizeText(e,s),r=Vt.sanitizeText(r,s),n=n==null?void 0:n.map(l=>Vt.sanitizeText(l,s)),i=Vt.sanitizeText(i,s),!e||!Qt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const a=Qt.records.commits.get(e);if(a===void 0||!a)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(a.parents)&&a.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=a.branch;if(a.type===Ci.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Qt.records.commits.has(r)){if(o===Qt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Qt.records.branches.get(Qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Qt.records.seq+"-"+SP(),message:`cherry-picked ${a==null?void 0:a.message} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,a.id],branch:Qt.records.currBranch,type:Ci.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ci.MERGE?`|parent:${i}`:""}`]};Qt.records.head=h,Qt.records.commits.set(h.id,h),Qt.records.branches.set(Qt.records.currBranch,h.id),de.debug(Qt.records.branches),de.debug("in cherryPick")}},"cherryPick"),ZGe=w(function(t){if(t=Vt.sanitizeText(t,Rv()),Qt.records.branches.has(t)){Qt.records.currBranch=t;const e=Qt.records.branches.get(Qt.records.currBranch);e===void 0||!e?Qt.records.head=null:Qt.records.head=Qt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function tj(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(tj,"upsert");function hne(t){const e=t.reduce((i,s)=>i.seq>s.seq?i:s,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Qt.records.branches)Qt.records.branches.get(i)===e.id&&n.push(i);if(de.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Qt.records.commits.get(e.parents[0]);tj(t,e,i),e.parents[1]&&t.push(Qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Qt.records.commits.get(e.parents[0]);tj(t,e,i)}}t=KGe(t,i=>i.id),hne(t)}w(hne,"prettyPrintCommitHistory");var hhr=w(function(){de.debug(Qt.records.commits);const t=QGe()[0];hne([t])},"prettyPrint"),dhr=w(function(){Qt.reset(),Ri()},"clear"),fhr=w(function(){return[...Qt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),phr=w(function(){return Qt.records.branches},"getBranches"),ghr=w(function(){return Qt.records.commits},"getCommits"),QGe=w(function(){const t=[...Qt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),mhr=w(function(){return Qt.records.currBranch},"getCurrentBranch"),yhr=w(function(){return Qt.records.direction},"getDirection"),vhr=w(function(){return Qt.records.head},"getHead"),JGe={commitType:Ci,getConfig:Rv,setDirection:ihr,setOptions:shr,getOptions:ahr,commit:ohr,branch:lhr,merge:chr,cherryPick:uhr,checkout:ZGe,prettyPrint:hhr,clear:dhr,getBranchesAsObjArray:fhr,getBranches:phr,getCommits:ghr,getCommitsArray:QGe,getCurrentBranch:mhr,getDirection:yhr,getHead:vhr,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi},bhr=w((t,e)=>{Vl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)xhr(r,e)},"populate"),xhr=w((t,e)=>{const n={Commit:w(i=>e.commit(whr(i)),"Commit"),Branch:w(i=>e.branch(Thr(i)),"Branch"),Merge:w(i=>e.merge(Chr(i)),"Merge"),Checkout:w(i=>e.checkout(khr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(Shr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),whr=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ci[t.type]:Ci.NORMAL,tags:t.tags??void 0}),"parseCommit"),Thr=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),Chr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ci[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),khr=w(t=>t.branch,"parseCheckout"),Shr=w(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Ehr={parse:w(async t=>{const e=await zu("gitGraph",t);de.debug(e),bhr(e,JGe)},"parse")},Xp=10,Kp=40,rd=4,Lf=2,E1=8,EP=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),rj=12,dne=new Set(["redux-color","redux-dark-color"]),Ahr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),A1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),lc=new Map,fc=new Map,PI=30,Ak=new Map,$I=[],If=0,In="LR",Mhr=w(()=>{lc.clear(),fc.clear(),Ak.clear(),If=0,$I=[],In="LR"},"clear"),eWe=w(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),tWe=w(t=>{let e,r,n;return In==="BT"?(r=w((i,s)=>i<=s,"comparisonFunc"),n=1/0):(r=w((i,s)=>i>=s,"comparisonFunc"),n=0),t.forEach(i=>{var a,o;const s=In==="TB"||In=="BT"?(a=fc.get(i))==null?void 0:a.y:(o=fc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),Rhr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=fc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),_hr=w((t,e,r)=>{let n=r,i=r;const s=[];t.forEach(a=>{const o=e.get(a);if(!o)throw new Error(`Commit not found for key ${a}`);o.parents.length?(n=Ihr(o),i=Math.max(n,i)):s.push(o),Nhr(o,n)}),n=i,s.forEach(a=>{Dhr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=Rhr(o.parents);n=fc.get(l).y-Kp,n<=i&&(i=n);const u=lc.get(o.branch).pos,h=n-Xp;fc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),Lhr=w(t=>{var n;const e=tWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=fc.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),Ihr=w(t=>Lhr(t)+Kp,"calculateCommitPosition"),Nhr=w((t,e)=>{const r=lc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Xp;return fc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Dhr=w((t,e,r)=>{const n=lc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;fc.set(t.id,{x:s,y:i})},"setRootPosition"),Ohr=w((t,e,r,n,i,s)=>{const{theme:a}=Ve(),o=EP.has(a??""),l=dne.has(a??""),u=Ahr.has(a??"");if(s===Ci.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${A1(i,E1,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${A1(i,E1,l)} ${n}-inner`);else if(s===Ci.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${A1(i,E1,l)}`),s===Ci.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${A1(i,E1,l)}`)}if(s===Ci.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${A1(i,E1,l)}`)}}},"drawCommitBullet"),Phr=w((t,e,r,n,i)=>{var s;if(e.type!==Ci.CHERRY_PICK&&(e.customId&&e.type===Ci.MERGE||e.type!==Ci.MERGE)&&i.showCommitLabel){const a=t.append("g"),o=a.insert("rect").attr("class","commit-label-bkg"),l=a.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(s=l.node())==null?void 0:s.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-Lf).attr("y",r.y+13.5).attr("width",u.width+2*Lf).attr("height",u.height+2*Lf),In==="TB"||In==="BT"?(o.attr("x",r.x-(u.width+4*rd+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*rd)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(In==="TB"||In==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;a.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),$hr=w((t,e,r,n)=>{var i;if(e.tags.length>0){let s=0,a=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-s).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:s}),s+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` + ${n-a/2-rd/2},${g+Lf} + ${n-a/2-rd/2},${g-Lf} + ${r.posWithOffset-a/2-rd},${g-p-Lf} + ${r.posWithOffset+a/2+rd},${g-p-Lf} + ${r.posWithOffset+a/2+rd},${g+p+Lf} + ${r.posWithOffset-a/2-rd},${g+p+Lf}`),h.attr("cy",g).attr("cx",n-a/2+rd/2).attr("r",1.5).attr("class","tag-hole"),In==="TB"||In==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` ${r.x},${m+2} ${r.x},${m-2} - ${r.x+qp},${m-p-2} - ${r.x+qp+a+4},${m-p-2} - ${r.x+qp+a+4},${m+p+2} - ${r.x+qp},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+Jh/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),Thr=w(t=>{switch(t.customType??t.type){case Ci.NORMAL:return"commit-normal";case Ci.REVERSE:return"commit-reverse";case Ci.HIGHLIGHT:return"commit-highlight";case Ci.MERGE:return"commit-merge";case Ci.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Chr=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const s=XGe(t.parents);if(s){const a=n.get(s)??i;return e==="TB"?a.y+Up:e==="BT"?(n.get(t.id)??i).y-Up:a.x+Up}}else return e==="TB"?NI:e==="BT"?(n.get(t.id)??i).y-Up:0;return 0},"calculatePosition"),khr=w((t,e,r)=>{var l,u;const n=In==="BT"&&r?e:e+qp,i=(l=sc.get(t.branch))==null?void 0:l.pos,s=In==="TB"||In==="BT"?(u=sc.get(t.branch))==null?void 0:u.pos:n;if(s===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const a=CP.has(Ve().theme??""),o=In==="TB"||In==="BT"?n:i+(a?QY/2+1:-2);return{x:s,y:o,posWithOffset:n}},"getCommitPosition"),M1e=w((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let a=In==="TB"||In==="BT"?NI:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=w((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);In==="BT"&&(l&&phr(h,e,a),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(a=Chr(f,In,a,uc));const p=khr(f,a,l);if(r){const m=Thr(f),y=f.customType??f.type,v=((g=sc.get(f.branch))==null?void 0:g.index)??0;bhr(i,f,p,m,v,y),xhr(s,f,p,a,n),whr(s,f,p,a)}In==="TB"||In==="BT"?uc.set(f.id,{x:p.x,y:p.posWithOffset}):uc.set(f.id,{x:p.posWithOffset,y:p.y}),a=In==="BT"&&l?a+Up:a+Up+qp,a>Rf&&(Rf=a)})},"drawCommits"),Shr=w((t,e,r,n,i)=>{const a=(In==="TB"||In==="BT"?r.xu.branch===a,"isOnBranchToGetCurve"),l=w(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),Sk=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(DI.every(a=>Math.abs(a-n)>=10))return DI.push(n),n;const s=Math.abs(t-e);return Sk(t,e-s/5,r+1)},"findLane"),Ehr=w((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=Ve(),s=lne.has(i??""),a=uc.get(e.id),o=uc.get(r.id);if(a===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=Shr(e,r,a,o,n);let u="",h="",d=0,f=0,p=(m=sc.get(r.branch))==null?void 0:m.index;r.type===Ci.MERGE&&e.id!==r.parents[0]&&(p=(y=sc.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const T=a.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ci.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${a.x} ${o.y-d} ${h} ${a.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${o.x+d} ${a.y} ${u} ${o.x} ${a.y+f} L ${o.x} ${o.y}`),a.x===o.x&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`)):In==="BT"?(a.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ci.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${a.x} ${o.y+d} ${u} ${a.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${o.x+d} ${a.y} ${h} ${o.x} ${a.y-f} L ${o.x} ${o.y}`),a.x===o.x&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`)):(a.yo.y&&(r.type===Ci.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${o.x-d} ${a.y} ${u} ${o.x} ${a.y-f} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${a.x} ${o.y+d} ${h} ${a.x+f} ${o.y} L ${o.x} ${o.y}`),a.y===o.y&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+k1(p,C1,s))},"drawArrow"),Ahr=w((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(s=>{Ehr(r,e.get(s),i,e)})})},"drawArrows"),Mhr=w((t,e,r,n)=>{const{look:i,theme:s,themeVariables:a}=Ve(),{dropShadow:o,THEME_COLOR_LIMIT:l}=a,u=CP.has(s??""),h=lne.has(s??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=k1(p,u?l:C1,h),m=(_=sc.get(f.name))==null?void 0:_.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=In==="TB"||In==="BT"?m:u?m+QY/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",Rf),v.attr("y2",y),v.attr("class","branch branch"+g),In==="TB"?(v.attr("y1",NI),v.attr("x1",m),v.attr("y2",Rf),v.attr("x2",m)):In==="BT"&&(v.attr("y1",Rf),v.attr("x1",m),v.attr("y2",NI),v.attr("x2",m)),DI.push(y);const x=f.name,b=jGe(x),T=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const k=b.getBBox(),E=u?0:4,A=u?16:0,R=u?QY:0;i==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+A).attr("height",k.height+4+R),S.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+A/2)+", "+(y-k.height/2-2)+")"),In==="TB"?(T.attr("x",m-k.width/2-10).attr("y",0),S.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(T.attr("transform",`translate(${-A/2-3}, ${-R-10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(-R*2+7)+")"))):In==="BT"?(T.attr("x",m-k.width/2-10).attr("y",Rf),S.attr("transform","translate("+(m-k.width/2-5)+", "+Rf+")"),u&&(T.attr("transform",`translate(${-A/2-3}, ${R+10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(Rf+R*2+4)+")"))):T.attr("transform","translate(-19, "+(y-12-R/2)+")")})},"drawBranches"),Rhr=w(function(t,e,r,n,i){return sc.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(In==="TB"||In==="BT"?n.width/2:0),e},"setBranchPosition"),_hr=w(function(t,e,r,n){dhr(),de.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){de.error("getConfig method is not available on db");return}const s=i.getConfig(),a=s.rotateCommitLabel??!1;kk=i.getCommits();const o=i.getBranchesAsObjArray();In=i.getDirection();const l=wt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Ve(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&CP.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,x)=>{var E;const b=jGe(v.name),T=l.append("g"),C=T.insert("g").attr("class","branchLabel"),S=C.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const k=b.getBBox();y=Rhr(v.name,y,x,k,a),S.remove(),C.remove(),T.remove()}),M1e(l,kk,!1,s),s.showBranches&&Mhr(l,o,s,e),Ahr(l,kk),M1e(l,kk,!0,s),Kr.insertTitle(l,"gitTitleText",s.titleTopMargin??0,i.getDiagramTitle()),EK(void 0,l,s.diagramPadding,s.useMaxWidth)},"draw"),Lhr={draw:_hr},KGe=8,ZGe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Ihr=new Set(["redux-color","redux-dark-color"]),Nhr=new Set(["neo","neo-dark"]),Dhr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Ohr=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Phr=w(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case Ci.NORMAL:return"commit-normal";case Ci.REVERSE:return"commit-reverse";case Ci.HIGHLIGHT:return"commit-highlight";case Ci.MERGE:return"commit-merge";case Ci.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Fhr=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const s=tWe(t.parents);if(s){const a=n.get(s)??i;return e==="TB"?a.y+Kp:e==="BT"?(n.get(t.id)??i).y-Kp:a.x+Kp}}else return e==="TB"?PI:e==="BT"?(n.get(t.id)??i).y-Kp:0;return 0},"calculatePosition"),zhr=w((t,e,r)=>{var l,u;const n=In==="BT"&&r?e:e+Xp,i=(l=lc.get(t.branch))==null?void 0:l.pos,s=In==="TB"||In==="BT"?(u=lc.get(t.branch))==null?void 0:u.pos:n;if(s===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const a=EP.has(Ve().theme??""),o=In==="TB"||In==="BT"?n:i+(a?rj/2+1:-2);return{x:s,y:o,posWithOffset:n}},"getCommitPosition"),D1e=w((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let a=In==="TB"||In==="BT"?PI:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=w((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);In==="BT"&&(l&&_hr(h,e,a),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(a=Fhr(f,In,a,fc));const p=zhr(f,a,l);if(r){const m=Bhr(f),y=f.customType??f.type,v=((g=lc.get(f.branch))==null?void 0:g.index)??0;Ohr(i,f,p,m,v,y),Phr(s,f,p,a,n),$hr(s,f,p,a)}In==="TB"||In==="BT"?fc.set(f.id,{x:p.x,y:p.posWithOffset}):fc.set(f.id,{x:p.posWithOffset,y:p.y}),a=In==="BT"&&l?a+Kp:a+Kp+Xp,a>If&&(If=a)})},"drawCommits"),Vhr=w((t,e,r,n,i)=>{const a=(In==="TB"||In==="BT"?r.xu.branch===a,"isOnBranchToGetCurve"),l=w(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),Mk=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if($I.every(a=>Math.abs(a-n)>=10))return $I.push(n),n;const s=Math.abs(t-e);return Mk(t,e-s/5,r+1)},"findLane"),Hhr=w((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=Ve(),s=dne.has(i??""),a=fc.get(e.id),o=fc.get(r.id);if(a===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=Vhr(e,r,a,o,n);let u="",h="",d=0,f=0,p=(m=lc.get(r.branch))==null?void 0:m.index;r.type===Ci.MERGE&&e.id!==r.parents[0]&&(p=(y=lc.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const T=a.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ci.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${a.x} ${o.y-d} ${h} ${a.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${o.x+d} ${a.y} ${u} ${o.x} ${a.y+f} L ${o.x} ${o.y}`),a.x===o.x&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`)):In==="BT"?(a.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ci.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${a.x} ${o.y+d} ${u} ${a.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${o.x+d} ${a.y} ${h} ${o.x} ${a.y-f} L ${o.x} ${o.y}`),a.x===o.x&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`)):(a.yo.y&&(r.type===Ci.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${o.x-d} ${a.y} ${u} ${o.x} ${a.y-f} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${a.x} ${o.y+d} ${h} ${a.x+f} ${o.y} L ${o.x} ${o.y}`),a.y===o.y&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+A1(p,E1,s))},"drawArrow"),Ghr=w((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(s=>{Hhr(r,e.get(s),i,e)})})},"drawArrows"),Whr=w((t,e,r,n)=>{const{look:i,theme:s,themeVariables:a}=Ve(),{dropShadow:o,THEME_COLOR_LIMIT:l}=a,u=EP.has(s??""),h=dne.has(s??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=A1(p,u?l:E1,h),m=(_=lc.get(f.name))==null?void 0:_.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=In==="TB"||In==="BT"?m:u?m+rj/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",If),v.attr("y2",y),v.attr("class","branch branch"+g),In==="TB"?(v.attr("y1",PI),v.attr("x1",m),v.attr("y2",If),v.attr("x2",m)):In==="BT"&&(v.attr("y1",If),v.attr("x1",m),v.attr("y2",PI),v.attr("x2",m)),$I.push(y);const x=f.name,b=eWe(x),T=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const k=b.getBBox(),E=u?0:4,A=u?16:0,R=u?rj:0;i==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+A).attr("height",k.height+4+R),S.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+A/2)+", "+(y-k.height/2-2)+")"),In==="TB"?(T.attr("x",m-k.width/2-10).attr("y",0),S.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(T.attr("transform",`translate(${-A/2-3}, ${-R-10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(-R*2+7)+")"))):In==="BT"?(T.attr("x",m-k.width/2-10).attr("y",If),S.attr("transform","translate("+(m-k.width/2-5)+", "+If+")"),u&&(T.attr("transform",`translate(${-A/2-3}, ${R+10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(If+R*2+4)+")"))):T.attr("transform","translate(-19, "+(y-12-R/2)+")")})},"drawBranches"),qhr=w(function(t,e,r,n,i){return lc.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(In==="TB"||In==="BT"?n.width/2:0),e},"setBranchPosition"),Uhr=w(function(t,e,r,n){Mhr(),de.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){de.error("getConfig method is not available on db");return}const s=i.getConfig(),a=s.rotateCommitLabel??!1;Ak=i.getCommits();const o=i.getBranchesAsObjArray();In=i.getDirection();const l=wt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Ve(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&EP.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,x)=>{var E;const b=eWe(v.name),T=l.append("g"),C=T.insert("g").attr("class","branchLabel"),S=C.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const k=b.getBBox();y=qhr(v.name,y,x,k,a),S.remove(),C.remove(),T.remove()}),D1e(l,Ak,!1,s),s.showBranches&&Whr(l,o,s,e),Ghr(l,Ak),D1e(l,Ak,!0,s),Kr.insertTitle(l,"gitTitleText",s.titleTopMargin??0,i.getDiagramTitle()),_K(void 0,l,s.diagramPadding,s.useMaxWidth)},"draw"),Yhr={draw:Uhr},rWe=8,nWe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),jhr=new Set(["redux-color","redux-dark-color"]),Xhr=new Set(["neo","neo-dark"]),Khr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Zhr=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Qhr=w(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=vr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,s=ZGe.has(r);if(Nhr.has(r)){let a="";for(let o=0;o{const e=br(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,s=nWe.has(r);if(Xhr.has(r)){let a="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%KGe;return` + `;return a}},"genColor"),edr=w(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%rWe;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` -`)}`,"normalTheme"),Fhr=w(t=>{const e=vr(),{theme:r}=e,n=Ohr.has(r);return` +`)}`,"normalTheme"),tdr=w(t=>{const e=br(),{theme:r}=e,n=Zhr.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -3647,7 +3654,7 @@ lodash-es/lodash.js: font-family: var(--mermaid-font-family); } - ${n?$hr(t):Bhr(t)} + ${n?Jhr(t):edr(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -3678,7 +3685,7 @@ lodash-es/lodash.js: .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${ZGe.has(r)?t.strokeWidth:8}; + stroke-width: ${nWe.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -3687,12 +3694,12 @@ lodash-es/lodash.js: font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),zhr=Fhr,Vhr={parser:uhr,db:YGe,renderer:Lhr,styles:zhr};const Hhr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vhr},Symbol.toStringTag,{value:"Module"}));var NR={exports:{}},Ghr=NR.exports,R1e;function Whr(){return R1e||(R1e=1,(function(t,e){(function(r,n){t.exports=n()})(Ghr,(function(){var r="day";return function(n,i,s){var a=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return a(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=a(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?s.utc:s)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(NR)),NR.exports}var qhr=Whr();const Uhr=qg(qhr);var DR={exports:{}},Yhr=DR.exports,_1e;function jhr(){return _1e||(_1e=1,(function(t,e){(function(r,n){t.exports=n()})(Yhr,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var x,b=l.meridiem;if(b){for(var T=1;T<=24;T+=1)if(y.indexOf(b(T,0,v))>-1){x=T>12;break}}else x=y===(v?"pm":"PM");return x},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[s,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[a,h("seconds")],ss:[a,h("seconds")],m:[a,h("minutes")],mm:[a,h("minutes")],H:[a,h("hours")],h:[a,h("hours")],HH:[a,h("hours")],hh:[a,h("hours")],D:[a,h("day")],DD:[s,h("day")],Do:[o,function(y){var v=l.ordinal,x=y.match(/\d+/);if(this.day=x[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[a,h("week")],ww:[s,h("week")],M:[a,h("month")],MM:[s,h("month")],MMM:[o,function(y){var v=f("months"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[s,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(R,_,P){var N=P&&P.toUpperCase();return _||x[P]||r[P]||x[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(L,I,$){return I||$.slice(1)}))}))).match(n),T=b.length,C=0;C-1)return new Date((D==="X"?1e3:1)*O);var V=m(D)(O),B=V.year,H=V.month,G=V.day,W=V.hours,K=V.minutes,q=V.seconds,oe=V.milliseconds,Q=V.zone,Z=V.week,re=new Date,ie=G||(B||H?1:re.getDate()),me=B||re.getFullYear(),te=0;B&&!H||(te=H>0?H-1:re.getMonth());var _e,$e=W||0,Fe=K||0,ce=q||0,he=oe||0;return Q?new Date(Date.UTC(me,te,ie,$e,Fe,ce,he+60*Q.offset*1e3)):F?new Date(Date.UTC(me,te,ie,$e,Fe,ce,he)):(_e=new Date(me,te,ie,$e,Fe,ce,he),Z&&(_e=z(_e).week(Z).toDate()),_e)}catch{return new Date("")}})(S,A,k,x),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),P&&S!=this.format(A)&&(this.$d=new Date("")),l={}}else if(A instanceof Array)for(var L=A.length,I=1;I<=L;I+=1){E[1]=A[I-1];var $=x.apply(this,E);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===L&&(this.$d=new Date(""))}else T.call(this,C)}}}))})(DR)),DR.exports}var Xhr=jhr();const Khr=qg(Xhr);var OR={exports:{}},Zhr=OR.exports,L1e;function Qhr(){return L1e||(L1e=1,(function(t,e){(function(r,n){t.exports=n()})(Zhr,(function(){return function(r,n){var i=n.prototype,s=i.format;i.format=function(a){var o=this,l=this.$locale();if(!this.isValid())return s.bind(this)(a);var u=this.$utils(),h=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return s.bind(this)(h)}}}))})(OR)),OR.exports}var Jhr=Qhr();const edr=qg(Jhr);var PR={exports:{}},tdr=PR.exports,I1e;function rdr(){return I1e||(I1e=1,(function(t,e){(function(r,n){t.exports=n()})(tdr,(function(){var r,n,i=1e3,s=6e4,a=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof T},g=function(S,k,E){return new T(S,E,k.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},x=function(S){return Math.abs(S)},b=function(S,k){return S?y(S)?{negative:!0,format:""+x(S)+k}:{negative:!1,format:""+S+k}:{negative:!1,format:""}},T=(function(){function S(E,A,R){var _=this;if(this.$d={},this.$l=R,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),A)return g(E*f[m(A)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(L){_.$d[m(L)]=E[L]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var N=P.slice(2).map((function(L){return L!=null?Number(L):0}));return this.$d.years=N[0],this.$d.months=N[1],this.$d.weeks=N[2],this.$d.days=N[3],this.$d.hours=N[4],this.$d.minutes=N[5],this.$d.seconds=N[6],this.calMilliseconds(),this}}return this}var k=S.prototype;return k.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(A,R){return A+(E.$d[R]||0)*f[R]}),0)},k.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/a),E%=a,this.$d.minutes=v(E/s),E%=s,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},k.toISOString=function(){var E=b(this.$d.years,"Y"),A=b(this.$d.months,"M"),R=+this.$d.days||0;this.$d.weeks&&(R+=7*this.$d.weeks);var _=b(R,"D"),P=b(this.$d.hours,"H"),N=b(this.$d.minutes,"M"),L=this.$d.seconds||0;this.$d.milliseconds&&(L+=this.$d.milliseconds/1e3,L=Math.round(1e3*L)/1e3);var I=b(L,"S"),$=E.negative||A.negative||_.negative||P.negative||N.negative||I.negative,O=P.format||N.format||I.format?"T":"",D=($?"-":"")+"P"+E.format+A.format+_.format+O+P.format+N.format+I.format;return D==="P"||D==="-P"?"P0D":D},k.toJSON=function(){return this.toISOString()},k.format=function(E){var A=E||"YYYY-MM-DDTHH:mm:ss",R={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return A.replace(d,(function(_,P){return P||String(R[_])}))},k.as=function(E){return this.$ms/f[m(E)]},k.get=function(E){var A=this.$ms,R=m(E);return R==="milliseconds"?A%=1e3:A=R==="weeks"?v(A/f[R]):this.$d[R],A||0},k.add=function(E,A,R){var _;return _=A?E*f[m(A)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+_*(R?-1:1),this)},k.subtract=function(E,A){return this.add(E,A,!0)},k.locale=function(E){var A=this.clone();return A.$l=E,A},k.clone=function(){return g(this.$ms,this)},k.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},S})(),C=function(S,k,E){return S.add(k.years()*E,"y").add(k.months()*E,"M").add(k.days()*E,"d").add(k.hours()*E,"h").add(k.minutes()*E,"m").add(k.seconds()*E,"s").add(k.milliseconds()*E,"ms")};return function(S,k,E){r=E,n=E().$utils(),E.duration=function(_,P){var N=E.locale();return g(_,{$l:N},P)},E.isDuration=p;var A=k.prototype.add,R=k.prototype.subtract;k.prototype.add=function(_,P){return p(_)?C(this,_,1):A.bind(this)(_,P)},k.prototype.subtract=function(_,P){return p(_)?C(this,_,-1):R.bind(this)(_,P)}}}))})(PR)),PR.exports}var ndr=rdr();const idr=qg(ndr);var JY=(function(){var t=w(function(N,L,I,$){for(I=I||{},$=N.length;$--;I[N[$]]=L);return I},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],s=[1,29],a=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],T=[1,20],C=[1,21],S=[1,22],k=[1,23],E=[1,25],A=[1,35],R={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:w(function(L,I,$,O,D,F,z){var V=F.length-1;switch(D){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:O.TopAxis(),this.$=F[V].substr(8);break;case 20:O.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:O.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:O.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:O.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:O.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:O.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:O.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],O.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],null),O.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-2],F[V-1]),O.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],O.setClickEvent(F[V-2],F[V],null),O.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-1],F[V]),O.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],O.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:s,16:a,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:T,33:C,35:S,36:k,37:24,38:E,40:A},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:s,16:a,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:T,33:C,35:S,36:k,37:24,38:E,40:A},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:w(function(L,I){if(I.recoverable)this.trace(L);else{var $=new Error(L);throw $.hash=I,$}},"parseError"),parse:w(function(L){var I=this,$=[0],O=[],D=[null],F=[],z=this.table,V="",B=0,H=0,G=2,W=1,K=F.slice.call(arguments,1),q=Object.create(this.lexer),oe={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(oe.yy[Q]=this.yy[Q]);q.setInput(L,oe.yy),oe.yy.lexer=q,oe.yy.parser=this,typeof q.yylloc>"u"&&(q.yylloc={});var Z=q.yylloc;F.push(Z);var re=q.options&&q.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(Me){$.length=$.length-2*Me,D.length=D.length-Me,F.length=F.length-Me}w(ie,"popStack");function me(){var Me;return Me=O.pop()||q.lex()||W,typeof Me!="number"&&(Me instanceof Array&&(O=Me,Me=O.pop()),Me=I.symbols_[Me]||Me),Me}w(me,"lex");for(var te,_e,$e,Fe,ce={},he,Te,ge,He;;){if(_e=$[$.length-1],this.defaultActions[_e]?$e=this.defaultActions[_e]:((te===null||typeof te>"u")&&(te=me()),$e=z[_e]&&z[_e][te]),typeof $e>"u"||!$e.length||!$e[0]){var we="";He=[];for(he in z[_e])this.terminals_[he]&&he>G&&He.push("'"+this.terminals_[he]+"'");q.showPosition?we="Parse error on line "+(B+1)+`: +`},"getStyles"),rdr=tdr,ndr={parser:Ehr,db:JGe,renderer:Yhr,styles:rdr};const idr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ndr},Symbol.toStringTag,{value:"Module"}));var $R={exports:{}},sdr=$R.exports,O1e;function adr(){return O1e||(O1e=1,(function(t,e){(function(r,n){t.exports=n()})(sdr,(function(){var r="day";return function(n,i,s){var a=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return a(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=a(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?s.utc:s)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})($R)),$R.exports}var odr=adr();const ldr=jg(odr);var BR={exports:{}},cdr=BR.exports,P1e;function udr(){return P1e||(P1e=1,(function(t,e){(function(r,n){t.exports=n()})(cdr,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var x,b=l.meridiem;if(b){for(var T=1;T<=24;T+=1)if(y.indexOf(b(T,0,v))>-1){x=T>12;break}}else x=y===(v?"pm":"PM");return x},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[s,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[a,h("seconds")],ss:[a,h("seconds")],m:[a,h("minutes")],mm:[a,h("minutes")],H:[a,h("hours")],h:[a,h("hours")],HH:[a,h("hours")],hh:[a,h("hours")],D:[a,h("day")],DD:[s,h("day")],Do:[o,function(y){var v=l.ordinal,x=y.match(/\d+/);if(this.day=x[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[a,h("week")],ww:[s,h("week")],M:[a,h("month")],MM:[s,h("month")],MMM:[o,function(y){var v=f("months"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[s,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(R,_,P){var N=P&&P.toUpperCase();return _||x[P]||r[P]||x[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(L,I,$){return I||$.slice(1)}))}))).match(n),T=b.length,C=0;C-1)return new Date((D==="X"?1e3:1)*O);var V=m(D)(O),B=V.year,H=V.month,G=V.day,W=V.hours,K=V.minutes,q=V.seconds,oe=V.milliseconds,Q=V.zone,Z=V.week,re=new Date,ie=G||(B||H?1:re.getDate()),me=B||re.getFullYear(),te=0;B&&!H||(te=H>0?H-1:re.getMonth());var _e,$e=W||0,Fe=K||0,ce=q||0,he=oe||0;return Q?new Date(Date.UTC(me,te,ie,$e,Fe,ce,he+60*Q.offset*1e3)):F?new Date(Date.UTC(me,te,ie,$e,Fe,ce,he)):(_e=new Date(me,te,ie,$e,Fe,ce,he),Z&&(_e=z(_e).week(Z).toDate()),_e)}catch{return new Date("")}})(S,A,k,x),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),P&&S!=this.format(A)&&(this.$d=new Date("")),l={}}else if(A instanceof Array)for(var L=A.length,I=1;I<=L;I+=1){E[1]=A[I-1];var $=x.apply(this,E);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===L&&(this.$d=new Date(""))}else T.call(this,C)}}}))})(BR)),BR.exports}var hdr=udr();const ddr=jg(hdr);var FR={exports:{}},fdr=FR.exports,$1e;function pdr(){return $1e||($1e=1,(function(t,e){(function(r,n){t.exports=n()})(fdr,(function(){return function(r,n){var i=n.prototype,s=i.format;i.format=function(a){var o=this,l=this.$locale();if(!this.isValid())return s.bind(this)(a);var u=this.$utils(),h=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return s.bind(this)(h)}}}))})(FR)),FR.exports}var gdr=pdr();const mdr=jg(gdr);var zR={exports:{}},ydr=zR.exports,B1e;function vdr(){return B1e||(B1e=1,(function(t,e){(function(r,n){t.exports=n()})(ydr,(function(){var r,n,i=1e3,s=6e4,a=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof T},g=function(S,k,E){return new T(S,E,k.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},x=function(S){return Math.abs(S)},b=function(S,k){return S?y(S)?{negative:!0,format:""+x(S)+k}:{negative:!1,format:""+S+k}:{negative:!1,format:""}},T=(function(){function S(E,A,R){var _=this;if(this.$d={},this.$l=R,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),A)return g(E*f[m(A)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(L){_.$d[m(L)]=E[L]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var N=P.slice(2).map((function(L){return L!=null?Number(L):0}));return this.$d.years=N[0],this.$d.months=N[1],this.$d.weeks=N[2],this.$d.days=N[3],this.$d.hours=N[4],this.$d.minutes=N[5],this.$d.seconds=N[6],this.calMilliseconds(),this}}return this}var k=S.prototype;return k.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(A,R){return A+(E.$d[R]||0)*f[R]}),0)},k.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/a),E%=a,this.$d.minutes=v(E/s),E%=s,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},k.toISOString=function(){var E=b(this.$d.years,"Y"),A=b(this.$d.months,"M"),R=+this.$d.days||0;this.$d.weeks&&(R+=7*this.$d.weeks);var _=b(R,"D"),P=b(this.$d.hours,"H"),N=b(this.$d.minutes,"M"),L=this.$d.seconds||0;this.$d.milliseconds&&(L+=this.$d.milliseconds/1e3,L=Math.round(1e3*L)/1e3);var I=b(L,"S"),$=E.negative||A.negative||_.negative||P.negative||N.negative||I.negative,O=P.format||N.format||I.format?"T":"",D=($?"-":"")+"P"+E.format+A.format+_.format+O+P.format+N.format+I.format;return D==="P"||D==="-P"?"P0D":D},k.toJSON=function(){return this.toISOString()},k.format=function(E){var A=E||"YYYY-MM-DDTHH:mm:ss",R={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return A.replace(d,(function(_,P){return P||String(R[_])}))},k.as=function(E){return this.$ms/f[m(E)]},k.get=function(E){var A=this.$ms,R=m(E);return R==="milliseconds"?A%=1e3:A=R==="weeks"?v(A/f[R]):this.$d[R],A||0},k.add=function(E,A,R){var _;return _=A?E*f[m(A)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+_*(R?-1:1),this)},k.subtract=function(E,A){return this.add(E,A,!0)},k.locale=function(E){var A=this.clone();return A.$l=E,A},k.clone=function(){return g(this.$ms,this)},k.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},S})(),C=function(S,k,E){return S.add(k.years()*E,"y").add(k.months()*E,"M").add(k.days()*E,"d").add(k.hours()*E,"h").add(k.minutes()*E,"m").add(k.seconds()*E,"s").add(k.milliseconds()*E,"ms")};return function(S,k,E){r=E,n=E().$utils(),E.duration=function(_,P){var N=E.locale();return g(_,{$l:N},P)},E.isDuration=p;var A=k.prototype.add,R=k.prototype.subtract;k.prototype.add=function(_,P){return p(_)?C(this,_,1):A.bind(this)(_,P)},k.prototype.subtract=function(_,P){return p(_)?C(this,_,-1):R.bind(this)(_,P)}}}))})(zR)),zR.exports}var bdr=vdr();const xdr=jg(bdr);var nj=(function(){var t=w(function(N,L,I,$){for(I=I||{},$=N.length;$--;I[N[$]]=L);return I},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],s=[1,29],a=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],x=[1,16],b=[1,19],T=[1,20],C=[1,21],S=[1,22],k=[1,23],E=[1,25],A=[1,35],R={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:w(function(L,I,$,O,D,F,z){var V=F.length-1;switch(D){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:O.TopAxis(),this.$=F[V].substr(8);break;case 20:O.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:O.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:O.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:O.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:O.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:O.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:O.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],O.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],null),O.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-2],F[V-1]),O.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],O.setClickEvent(F[V-2],F[V],null),O.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-1],F[V]),O.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],O.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:s,16:a,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:T,33:C,35:S,36:k,37:24,38:E,40:A},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:s,16:a,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:x,30:b,31:T,33:C,35:S,36:k,37:24,38:E,40:A},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:w(function(L,I){if(I.recoverable)this.trace(L);else{var $=new Error(L);throw $.hash=I,$}},"parseError"),parse:w(function(L){var I=this,$=[0],O=[],D=[null],F=[],z=this.table,V="",B=0,H=0,G=2,W=1,K=F.slice.call(arguments,1),q=Object.create(this.lexer),oe={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(oe.yy[Q]=this.yy[Q]);q.setInput(L,oe.yy),oe.yy.lexer=q,oe.yy.parser=this,typeof q.yylloc>"u"&&(q.yylloc={});var Z=q.yylloc;F.push(Z);var re=q.options&&q.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(Me){$.length=$.length-2*Me,D.length=D.length-Me,F.length=F.length-Me}w(ie,"popStack");function me(){var Me;return Me=O.pop()||q.lex()||W,typeof Me!="number"&&(Me instanceof Array&&(O=Me,Me=O.pop()),Me=I.symbols_[Me]||Me),Me}w(me,"lex");for(var te,_e,$e,Fe,ce={},he,Te,ge,He;;){if(_e=$[$.length-1],this.defaultActions[_e]?$e=this.defaultActions[_e]:((te===null||typeof te>"u")&&(te=me()),$e=z[_e]&&z[_e][te]),typeof $e>"u"||!$e.length||!$e[0]){var we="";He=[];for(he in z[_e])this.terminals_[he]&&he>G&&He.push("'"+this.terminals_[he]+"'");q.showPosition?we="Parse error on line "+(B+1)+`: `+q.showPosition()+` Expecting `+He.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse error on line "+(B+1)+": Unexpected "+(te==W?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(we,{text:q.match,token:this.terminals_[te]||te,line:q.yylineno,loc:Z,expected:He})}if($e[0]instanceof Array&&$e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+te);switch($e[0]){case 1:$.push(te),D.push(q.yytext),F.push(q.yylloc),$.push($e[1]),te=null,H=q.yyleng,V=q.yytext,B=q.yylineno,Z=q.yylloc;break;case 2:if(Te=this.productions_[$e[1]][1],ce.$=D[D.length-Te],ce._$={first_line:F[F.length-(Te||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(Te||1)].first_column,last_column:F[F.length-1].last_column},re&&(ce._$.range=[F[F.length-(Te||1)].range[0],F[F.length-1].range[1]]),Fe=this.performAction.apply(ce,[V,H,B,oe.yy,$e[1],D,F].concat(K)),typeof Fe<"u")return Fe;Te&&($=$.slice(0,-1*Te*2),D=D.slice(0,-1*Te),F=F.slice(0,-1*Te)),$.push(this.productions_[$e[1]][0]),D.push(ce.$),F.push(ce._$),ge=z[$[$.length-2]][$[$.length-1]],$.push(ge);break;case 3:return!0}}return!0},"parse")},_=(function(){var N={EOF:1,parseError:w(function(I,$){if(this.yy.parser)this.yy.parser.parseError(I,$);else throw new Error(I)},"parseError"),setInput:w(function(L,I){return this.yy=I||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:w(function(){var L=this._input[0];this.yytext+=L,this.yyleng++,this.offset++,this.match+=L,this.matched+=L;var I=L.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),L},"input"),unput:w(function(L){var I=L.length,$=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1&&(this.yylineno-=$.length-1);var 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:$?($.length===O.length?this.yylloc.first_column:0)+O[O.length-$.length].length-$[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-I]),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(L){this.unput(this.match.slice(L))},"less"),pastInput:w(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:w(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:w(function(){var L=this.pastInput(),I=new Array(L.length+1).join("-");return L+this.upcomingInput()+` `+I+"^"},"showPosition"),test_match:w(function(L,I){var $,O,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))),O=L[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+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],$=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var F in D)this[F]=D[F];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var L,I,$,O;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),F=0;FI[0].length)){if(I=$,O=F,this.options.backtrack_lexer){if(L=this.test_match($,D[F]),L!==!1)return L;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(L=this.test_match(I,D[O]),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:w(function(){var I=this.next();return I||this.lex()},"lex"),begin:w(function(I){this.conditionStack.push(I)},"begin"),popState:w(function(){var I=this.conditionStack.length-1;return I>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(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:w(function(I){this.begin(I)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(I,$,O,D){switch(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return N})();R.lexer=_;function P(){this.yy={}}return w(P,"Parser"),P.prototype=R,R.Parser=P,new P})();JY.parser=JY;var sdr=JY;Wa.extend(Uhr);Wa.extend(Khr);Wa.extend(edr);var N1e={friday:5,saturday:6},vd="",cne="",une=void 0,hne="",B5=[],F5=[],dne=new Map,fne=[],OI=[],z5="",pne="",QGe=["active","done","crit","milestone","vert"],gne=[],fb="",X7=!1,mne=!1,yne="sunday",PI="saturday",ej=0,adr=w(function(){fne=[],OI=[],z5="",gne=[],$R=0,rj=void 0,BR=void 0,ya=[],vd="",cne="",pne="",une=void 0,hne="",B5=[],F5=[],X7=!1,mne=!1,ej=0,dne=new Map,fb="",Ri(),yne="sunday",PI="saturday"},"clear"),odr=w(function(t){fb=t},"setDiagramId"),ldr=w(function(t){cne=t},"setAxisFormat"),cdr=w(function(){return cne},"getAxisFormat"),udr=w(function(t){une=t},"setTickInterval"),hdr=w(function(){return une},"getTickInterval"),ddr=w(function(t){hne=t},"setTodayMarker"),fdr=w(function(){return hne},"getTodayMarker"),pdr=w(function(t){vd=t},"setDateFormat"),gdr=w(function(){X7=!0},"enableInclusiveEndDates"),mdr=w(function(){return X7},"endDatesAreInclusive"),ydr=w(function(){mne=!0},"enableTopAxis"),vdr=w(function(){return mne},"topAxisEnabled"),bdr=w(function(t){pne=t},"setDisplayMode"),xdr=w(function(){return pne},"getDisplayMode"),wdr=w(function(){return vd},"getDateFormat"),JGe=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Tdr=w(function(t){B5=JGe(B5,t)},"setIncludes"),Cdr=w(function(){return B5},"getIncludes"),kdr=w(function(t){F5=JGe(F5,t)},"setExcludes"),Sdr=w(function(){return F5},"getExcludes"),Edr=w(function(){return dne},"getLinks"),Adr=w(function(t){z5=t,fne.push(t)},"addSection"),Mdr=w(function(){return fne},"getSections"),Rdr=w(function(){let t=D1e();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,a]},"fixTaskDates"),tj=w(function(t,e,r){if(r=r.trim(),w(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const s=/^after\s+(?[\d\w- ]+)/.exec(r);if(s!==null){let o=null;for(const u of s.groups.ids.split(" ")){let h=Mv(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let a=Wa(r,e.trim(),!0);if(a.isValid())return a.toDate();{de.debug("Invalid date:"+r),de.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),rWe=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),nWe=w(function(t,e,r,n=!1){r=r.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(r);if(s!==null){let h=null;for(const f of s.groups.ids.split(" ")){let p=Mv(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),dne.set(n,r))}),sWe(t,"clickable")},"setLink"),sWe=w(function(t,e){t.split(",").forEach(function(r){let n=Mv(r);n!==void 0&&n.classes.push(e)})},"setClass"),Fdr=w(function(t,e,r){if(Ve().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{Kr.runFunc(e,...n)})},"setClickFun"),aWe=w(function(t,e){gne.push(function(){const r=fb?`${fb}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=fb?`${fb}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),zdr=w(function(t,e,r){t.split(",").forEach(function(n){Fdr(n,e,r)}),sWe(t,"clickable")},"setClickEvent"),Vdr=w(function(t){gne.forEach(function(e){e(t)})},"bindFunctions"),Hdr={getConfig:w(()=>Ve().gantt,"getConfig"),clear:adr,setDateFormat:pdr,getDateFormat:wdr,enableInclusiveEndDates:gdr,endDatesAreInclusive:mdr,enableTopAxis:ydr,topAxisEnabled:vdr,setAxisFormat:ldr,getAxisFormat:cdr,setTickInterval:udr,getTickInterval:hdr,setTodayMarker:ddr,getTodayMarker:fdr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,setDiagramId:odr,setDisplayMode:bdr,getDisplayMode:xdr,setAccDescription:rs,getAccDescription:ns,addSection:Adr,getSections:Mdr,getTasks:Rdr,addTask:Pdr,findTaskById:Mv,addTaskOrg:$dr,setIncludes:Tdr,getIncludes:Cdr,setExcludes:kdr,getExcludes:Sdr,setClickEvent:zdr,setLink:Bdr,getLinks:Edr,bindFunctions:Vdr,parseDuration:rWe,isInvalidDate:eWe,setWeekday:_dr,getWeekday:Ldr,setWeekend:Idr};function vne(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),n=!0)})}w(vne,"getTaskTags");Wa.extend(idr);var Gdr=w(function(){de.debug("Something is calling, setConf, remove the call")},"setConf"),O1e={monday:d6,tuesday:KTe,wednesday:ZTe,thursday:xy,friday:QTe,saturday:JTe,sunday:KE},Wdr=w((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of n)for(let a=0;a=r[a]){r[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),gf,pV=1e4,qdr=w(function(t,e,r,n){const i=Ve().gantt;n.db.setDiagramId(e);const s=Ve().securityLevel;let a;s==="sandbox"&&(a=wt("#i"+e));const o=wt(s==="sandbox"?a.nodes()[0].contentDocument.body:"body"),l=s==="sandbox"?a.nodes()[0].contentDocument:document,u=l.getElementById(e);gf=u.parentElement.offsetWidth,gf===void 0&&(gf=1200),i.useWidth!==void 0&&(gf=i.useWidth);const h=n.db.getTasks(),d=h.filter(R=>!R.vert);let f=[];for(const R of d)f.push(R.type);f=A(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const R={};for(const P of d)R[P.section]===void 0?R[P.section]=[P]:R[P.section].push(P);let _=0;for(const P of Object.keys(R)){const N=Wdr(R[P],_)+1;_+=N,g+=N*(i.barHeight+i.barGap),p[P]=N}}else{g+=d.length*(i.barHeight+i.barGap);for(const R of f)p[R]=d.filter(_=>_.type===R).length}u.setAttribute("viewBox","0 0 "+gf+" "+g);const m=o.select(`[id="${e}"]`),y=Qxt().domain([s1t(h,function(R){return R.startTime}),i1t(h,function(R){return R.endTime})]).rangeRound([0,gf-i.leftPadding-i.rightPadding]);function v(R,_){const P=R.startTime,N=_.startTime;let L=0;return P>N?L=1:PH.vert===G.vert?0:H.vert?1:-1);const O=R.filter(H=>!H.vert),F=[...new Set(O.map(H=>H.order))].map(H=>O.find(G=>G.order===H));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(H,G){return G=H.order,G*_+P-2}).attr("width",function(){return $-i.rightPadding/2}).attr("height",_).attr("class",function(H){for(const[G,W]of f.entries())if(H.type===W)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(R).enter(),V=n.db.getLinks();if(z.append("rect").attr("id",function(H){return e+"-"+H.id}).attr("rx",3).attr("ry",3).attr("x",function(H){return H.milestone?y(H.startTime)+N+.5*(y(H.endTime)-y(H.startTime))-.5*L:y(H.startTime)+N}).attr("y",function(H,G){return G=H.order,H.vert?i.gridLineStartPadding:G*_+P}).attr("width",function(H){return H.milestone?L:H.vert?.08*L:y(H.renderEndTime||H.endTime)-y(H.startTime)}).attr("height",function(H){return H.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:L}).attr("transform-origin",function(H,G){return G=H.order,(y(H.startTime)+N+.5*(y(H.endTime)-y(H.startTime))).toString()+"px "+(G*_+P+.5*L).toString()+"px"}).attr("class",function(H){const G="task";let W="";H.classes.length>0&&(W=H.classes.join(" "));let K=0;for(const[oe,Q]of f.entries())H.type===Q&&(K=oe%i.numberSectionStyles);let q="";return H.active?H.crit?q+=" activeCrit":q=" active":H.done?H.crit?q=" doneCrit":q=" done":H.crit&&(q+=" crit"),q.length===0&&(q=" task"),H.milestone&&(q=" milestone "+q),H.vert&&(q=" vert "+q),q+=K,q+=" "+W,G+q}),z.append("text").attr("id",function(H){return e+"-"+H.id+"-text"}).text(function(H){return H.task}).attr("font-size",i.fontSize).attr("x",function(H){let G=y(H.startTime),W=y(H.renderEndTime||H.endTime);if(H.milestone&&(G+=.5*(y(H.endTime)-y(H.startTime))-.5*L,W=G+L),H.vert)return y(H.startTime)+N;const K=this.getBBox().width;return K>W-G?W+K+1.5*i.leftPadding>$?G+N-5:W+N+5:(W-G)/2+G+N}).attr("y",function(H,G){return H.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(G=H.order,G*_+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",L).attr("class",function(H){const G=y(H.startTime);let W=y(H.endTime);H.milestone&&(W=G+L);const K=this.getBBox().width;let q="";H.classes.length>0&&(q=H.classes.join(" "));let oe=0;for(const[Z,re]of f.entries())H.type===re&&(oe=Z%i.numberSectionStyles);let Q="";return H.active&&(H.crit?Q="activeCritText"+oe:Q="activeText"+oe),H.done?H.crit?Q=Q+" doneCritText"+oe:Q=Q+" doneText"+oe:H.crit&&(Q=Q+" critText"+oe),H.milestone&&(Q+=" milestoneText"),H.vert&&(Q+=" vertText"),K>W-G?W+K+1.5*i.leftPadding>$?q+" taskTextOutsideLeft taskTextOutside"+oe+" "+Q:q+" taskTextOutsideRight taskTextOutside"+oe+" "+Q+" width-"+K:q+" taskText taskText"+oe+" "+Q+" width-"+K}),Ve().securityLevel==="sandbox"){let H;H=wt("#i"+e);const G=H.nodes()[0].contentDocument;z.filter(function(W){return V.has(W.id)}).each(function(W){var K=G.querySelector("#"+CSS.escape(e+"-"+W.id)),q=G.querySelector("#"+CSS.escape(e+"-"+W.id+"-text"));const oe=K.parentNode;var Q=G.createElement("a");Q.setAttribute("xlink:href",V.get(W.id)),Q.setAttribute("target","_top"),oe.appendChild(Q),Q.appendChild(K),Q.appendChild(q)})}}w(b,"drawRects");function T(R,_,P,N,L,I,$,O){if($.length===0&&O.length===0)return;let D,F;for(const{startTime:W,endTime:K}of I)(D===void 0||WF)&&(F=K);if(!D||!F)return;if(Wa(F).diff(Wa(D),"year")>5){de.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const z=n.db.getDateFormat(),V=[];let B=null,H=Wa(D);for(;H.valueOf()<=F;)n.db.isInvalidDate(H,z,$,O)?B?B.end=H:B={start:H,end:H}:B&&(V.push(B),B=null),H=H.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",W=>e+"-exclude-"+W.start.format("YYYY-MM-DD")).attr("x",W=>y(W.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",W=>y(W.end.endOf("day"))-y(W.start.startOf("day"))).attr("height",L-_-i.gridLineStartPadding).attr("transform-origin",function(W,K){return(y(W.start)+P+.5*(y(W.end)-y(W.start))).toString()+"px "+(K*R+.5*L).toString()+"px"}).attr("class","exclude-range")}w(T,"drawExcludeDays");function C(R,_,P,N){if(P<=0||R>_)return 1/0;const L=_-R,I=Wa.duration({[N??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(L/I)}w(C,"getEstimatedTickCount");function S(R,_,P,N){const L=n.db.getDateFormat(),I=n.db.getAxisFormat();let $;I?$=I:L==="D"?$="%d":$=i.axisFormat??"%Y-%m-%d";let O=p1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(G9($));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const z=parseInt(F[1],10);if(isNaN(z)||z<=0)de.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],B=n.db.getWeekday()||i.weekday,H=y.domain(),G=H[0],W=H[1],K=C(G,W,z,V);if(K>pV)de.warn(`The tick interval "${z}${V}" would generate ${K} ticks, which exceeds the maximum allowed (${pV}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(i5.every(z));break;case"second":O.ticks(Pp.every(z));break;case"minute":O.ticks(u6.every(z));break;case"hour":O.ticks(h6.every(z));break;case"day":O.ticks(by.every(z));break;case"week":O.ticks(O1e[B].every(z));break;case"month":O.ticks(f6.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+R+", "+(N-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let z=f1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(G9($));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)de.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],H=n.db.getWeekday()||i.weekday,G=y.domain(),W=G[0],K=G[1];if(C(W,K,V,B)<=pV)switch(B){case"millisecond":z.ticks(i5.every(V));break;case"second":z.ticks(Pp.every(V));break;case"minute":z.ticks(u6.every(V));break;case"hour":z.ticks(h6.every(V));break;case"day":z.ticks(by.every(V));break;case"week":z.ticks(O1e[H].every(V));break;case"month":z.ticks(f6.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+R+", "+_+")").call(z).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}w(S,"makeGrid");function k(R,_){let P=0;const N=Object.keys(p).map(L=>[L,p[L]]);m.append("g").selectAll("text").data(N).enter().append(function(L){const I=L[0].split(Vt.lineBreakRegex),$=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",$+"em");for(const[D,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),D>0&&z.setAttribute("dy","1em"),z.textContent=F,O.appendChild(z)}return O}).attr("x",10).attr("y",function(L,I){if(I>0)for(let $=0;$` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var I=this.next();return I||this.lex()},"lex"),begin:w(function(I){this.conditionStack.push(I)},"begin"),popState:w(function(){var I=this.conditionStack.length-1;return I>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(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:w(function(I){this.begin(I)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(I,$,O,D){switch(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return N})();R.lexer=_;function P(){this.yy={}}return w(P,"Parser"),P.prototype=R,R.Parser=P,new P})();nj.parser=nj;var wdr=nj;Wa.extend(ldr);Wa.extend(ddr);Wa.extend(mdr);var F1e={friday:5,saturday:6},wd="",fne="",pne=void 0,gne="",V5=[],H5=[],mne=new Map,yne=[],BI=[],G5="",vne="",iWe=["active","done","crit","milestone","vert"],bne=[],gb="",Q7=!1,xne=!1,wne="sunday",FI="saturday",ij=0,Tdr=w(function(){yne=[],BI=[],G5="",bne=[],VR=0,aj=void 0,HR=void 0,ya=[],wd="",fne="",vne="",pne=void 0,gne="",V5=[],H5=[],Q7=!1,xne=!1,ij=0,mne=new Map,gb="",Ri(),wne="sunday",FI="saturday"},"clear"),Cdr=w(function(t){gb=t},"setDiagramId"),kdr=w(function(t){fne=t},"setAxisFormat"),Sdr=w(function(){return fne},"getAxisFormat"),Edr=w(function(t){pne=t},"setTickInterval"),Adr=w(function(){return pne},"getTickInterval"),Mdr=w(function(t){gne=t},"setTodayMarker"),Rdr=w(function(){return gne},"getTodayMarker"),_dr=w(function(t){wd=t},"setDateFormat"),Ldr=w(function(){Q7=!0},"enableInclusiveEndDates"),Idr=w(function(){return Q7},"endDatesAreInclusive"),Ndr=w(function(){xne=!0},"enableTopAxis"),Ddr=w(function(){return xne},"topAxisEnabled"),Odr=w(function(t){vne=t},"setDisplayMode"),Pdr=w(function(){return vne},"getDisplayMode"),$dr=w(function(){return wd},"getDateFormat"),sWe=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Bdr=w(function(t){V5=sWe(V5,t)},"setIncludes"),Fdr=w(function(){return V5},"getIncludes"),zdr=w(function(t){H5=sWe(H5,t)},"setExcludes"),Vdr=w(function(){return H5},"getExcludes"),Hdr=w(function(){return mne},"getLinks"),Gdr=w(function(t){G5=t,yne.push(t)},"addSection"),Wdr=w(function(){return yne},"getSections"),qdr=w(function(){let t=z1e();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,a]},"fixTaskDates"),sj=w(function(t,e,r){if(r=r.trim(),w(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const s=/^after\s+(?[\d\w- ]+)/.exec(r);if(s!==null){let o=null;for(const u of s.groups.ids.split(" ")){let h=_v(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let a=Wa(r,e.trim(),!0);if(a.isValid())return a.toDate();{de.debug("Invalid date:"+r),de.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),lWe=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),cWe=w(function(t,e,r,n=!1){r=r.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(r);if(s!==null){let h=null;for(const f of s.groups.ids.split(" ")){let p=_v(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),mne.set(n,r))}),hWe(t,"clickable")},"setLink"),hWe=w(function(t,e){t.split(",").forEach(function(r){let n=_v(r);n!==void 0&&n.classes.push(e)})},"setClass"),tfr=w(function(t,e,r){if(Ve().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{Kr.runFunc(e,...n)})},"setClickFun"),dWe=w(function(t,e){bne.push(function(){const r=gb?`${gb}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=gb?`${gb}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),rfr=w(function(t,e,r){t.split(",").forEach(function(n){tfr(n,e,r)}),hWe(t,"clickable")},"setClickEvent"),nfr=w(function(t){bne.forEach(function(e){e(t)})},"bindFunctions"),ifr={getConfig:w(()=>Ve().gantt,"getConfig"),clear:Tdr,setDateFormat:_dr,getDateFormat:$dr,enableInclusiveEndDates:Ldr,endDatesAreInclusive:Idr,enableTopAxis:Ndr,topAxisEnabled:Ddr,setAxisFormat:kdr,getAxisFormat:Sdr,setTickInterval:Edr,getTickInterval:Adr,setTodayMarker:Mdr,getTodayMarker:Rdr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,setDiagramId:Cdr,setDisplayMode:Odr,getDisplayMode:Pdr,setAccDescription:rs,getAccDescription:ns,addSection:Gdr,getSections:Wdr,getTasks:qdr,addTask:Qdr,findTaskById:_v,addTaskOrg:Jdr,setIncludes:Bdr,getIncludes:Fdr,setExcludes:zdr,getExcludes:Vdr,setClickEvent:rfr,setLink:efr,getLinks:Hdr,bindFunctions:nfr,parseDuration:lWe,isInvalidDate:aWe,setWeekday:Udr,getWeekday:Ydr,setWeekend:jdr};function Tne(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),n=!0)})}w(Tne,"getTaskTags");Wa.extend(xdr);var sfr=w(function(){de.debug("Something is calling, setConf, remove the call")},"setConf"),V1e={monday:g6,tuesday:r5e,wednesday:n5e,thursday:Ty,friday:i5e,saturday:s5e,sunday:JE},afr=w((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of n)for(let a=0;a=r[a]){r[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),vf,vV=1e4,ofr=w(function(t,e,r,n){const i=Ve().gantt;n.db.setDiagramId(e);const s=Ve().securityLevel;let a;s==="sandbox"&&(a=wt("#i"+e));const o=wt(s==="sandbox"?a.nodes()[0].contentDocument.body:"body"),l=s==="sandbox"?a.nodes()[0].contentDocument:document,u=l.getElementById(e);vf=u.parentElement.offsetWidth,vf===void 0&&(vf=1200),i.useWidth!==void 0&&(vf=i.useWidth);const h=n.db.getTasks(),d=h.filter(R=>!R.vert);let f=[];for(const R of d)f.push(R.type);f=A(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const R={};for(const P of d)R[P.section]===void 0?R[P.section]=[P]:R[P.section].push(P);let _=0;for(const P of Object.keys(R)){const N=afr(R[P],_)+1;_+=N,g+=N*(i.barHeight+i.barGap),p[P]=N}}else{g+=d.length*(i.barHeight+i.barGap);for(const R of f)p[R]=d.filter(_=>_.type===R).length}u.setAttribute("viewBox","0 0 "+vf+" "+g);const m=o.select(`[id="${e}"]`),y=i4t().domain([h1t(h,function(R){return R.startTime}),u1t(h,function(R){return R.endTime})]).rangeRound([0,vf-i.leftPadding-i.rightPadding]);function v(R,_){const P=R.startTime,N=_.startTime;let L=0;return P>N?L=1:PH.vert===G.vert?0:H.vert?1:-1);const O=R.filter(H=>!H.vert),F=[...new Set(O.map(H=>H.order))].map(H=>O.find(G=>G.order===H));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(H,G){return G=H.order,G*_+P-2}).attr("width",function(){return $-i.rightPadding/2}).attr("height",_).attr("class",function(H){for(const[G,W]of f.entries())if(H.type===W)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(R).enter(),V=n.db.getLinks();if(z.append("rect").attr("id",function(H){return e+"-"+H.id}).attr("rx",3).attr("ry",3).attr("x",function(H){return H.milestone?y(H.startTime)+N+.5*(y(H.endTime)-y(H.startTime))-.5*L:y(H.startTime)+N}).attr("y",function(H,G){return G=H.order,H.vert?i.gridLineStartPadding:G*_+P}).attr("width",function(H){return H.milestone?L:H.vert?.08*L:y(H.renderEndTime||H.endTime)-y(H.startTime)}).attr("height",function(H){return H.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:L}).attr("transform-origin",function(H,G){return G=H.order,(y(H.startTime)+N+.5*(y(H.endTime)-y(H.startTime))).toString()+"px "+(G*_+P+.5*L).toString()+"px"}).attr("class",function(H){const G="task";let W="";H.classes.length>0&&(W=H.classes.join(" "));let K=0;for(const[oe,Q]of f.entries())H.type===Q&&(K=oe%i.numberSectionStyles);let q="";return H.active?H.crit?q+=" activeCrit":q=" active":H.done?H.crit?q=" doneCrit":q=" done":H.crit&&(q+=" crit"),q.length===0&&(q=" task"),H.milestone&&(q=" milestone "+q),H.vert&&(q=" vert "+q),q+=K,q+=" "+W,G+q}),z.append("text").attr("id",function(H){return e+"-"+H.id+"-text"}).text(function(H){return H.task}).attr("font-size",i.fontSize).attr("x",function(H){let G=y(H.startTime),W=y(H.renderEndTime||H.endTime);if(H.milestone&&(G+=.5*(y(H.endTime)-y(H.startTime))-.5*L,W=G+L),H.vert)return y(H.startTime)+N;const K=this.getBBox().width;return K>W-G?W+K+1.5*i.leftPadding>$?G+N-5:W+N+5:(W-G)/2+G+N}).attr("y",function(H,G){return H.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(G=H.order,G*_+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",L).attr("class",function(H){const G=y(H.startTime);let W=y(H.endTime);H.milestone&&(W=G+L);const K=this.getBBox().width;let q="";H.classes.length>0&&(q=H.classes.join(" "));let oe=0;for(const[Z,re]of f.entries())H.type===re&&(oe=Z%i.numberSectionStyles);let Q="";return H.active&&(H.crit?Q="activeCritText"+oe:Q="activeText"+oe),H.done?H.crit?Q=Q+" doneCritText"+oe:Q=Q+" doneText"+oe:H.crit&&(Q=Q+" critText"+oe),H.milestone&&(Q+=" milestoneText"),H.vert&&(Q+=" vertText"),K>W-G?W+K+1.5*i.leftPadding>$?q+" taskTextOutsideLeft taskTextOutside"+oe+" "+Q:q+" taskTextOutsideRight taskTextOutside"+oe+" "+Q+" width-"+K:q+" taskText taskText"+oe+" "+Q+" width-"+K}),Ve().securityLevel==="sandbox"){let H;H=wt("#i"+e);const G=H.nodes()[0].contentDocument;z.filter(function(W){return V.has(W.id)}).each(function(W){var K=G.querySelector("#"+CSS.escape(e+"-"+W.id)),q=G.querySelector("#"+CSS.escape(e+"-"+W.id+"-text"));const oe=K.parentNode;var Q=G.createElement("a");Q.setAttribute("xlink:href",V.get(W.id)),Q.setAttribute("target","_top"),oe.appendChild(Q),Q.appendChild(K),Q.appendChild(q)})}}w(b,"drawRects");function T(R,_,P,N,L,I,$,O){if($.length===0&&O.length===0)return;let D,F;for(const{startTime:W,endTime:K}of I)(D===void 0||WF)&&(F=K);if(!D||!F)return;if(Wa(F).diff(Wa(D),"year")>5){de.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const z=n.db.getDateFormat(),V=[];let B=null,H=Wa(D);for(;H.valueOf()<=F;)n.db.isInvalidDate(H,z,$,O)?B?B.end=H:B={start:H,end:H}:B&&(V.push(B),B=null),H=H.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",W=>e+"-exclude-"+W.start.format("YYYY-MM-DD")).attr("x",W=>y(W.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",W=>y(W.end.endOf("day"))-y(W.start.startOf("day"))).attr("height",L-_-i.gridLineStartPadding).attr("transform-origin",function(W,K){return(y(W.start)+P+.5*(y(W.end)-y(W.start))).toString()+"px "+(K*R+.5*L).toString()+"px"}).attr("class","exclude-range")}w(T,"drawExcludeDays");function C(R,_,P,N){if(P<=0||R>_)return 1/0;const L=_-R,I=Wa.duration({[N??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(L/I)}w(C,"getEstimatedTickCount");function S(R,_,P,N){const L=n.db.getDateFormat(),I=n.db.getAxisFormat();let $;I?$=I:L==="D"?$="%d":$=i.axisFormat??"%Y-%m-%d";let O=x1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(Y9($));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const z=parseInt(F[1],10);if(isNaN(z)||z<=0)de.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],B=n.db.getWeekday()||i.weekday,H=y.domain(),G=H[0],W=H[1],K=C(G,W,z,V);if(K>vV)de.warn(`The tick interval "${z}${V}" would generate ${K} ticks, which exceeds the maximum allowed (${vV}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(a5.every(z));break;case"second":O.ticks(zp.every(z));break;case"minute":O.ticks(f6.every(z));break;case"hour":O.ticks(p6.every(z));break;case"day":O.ticks(wy.every(z));break;case"week":O.ticks(V1e[B].every(z));break;case"month":O.ticks(m6.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+R+", "+(N-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let z=b1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(Y9($));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)de.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],H=n.db.getWeekday()||i.weekday,G=y.domain(),W=G[0],K=G[1];if(C(W,K,V,B)<=vV)switch(B){case"millisecond":z.ticks(a5.every(V));break;case"second":z.ticks(zp.every(V));break;case"minute":z.ticks(f6.every(V));break;case"hour":z.ticks(p6.every(V));break;case"day":z.ticks(wy.every(V));break;case"week":z.ticks(V1e[H].every(V));break;case"month":z.ticks(m6.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+R+", "+_+")").call(z).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}w(S,"makeGrid");function k(R,_){let P=0;const N=Object.keys(p).map(L=>[L,p[L]]);m.append("g").selectAll("text").data(N).enter().append(function(L){const I=L[0].split(Vt.lineBreakRegex),$=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",$+"em");for(const[D,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),D>0&&z.setAttribute("dy","1em"),z.textContent=F,O.appendChild(z)}return O}).attr("x",10).attr("y",function(L,I){if(I>0)for(let $=0;$` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -3978,8 +3985,8 @@ Expecting `+He.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),jdr=Ydr,Xdr={parser:sdr,db:Hdr,renderer:Udr,styles:jdr};const Kdr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xdr},Symbol.toStringTag,{value:"Module"}));var Zdr={parse:w(async t=>{const e=await $u("info",t);de.debug(e)},"parse")},Qdr={version:"11.16.1"},Jdr=w(()=>Qdr.version,"getVersion"),efr={getVersion:Jdr},tfr=w((t,e,r)=>{de.debug(`rendering info diagram -`+t);const n=Xo(e);Fs(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),rfr={draw:tfr},nfr={parser:Zdr,db:efr,renderer:rfr};const ifr=Object.freeze(Object.defineProperty({__proto__:null,diagram:nfr},Symbol.toStringTag,{value:"Module"}));var sfr=Sn.pie,bne={sections:new Map,showData:!1},$I=bne.sections,xne=bne.showData,afr=structuredClone(sfr),ofr=w(()=>structuredClone(afr),"getConfig"),lfr=w(()=>{$I=new Map,xne=bne.showData,Ri()},"clear"),cfr=w(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);$I.has(t)||($I.set(t,e),de.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),ufr=w(()=>$I,"getSections"),hfr=w(t=>{xne=t},"setShowData"),dfr=w(()=>xne,"getShowData"),oWe={getConfig:ofr,clear:lfr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:cfr,getSections:ufr,setShowData:hfr,getShowData:dfr},ffr=w((t,e)=>{Fl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),pfr={parse:w(async t=>{const e=await $u("pie",t);de.debug(e),ffr(e,oWe)},"parse")},gfr=w(t=>` +`,"getStyles"),ufr=cfr,hfr={parser:wdr,db:ifr,renderer:lfr,styles:ufr};const dfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:hfr},Symbol.toStringTag,{value:"Module"}));var ffr={parse:w(async t=>{const e=await zu("info",t);de.debug(e)},"parse")},pfr={version:"11.16.1"},gfr=w(()=>pfr.version,"getVersion"),mfr={getVersion:gfr},yfr=w((t,e,r)=>{de.debug(`rendering info diagram +`+t);const n=Xo(e);Fs(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),vfr={draw:yfr},bfr={parser:ffr,db:mfr,renderer:vfr};const xfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:bfr},Symbol.toStringTag,{value:"Module"}));var wfr=Sn.pie,Cne={sections:new Map,showData:!1},zI=Cne.sections,kne=Cne.showData,Tfr=structuredClone(wfr),Cfr=w(()=>structuredClone(Tfr),"getConfig"),kfr=w(()=>{zI=new Map,kne=Cne.showData,Ri()},"clear"),Sfr=w(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);zI.has(t)||(zI.set(t,e),de.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Efr=w(()=>zI,"getSections"),Afr=w(t=>{kne=t},"setShowData"),Mfr=w(()=>kne,"getShowData"),fWe={getConfig:Cfr,clear:kfr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:Sfr,getSections:Efr,setShowData:Afr,getShowData:Mfr},Rfr=w((t,e)=>{Vl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),_fr={parse:w(async t=>{const e=await zu("pie",t);de.debug(e),Rfr(e,fWe)},"parse")},Lfr=w(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -4016,25 +4023,25 @@ Expecting `+He.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),mfr=gfr,yfr=w(t=>{const e=[...t.values()].reduce((i,s)=>i+s,0),r=[...t.entries()].map(([i,s])=>({label:i,value:s})).filter(i=>i.value/e*100>=1);return f4t().value(i=>i.value).sort(null)(r)},"createPieArcs"),vfr=w((t,e,r,n)=>{var q;de.debug(`rendering pie chart -`+t);const i=n.db,s=Ve(),a=es(i.getConfig(),s.pie),o=40,l=18,u=4,h=450,d=h,f=Xo(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=s;let[m]=B0(g.pieOuterStrokeWidth);m??(m=2);const y=a.legendPosition,v=a.textPosition,x=a.donutHole>0&&a.donutHole<=.9?a.donutHole:0,b=Math.min(d,h)/2-o,T=a5().innerRadius(x*b).outerRadius(b),C=a5().innerRadius(b*v).outerRadius(b*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",b+m/2).attr("class","pieOuterCircle");const k=i.getSections(),E=yfr(k),A=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let R=0;k.forEach(oe=>{R+=oe});const _=E.filter(oe=>(oe.data.value/R*100).toFixed(0)!=="0"),P=Q1(A).domain([...k.keys()]);S.selectAll("mySlices").data(_).enter().append("path").attr("d",T).attr("fill",oe=>P(oe.data.label)).attr("class",oe=>{let Q="pieCircle";return a.highlightSlice==="hover"?Q+=" highlightedOnHover":a.highlightSlice===oe.data.label&&(Q+=" highlighted"),Q}),S.selectAll("mySlices").data(_).enter().append("text").text(oe=>(oe.data.value/R*100).toFixed(0)+"%").attr("transform",oe=>"translate("+C.centroid(oe)+")").style("text-anchor","middle").attr("class","slice");const N=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),L=[...k.entries()].map(([oe,Q])=>({label:oe,value:Q})),I=p.selectAll(".legend").data(L).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",oe=>P(oe.label)).style("stroke",oe=>P(oe.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(oe=>i.getShowData()?`${oe.label} [${oe.value}]`:oe.label);const $=Math.max(...I.selectAll("text").nodes().map(oe=>(oe==null?void 0:oe.getBoundingClientRect().width)??0));let O=h,D=d+o;const F=l+u,z=L.length*F;switch(y){case"center":I.attr("transform",(oe,Q)=>{const Z=F*L.length/2,re=-$/2-(l+u),ie=Q*F-Z;return"translate("+re+","+ie+")"});break;case"top":O+=z,I.attr("transform",(oe,Q)=>{const Z=b,re=-$/2-(l+u),ie=Q*F-Z;return`translate(${re}, ${ie})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":O+=z,I.attr("transform",(oe,Q)=>{const Z=-b-F,re=-$/2-(l+u),ie=Q*F-Z;return"translate("+re+","+ie+")"});break;case"left":D+=l+u+$,I.attr("transform",(oe,Q)=>{const Z=F*L.length/2,re=-b-(l+u),ie=Q*F-Z;return"translate("+re+","+ie+")"}),S.attr("transform",()=>`translate(${$+l+u}, 0)`);break;case"right":default:D+=l+u+$,I.attr("transform",(oe,Q)=>{const Z=F*L.length/2,re=12*l,ie=Q*F-Z;return"translate("+re+","+ie+")"});break}const V=((q=N.node())==null?void 0:q.getBoundingClientRect().width)??0,B=d/2-V/2,H=d/2+V/2,G=Math.min(0,B),K=Math.max(D,H)-G;f.attr("viewBox",`${G} 0 ${K} ${O}`),Fs(f,O,K,a.useMaxWidth)},"draw"),bfr={draw:vfr},xfr={parser:pfr,db:oWe,renderer:bfr,styles:mfr};const wfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xfr},Symbol.toStringTag,{value:"Module"}));var nj=(function(){var t=w(function(X,fe,ee,Ae){for(ee=ee||{},Ae=X.length;Ae--;ee[X[Ae]]=fe);return ee},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],s=[1,7],a=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],x=[1,23],b=[1,18],T=[1,19],C=[1,20],S=[1,21],k=[1,22],E=[1,24],A=[1,25],R=[1,26],_=[1,27],P=[1,28],N=[1,29],L=[1,32],I=[1,33],$=[1,34],O=[1,39],D=[1,40],F=[1,42],z=[1,44],V=[1,63],B=[1,62],H=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],G=[1,66],W=[1,67],K=[1,68],q=[1,69],oe=[1,70],Q=[1,71],Z=[1,72],re=[1,73],ie=[1,74],me=[1,75],te=[1,76],_e=[1,77],$e=[4,5,6,7,8,9,10,11,12,13,14,15,18],Fe=[1,91],ce=[1,92],he=[1,93],Te=[1,100],ge=[1,94],He=[1,97],we=[1,95],Me=[1,96],je=[1,98],le=[1,99],pe=[1,103],Ce=[10,55,56,57],ne=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],j={trace:w(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:w(function(fe,ee,Ae,Re,Xe,Ne,qe){var De=Ne.length-1;switch(Xe){case 23:this.$=Ne[De];break;case 24:this.$=Ne[De-1]+""+Ne[De];break;case 26:this.$=Ne[De-1]+Ne[De];break;case 27:this.$=[Ne[De].trim()];break;case 28:Ne[De-2].push(Ne[De].trim()),this.$=Ne[De-2];break;case 29:this.$=Ne[De-4],Re.addClass(Ne[De-2],Ne[De]);break;case 37:this.$=[];break;case 42:this.$=Ne[De].trim(),Re.setDiagramTitle(this.$);break;case 43:this.$=Ne[De].trim(),Re.setAccTitle(this.$);break;case 44:case 45:this.$=Ne[De].trim(),Re.setAccDescription(this.$);break;case 46:Re.addSection(Ne[De].substr(8)),this.$=Ne[De].substr(8);break;case 47:Re.addPoint(Ne[De-3],"",Ne[De-1],Ne[De],[]);break;case 48:Re.addPoint(Ne[De-4],Ne[De-3],Ne[De-1],Ne[De],[]);break;case 49:Re.addPoint(Ne[De-4],"",Ne[De-2],Ne[De-1],Ne[De]);break;case 50:Re.addPoint(Ne[De-5],Ne[De-4],Ne[De-2],Ne[De-1],Ne[De]);break;case 51:Re.setXAxisLeftText(Ne[De-2]),Re.setXAxisRightText(Ne[De]);break;case 52:Ne[De-1].text+=" ⟶ ",Re.setXAxisLeftText(Ne[De-1]);break;case 53:Re.setXAxisLeftText(Ne[De]);break;case 54:Re.setYAxisBottomText(Ne[De-2]),Re.setYAxisTopText(Ne[De]);break;case 55:Ne[De-1].text+=" ⟶ ",Re.setYAxisBottomText(Ne[De-1]);break;case 56:Re.setYAxisBottomText(Ne[De]);break;case 57:Re.setQuadrant1Text(Ne[De]);break;case 58:Re.setQuadrant2Text(Ne[De]);break;case 59:Re.setQuadrant3Text(Ne[De]);break;case 60:Re.setQuadrant4Text(Ne[De]);break;case 64:this.$={text:Ne[De],type:"text"};break;case 65:this.$={text:Ne[De-1].text+""+Ne[De],type:Ne[De-1].type};break;case 66:this.$={text:Ne[De],type:"text"};break;case 67:this.$={text:Ne[De],type:"markdown"};break;case 68:this.$=Ne[De];break;case 69:this.$=Ne[De-1]+""+Ne[De];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:s},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:s},{18:e,26:9,27:2,28:r,55:n,56:i,57:s},t(a,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:T,39:C,41:S,42:k,48:E,50:A,51:R,52:_,53:P,54:N,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),t(a,[2,34]),{27:46,55:n,56:i,57:s},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:T,39:C,41:S,42:k,48:E,50:A,51:R,52:_,53:P,54:N,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:$,64:O,65:D,66:F,67:z},t(H,[2,64]),t(H,[2,66]),t(H,[2,67]),t(H,[2,70]),t(H,[2,71]),t(H,[2,72]),t(H,[2,73]),t(H,[2,74]),t(H,[2,75]),t(H,[2,76]),t(H,[2,77]),t(H,[2,78]),t(H,[2,79]),t(H,[2,80]),t(H,[2,81]),t(a,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:G,5:W,6:K,7:q,8:oe,9:Q,10:Z,11:re,12:ie,13:me,14:te,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:$,64:O,65:D,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:$,64:O,65:D,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(H,[2,65]),t(H,[2,82]),t(H,[2,83]),t(H,[2,84]),{3:83,4:G,5:W,6:K,7:q,8:oe,9:Q,10:Z,11:re,12:ie,13:me,14:te,15:_e,18:[1,82]},t($e,[2,23]),t($e,[2,1]),t($e,[2,2]),t($e,[2,3]),t($e,[2,4]),t($e,[2,5]),t($e,[2,6]),t($e,[2,7]),t($e,[2,8]),t($e,[2,9]),t($e,[2,10]),t($e,[2,11]),t($e,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:Fe,5:ce,6:he,8:Te,11:ge,13:He,16:90,17:we,18:Me,19:je,20:le,22:89,23:88},t($e,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le}),{46:[1,102]},t(l,[2,29],{10:pe}),t(Ce,[2,27],{16:104,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le}),t(ne,[2,25]),t(ne,[2,13]),t(ne,[2,14]),t(ne,[2,15]),t(ne,[2,16]),t(ne,[2,17]),t(ne,[2,18]),t(ne,[2,19]),t(ne,[2,20]),t(ne,[2,21]),t(ne,[2,22]),t(l,[2,49],{10:pe}),t(l,[2,48],{22:89,16:90,23:105,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le}),{4:Fe,5:ce,6:he,8:Te,11:ge,13:He,16:90,17:we,18:Me,19:je,20:le,22:106},t(ne,[2,26]),t(l,[2,50],{10:pe}),t(Ce,[2,28],{16:104,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le})],defaultActions:{8:[2,30],9:[2,31]},parseError:w(function(fe,ee){if(ee.recoverable)this.trace(fe);else{var Ae=new Error(fe);throw Ae.hash=ee,Ae}},"parseError"),parse:w(function(fe){var ee=this,Ae=[0],Re=[],Xe=[null],Ne=[],qe=this.table,De="",Ke=0,ze=0,st=2,Oe=1,mt=Ne.slice.call(arguments,1),Le=Object.create(this.lexer),St={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(St.yy[At]=this.yy[At]);Le.setInput(fe,St.yy),St.yy.lexer=Le,St.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var lt=Le.yylloc;Ne.push(lt);var zt=Le.options&&Le.options.ranges;typeof St.yy.parseError=="function"?this.parseError=St.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(nr){Ae.length=Ae.length-2*nr,Xe.length=Xe.length-nr,Ne.length=Ne.length-nr}w(It,"popStack");function ft(){var nr;return nr=Re.pop()||Le.lex()||Oe,typeof nr!="number"&&(nr instanceof Array&&(Re=nr,nr=Re.pop()),nr=ee.symbols_[nr]||nr),nr}w(ft,"lex");for(var xe,Nt,Tt,yt,Rt={},Or,Ee,it,gt;;){if(Nt=Ae[Ae.length-1],this.defaultActions[Nt]?Tt=this.defaultActions[Nt]:((xe===null||typeof xe>"u")&&(xe=ft()),Tt=qe[Nt]&&qe[Nt][xe]),typeof Tt>"u"||!Tt.length||!Tt[0]){var xt="";gt=[];for(Or in qe[Nt])this.terminals_[Or]&&Or>st&>.push("'"+this.terminals_[Or]+"'");Le.showPosition?xt="Parse error on line "+(Ke+1)+`: +`,"getStyles"),Ifr=Lfr,Nfr=w(t=>{const e=[...t.values()].reduce((i,s)=>i+s,0),r=[...t.entries()].map(([i,s])=>({label:i,value:s})).filter(i=>i.value/e*100>=1);return b4t().value(i=>i.value).sort(null)(r)},"createPieArcs"),Dfr=w((t,e,r,n)=>{var q;de.debug(`rendering pie chart +`+t);const i=n.db,s=Ve(),a=es(i.getConfig(),s.pie),o=40,l=18,u=4,h=450,d=h,f=Xo(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=s;let[m]=H0(g.pieOuterStrokeWidth);m??(m=2);const y=a.legendPosition,v=a.textPosition,x=a.donutHole>0&&a.donutHole<=.9?a.donutHole:0,b=Math.min(d,h)/2-o,T=l5().innerRadius(x*b).outerRadius(b),C=l5().innerRadius(b*v).outerRadius(b*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",b+m/2).attr("class","pieOuterCircle");const k=i.getSections(),E=Nfr(k),A=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let R=0;k.forEach(oe=>{R+=oe});const _=E.filter(oe=>(oe.data.value/R*100).toFixed(0)!=="0"),P=ey(A).domain([...k.keys()]);S.selectAll("mySlices").data(_).enter().append("path").attr("d",T).attr("fill",oe=>P(oe.data.label)).attr("class",oe=>{let Q="pieCircle";return a.highlightSlice==="hover"?Q+=" highlightedOnHover":a.highlightSlice===oe.data.label&&(Q+=" highlighted"),Q}),S.selectAll("mySlices").data(_).enter().append("text").text(oe=>(oe.data.value/R*100).toFixed(0)+"%").attr("transform",oe=>"translate("+C.centroid(oe)+")").style("text-anchor","middle").attr("class","slice");const N=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),L=[...k.entries()].map(([oe,Q])=>({label:oe,value:Q})),I=p.selectAll(".legend").data(L).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",oe=>P(oe.label)).style("stroke",oe=>P(oe.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(oe=>i.getShowData()?`${oe.label} [${oe.value}]`:oe.label);const $=Math.max(...I.selectAll("text").nodes().map(oe=>(oe==null?void 0:oe.getBoundingClientRect().width)??0));let O=h,D=d+o;const F=l+u,z=L.length*F;switch(y){case"center":I.attr("transform",(oe,Q)=>{const Z=F*L.length/2,re=-$/2-(l+u),ie=Q*F-Z;return"translate("+re+","+ie+")"});break;case"top":O+=z,I.attr("transform",(oe,Q)=>{const Z=b,re=-$/2-(l+u),ie=Q*F-Z;return`translate(${re}, ${ie})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":O+=z,I.attr("transform",(oe,Q)=>{const Z=-b-F,re=-$/2-(l+u),ie=Q*F-Z;return"translate("+re+","+ie+")"});break;case"left":D+=l+u+$,I.attr("transform",(oe,Q)=>{const Z=F*L.length/2,re=-b-(l+u),ie=Q*F-Z;return"translate("+re+","+ie+")"}),S.attr("transform",()=>`translate(${$+l+u}, 0)`);break;case"right":default:D+=l+u+$,I.attr("transform",(oe,Q)=>{const Z=F*L.length/2,re=12*l,ie=Q*F-Z;return"translate("+re+","+ie+")"});break}const V=((q=N.node())==null?void 0:q.getBoundingClientRect().width)??0,B=d/2-V/2,H=d/2+V/2,G=Math.min(0,B),K=Math.max(D,H)-G;f.attr("viewBox",`${G} 0 ${K} ${O}`),Fs(f,O,K,a.useMaxWidth)},"draw"),Ofr={draw:Dfr},Pfr={parser:_fr,db:fWe,renderer:Ofr,styles:Ifr};const $fr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pfr},Symbol.toStringTag,{value:"Module"}));var oj=(function(){var t=w(function(X,fe,ee,Ae){for(ee=ee||{},Ae=X.length;Ae--;ee[X[Ae]]=fe);return ee},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],s=[1,7],a=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],x=[1,23],b=[1,18],T=[1,19],C=[1,20],S=[1,21],k=[1,22],E=[1,24],A=[1,25],R=[1,26],_=[1,27],P=[1,28],N=[1,29],L=[1,32],I=[1,33],$=[1,34],O=[1,39],D=[1,40],F=[1,42],z=[1,44],V=[1,63],B=[1,62],H=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],G=[1,66],W=[1,67],K=[1,68],q=[1,69],oe=[1,70],Q=[1,71],Z=[1,72],re=[1,73],ie=[1,74],me=[1,75],te=[1,76],_e=[1,77],$e=[4,5,6,7,8,9,10,11,12,13,14,15,18],Fe=[1,91],ce=[1,92],he=[1,93],Te=[1,100],ge=[1,94],He=[1,97],we=[1,95],Me=[1,96],je=[1,98],le=[1,99],pe=[1,103],Ce=[10,55,56,57],ne=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],j={trace:w(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:w(function(fe,ee,Ae,Re,Xe,Ne,qe){var De=Ne.length-1;switch(Xe){case 23:this.$=Ne[De];break;case 24:this.$=Ne[De-1]+""+Ne[De];break;case 26:this.$=Ne[De-1]+Ne[De];break;case 27:this.$=[Ne[De].trim()];break;case 28:Ne[De-2].push(Ne[De].trim()),this.$=Ne[De-2];break;case 29:this.$=Ne[De-4],Re.addClass(Ne[De-2],Ne[De]);break;case 37:this.$=[];break;case 42:this.$=Ne[De].trim(),Re.setDiagramTitle(this.$);break;case 43:this.$=Ne[De].trim(),Re.setAccTitle(this.$);break;case 44:case 45:this.$=Ne[De].trim(),Re.setAccDescription(this.$);break;case 46:Re.addSection(Ne[De].substr(8)),this.$=Ne[De].substr(8);break;case 47:Re.addPoint(Ne[De-3],"",Ne[De-1],Ne[De],[]);break;case 48:Re.addPoint(Ne[De-4],Ne[De-3],Ne[De-1],Ne[De],[]);break;case 49:Re.addPoint(Ne[De-4],"",Ne[De-2],Ne[De-1],Ne[De]);break;case 50:Re.addPoint(Ne[De-5],Ne[De-4],Ne[De-2],Ne[De-1],Ne[De]);break;case 51:Re.setXAxisLeftText(Ne[De-2]),Re.setXAxisRightText(Ne[De]);break;case 52:Ne[De-1].text+=" ⟶ ",Re.setXAxisLeftText(Ne[De-1]);break;case 53:Re.setXAxisLeftText(Ne[De]);break;case 54:Re.setYAxisBottomText(Ne[De-2]),Re.setYAxisTopText(Ne[De]);break;case 55:Ne[De-1].text+=" ⟶ ",Re.setYAxisBottomText(Ne[De-1]);break;case 56:Re.setYAxisBottomText(Ne[De]);break;case 57:Re.setQuadrant1Text(Ne[De]);break;case 58:Re.setQuadrant2Text(Ne[De]);break;case 59:Re.setQuadrant3Text(Ne[De]);break;case 60:Re.setQuadrant4Text(Ne[De]);break;case 64:this.$={text:Ne[De],type:"text"};break;case 65:this.$={text:Ne[De-1].text+""+Ne[De],type:Ne[De-1].type};break;case 66:this.$={text:Ne[De],type:"text"};break;case 67:this.$={text:Ne[De],type:"markdown"};break;case 68:this.$=Ne[De];break;case 69:this.$=Ne[De-1]+""+Ne[De];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:s},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:s},{18:e,26:9,27:2,28:r,55:n,56:i,57:s},t(a,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:T,39:C,41:S,42:k,48:E,50:A,51:R,52:_,53:P,54:N,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),t(a,[2,34]),{27:46,55:n,56:i,57:s},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:x,35:b,37:T,39:C,41:S,42:k,48:E,50:A,51:R,52:_,53:P,54:N,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:L,61:I,63:$,64:O,65:D,66:F,67:z},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:$,64:O,65:D,66:F,67:z},t(H,[2,64]),t(H,[2,66]),t(H,[2,67]),t(H,[2,70]),t(H,[2,71]),t(H,[2,72]),t(H,[2,73]),t(H,[2,74]),t(H,[2,75]),t(H,[2,76]),t(H,[2,77]),t(H,[2,78]),t(H,[2,79]),t(H,[2,80]),t(H,[2,81]),t(a,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:G,5:W,6:K,7:q,8:oe,9:Q,10:Z,11:re,12:ie,13:me,14:te,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:$,64:O,65:D,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:$,64:O,65:D,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(H,[2,65]),t(H,[2,82]),t(H,[2,83]),t(H,[2,84]),{3:83,4:G,5:W,6:K,7:q,8:oe,9:Q,10:Z,11:re,12:ie,13:me,14:te,15:_e,18:[1,82]},t($e,[2,23]),t($e,[2,1]),t($e,[2,2]),t($e,[2,3]),t($e,[2,4]),t($e,[2,5]),t($e,[2,6]),t($e,[2,7]),t($e,[2,8]),t($e,[2,9]),t($e,[2,10]),t($e,[2,11]),t($e,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:L,61:I,63:$,64:O,65:D,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:Fe,5:ce,6:he,8:Te,11:ge,13:He,16:90,17:we,18:Me,19:je,20:le,22:89,23:88},t($e,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:D,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le}),{46:[1,102]},t(l,[2,29],{10:pe}),t(Ce,[2,27],{16:104,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le}),t(ne,[2,25]),t(ne,[2,13]),t(ne,[2,14]),t(ne,[2,15]),t(ne,[2,16]),t(ne,[2,17]),t(ne,[2,18]),t(ne,[2,19]),t(ne,[2,20]),t(ne,[2,21]),t(ne,[2,22]),t(l,[2,49],{10:pe}),t(l,[2,48],{22:89,16:90,23:105,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le}),{4:Fe,5:ce,6:he,8:Te,11:ge,13:He,16:90,17:we,18:Me,19:je,20:le,22:106},t(ne,[2,26]),t(l,[2,50],{10:pe}),t(Ce,[2,28],{16:104,4:Fe,5:ce,6:he,8:Te,11:ge,13:He,17:we,18:Me,19:je,20:le})],defaultActions:{8:[2,30],9:[2,31]},parseError:w(function(fe,ee){if(ee.recoverable)this.trace(fe);else{var Ae=new Error(fe);throw Ae.hash=ee,Ae}},"parseError"),parse:w(function(fe){var ee=this,Ae=[0],Re=[],Xe=[null],Ne=[],qe=this.table,De="",Ke=0,ze=0,st=2,Oe=1,mt=Ne.slice.call(arguments,1),Le=Object.create(this.lexer),St={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(St.yy[At]=this.yy[At]);Le.setInput(fe,St.yy),St.yy.lexer=Le,St.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var lt=Le.yylloc;Ne.push(lt);var zt=Le.options&&Le.options.ranges;typeof St.yy.parseError=="function"?this.parseError=St.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(nr){Ae.length=Ae.length-2*nr,Xe.length=Xe.length-nr,Ne.length=Ne.length-nr}w(It,"popStack");function ft(){var nr;return nr=Re.pop()||Le.lex()||Oe,typeof nr!="number"&&(nr instanceof Array&&(Re=nr,nr=Re.pop()),nr=ee.symbols_[nr]||nr),nr}w(ft,"lex");for(var xe,Nt,Tt,yt,Rt={},Or,Ee,it,gt;;){if(Nt=Ae[Ae.length-1],this.defaultActions[Nt]?Tt=this.defaultActions[Nt]:((xe===null||typeof xe>"u")&&(xe=ft()),Tt=qe[Nt]&&qe[Nt][xe]),typeof Tt>"u"||!Tt.length||!Tt[0]){var xt="";gt=[];for(Or in qe[Nt])this.terminals_[Or]&&Or>st&>.push("'"+this.terminals_[Or]+"'");Le.showPosition?xt="Parse error on line "+(Ke+1)+`: `+Le.showPosition()+` Expecting `+gt.join(", ")+", got '"+(this.terminals_[xe]||xe)+"'":xt="Parse error on line "+(Ke+1)+": Unexpected "+(xe==Oe?"end of input":"'"+(this.terminals_[xe]||xe)+"'"),this.parseError(xt,{text:Le.match,token:this.terminals_[xe]||xe,line:Le.yylineno,loc:lt,expected:gt})}if(Tt[0]instanceof Array&&Tt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Nt+", token: "+xe);switch(Tt[0]){case 1:Ae.push(xe),Xe.push(Le.yytext),Ne.push(Le.yylloc),Ae.push(Tt[1]),xe=null,ze=Le.yyleng,De=Le.yytext,Ke=Le.yylineno,lt=Le.yylloc;break;case 2:if(Ee=this.productions_[Tt[1]][1],Rt.$=Xe[Xe.length-Ee],Rt._$={first_line:Ne[Ne.length-(Ee||1)].first_line,last_line:Ne[Ne.length-1].last_line,first_column:Ne[Ne.length-(Ee||1)].first_column,last_column:Ne[Ne.length-1].last_column},zt&&(Rt._$.range=[Ne[Ne.length-(Ee||1)].range[0],Ne[Ne.length-1].range[1]]),yt=this.performAction.apply(Rt,[De,ze,Ke,St.yy,Tt[1],Xe,Ne].concat(mt)),typeof yt<"u")return yt;Ee&&(Ae=Ae.slice(0,-1*Ee*2),Xe=Xe.slice(0,-1*Ee),Ne=Ne.slice(0,-1*Ee)),Ae.push(this.productions_[Tt[1]][0]),Xe.push(Rt.$),Ne.push(Rt._$),it=qe[Ae[Ae.length-2]][Ae[Ae.length-1]],Ae.push(it);break;case 3:return!0}}return!0},"parse")},J=(function(){var X={EOF:1,parseError:w(function(ee,Ae){if(this.yy.parser)this.yy.parser.parseError(ee,Ae);else throw new Error(ee)},"parseError"),setInput:w(function(fe,ee){return this.yy=ee||this.yy||{},this._input=fe,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 fe=this._input[0];this.yytext+=fe,this.yyleng++,this.offset++,this.match+=fe,this.matched+=fe;var ee=fe.match(/(?:\r\n?|\n).*/g);return ee?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),fe},"input"),unput:w(function(fe){var ee=fe.length,Ae=fe.split(/(?:\r\n?|\n)/g);this._input=fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ee),this.offset-=ee;var Re=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),Ae.length-1&&(this.yylineno-=Ae.length-1);var Xe=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:Ae?(Ae.length===Re.length?this.yylloc.first_column:0)+Re[Re.length-Ae.length].length-Ae[0].length:this.yylloc.first_column-ee},this.options.ranges&&(this.yylloc.range=[Xe[0],Xe[0]+this.yyleng-ee]),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(fe){this.unput(this.match.slice(fe))},"less"),pastInput:w(function(){var fe=this.matched.substr(0,this.matched.length-this.match.length);return(fe.length>20?"...":"")+fe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var fe=this.match;return fe.length<20&&(fe+=this._input.substr(0,20-fe.length)),(fe.substr(0,20)+(fe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var fe=this.pastInput(),ee=new Array(fe.length+1).join("-");return fe+this.upcomingInput()+` `+ee+"^"},"showPosition"),test_match:w(function(fe,ee){var Ae,Re,Xe;if(this.options.backtrack_lexer&&(Xe={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&&(Xe.yylloc.range=this.yylloc.range.slice(0))),Re=fe[0].match(/(?:\r\n?|\n).*/g),Re&&(this.yylineno+=Re.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Re?Re[Re.length-1].length-Re[Re.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+fe[0].length},this.yytext+=fe[0],this.match+=fe[0],this.matches=fe,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(fe[0].length),this.matched+=fe[0],Ae=this.performAction.call(this,this.yy,this,ee,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ae)return Ae;if(this._backtrack){for(var Ne in Xe)this[Ne]=Xe[Ne];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var fe,ee,Ae,Re;this._more||(this.yytext="",this.match="");for(var Xe=this._currentRules(),Ne=0;Neee[0].length)){if(ee=Ae,Re=Ne,this.options.backtrack_lexer){if(fe=this.test_match(Ae,Xe[Ne]),fe!==!1)return fe;if(this._backtrack){ee=!1;continue}else return!1}else if(!this.options.flex)break}return ee?(fe=this.test_match(ee,Xe[Re]),fe!==!1?fe:!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 ee=this.next();return ee||this.lex()},"lex"),begin:w(function(ee){this.conditionStack.push(ee)},"begin"),popState:w(function(){var ee=this.conditionStack.length-1;return ee>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(ee){return ee=this.conditionStack.length-1-Math.abs(ee||0),ee>=0?this.conditionStack[ee]:"INITIAL"},"topState"),pushState:w(function(ee){this.begin(ee)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(ee,Ae,Re,Xe){switch(Re){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 X})();j.lexer=J;function ue(){this.yy={}}return w(ue,"Parser"),ue.prototype=j,j.Parser=ue,new ue})();nj.parser=nj;var Tfr=nj,nl=$0(),aT,Cfr=(aT=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Sn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Sn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Sn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Sn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((s=Sn.quadrantChart)==null?void 0:s.quadrantPadding)||5,xAxisLabelPadding:((a=Sn.quadrantChart)==null?void 0:a.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Sn.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Sn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Sn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Sn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Sn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Sn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Sn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Sn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Sn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Sn.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Sn.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=Sn.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:nl.quadrant1Fill,quadrant2Fill:nl.quadrant2Fill,quadrant3Fill:nl.quadrant3Fill,quadrant4Fill:nl.quadrant4Fill,quadrant1TextFill:nl.quadrant1TextFill,quadrant2TextFill:nl.quadrant2TextFill,quadrant3TextFill:nl.quadrant3TextFill,quadrant4TextFill:nl.quadrant4TextFill,quadrantPointFill:nl.quadrantPointFill,quadrantPointTextFill:nl.quadrantPointTextFill,quadrantXAxisTextFill:nl.quadrantXAxisTextFill,quadrantYAxisTextFill:nl.quadrantYAxisTextFill,quadrantTitleFill:nl.quadrantTitleFill,quadrantInternalBorderStrokeFill:nl.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:nl.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,de.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){de.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){de.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const s=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,a={top:e==="top"&&r?s:0,bottom:e==="bottom"&&r?s:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+a.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-a.top-a.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:a,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:s,titleSpace:a}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=s,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:s,quadrantTop:a}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+s,y:a,width:s,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:a,width:s,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:a+n,width:s,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+s,y:a+n,width:s,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:s,quadrantWidth:a}=r,o=n5().domain([0,1]).range([i,a+i]),l=n5().domain([0,1]).range([n+s,s]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:s,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-r,y1:l,x2:a+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+u,y1:l+r,x2:a+u,y2:l+s-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-r,y1:l+s,x2:a+u+r,y2:l+s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:l+r,x2:a,y2:l+s-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+o,y1:l+r,x2:a+o,y2:l+s-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+r,y1:l+i,x2:a+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,s=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(s),quadrants:this.getQuadrants(s),axisLabels:this.getAxisLabels(i,e,r,s),borderLines:this.getBorders(s),title:this.getTitle(n)}}},w(aT,"QuadrantBuilder"),aT),oT,tM=(oT=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(oT,"InvalidStyleError"),oT);function ij(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(ij,"validateHexCode");function lWe(t){return!/^\d+$/.test(t)}w(lWe,"validateNumber");function cWe(t){return!/^\d+px$/.test(t)}w(cWe,"validateSizeInPixels");function rf(t){return Ln(t.trim(),Ve())}w(rf,"textSanitizer");var Co=new Cfr;function uWe(t){Co.setData({quadrant1Text:rf(t.text)})}w(uWe,"setQuadrant1Text");function hWe(t){Co.setData({quadrant2Text:rf(t.text)})}w(hWe,"setQuadrant2Text");function dWe(t){Co.setData({quadrant3Text:rf(t.text)})}w(dWe,"setQuadrant3Text");function fWe(t){Co.setData({quadrant4Text:rf(t.text)})}w(fWe,"setQuadrant4Text");function pWe(t){Co.setData({xAxisLeftText:rf(t.text)})}w(pWe,"setXAxisLeftText");function gWe(t){Co.setData({xAxisRightText:rf(t.text)})}w(gWe,"setXAxisRightText");function mWe(t){Co.setData({yAxisTopText:rf(t.text)})}w(mWe,"setYAxisTopText");function yWe(t){Co.setData({yAxisBottomText:rf(t.text)})}w(yWe,"setYAxisBottomText");function kP(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(lWe(i))throw new tM(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(ij(i))throw new tM(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(ij(i))throw new tM(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(cWe(i))throw new tM(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(kP,"parseStyles");function vWe(t,e,r,n,i){const s=kP(i);Co.addPoints([{x:r,y:n,text:rf(t.text),className:e,...s}])}w(vWe,"addPoint");function bWe(t,e){Co.addClass(t,kP(e))}w(bWe,"addClass");function xWe(t){Co.setConfig({chartWidth:t})}w(xWe,"setWidth");function wWe(t){Co.setConfig({chartHeight:t})}w(wWe,"setHeight");function TWe(){const t=Ve(),{themeVariables:e,quadrantChart:r}=t;return r&&Co.setConfig(r),Co.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Co.setData({titleText:qi()}),Co.build()}w(TWe,"getQuadrantData");var kfr=w(function(){Co.clear(),Ri()},"clear"),Sfr={setWidth:xWe,setHeight:wWe,setQuadrant1Text:uWe,setQuadrant2Text:hWe,setQuadrant3Text:dWe,setQuadrant4Text:fWe,setXAxisLeftText:pWe,setXAxisRightText:gWe,setYAxisTopText:mWe,setYAxisBottomText:yWe,parseStyles:kP,addPoint:vWe,addClass:bWe,getQuadrantData:TWe,clear:kfr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Efr=w((t,e,r,n)=>{var E,A,R;function i(_){return _==="top"?"hanging":"middle"}w(i,"getDominantBaseLine");function s(_){return _==="left"?"start":"middle"}w(s,"getTextAnchor");function a(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}w(a,"getTransformation");const o=Ve();de.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=wt("#i"+e));const d=wt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((E=o.quadrantChart)==null?void 0:E.chartWidth)??500,g=((A=o.quadrantChart)==null?void 0:A.chartHeight)??500;Fs(d,g,p,((R=o.quadrantChart)==null?void 0:R.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),T=f.append("g").attr("class","title");m.title&&T.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",s(m.title.verticalPos)).attr("transform",a(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",_=>_.x1).attr("y1",_=>_.y1).attr("x2",_=>_.x2).attr("y2",_=>_.y2).style("stroke",_=>_.strokeFill).style("stroke-width",_=>_.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",_=>_.x).attr("y",_=>_.y).attr("width",_=>_.width).attr("height",_=>_.height).attr("fill",_=>_.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>s(_.text.verticalPos)).attr("transform",_=>a(_.text)).text(_=>_.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(_=>_.text).attr("fill",_=>_.fill).attr("font-size",_=>_.fontSize).attr("dominant-baseline",_=>i(_.horizontalPos)).attr("text-anchor",_=>s(_.verticalPos)).attr("transform",_=>a(_));const k=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",_=>_.x).attr("cy",_=>_.y).attr("r",_=>_.radius).attr("fill",_=>_.fill).attr("stroke",_=>_.strokeColor).attr("stroke-width",_=>_.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(_=>_.text.text).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>s(_.text.verticalPos)).attr("transform",_=>a(_.text))},"draw"),Afr={draw:Efr},Mfr={parser:Tfr,db:Sfr,renderer:Afr,styles:w(()=>"","styles")};const Rfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Mfr},Symbol.toStringTag,{value:"Module"}));var sj=(function(){var t=w(function($,O,D,F){for(D=D||{},F=$.length;F--;D[$[F]]=O);return D},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],s=[1,6],a=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],T=[1,43],C=[1,42],S=[1,47],k=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],R=[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],_=[1,65],P=[26,28],N={trace:w(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:w(function(O,D,F,z,V,B,H){var G=B.length-1;switch(V){case 5:z.setOrientation(B[G]);break;case 9:z.setDiagramTitle(B[G].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[G]);break;case 13:z.setLineData(B[G-1],B[G]);break;case 14:z.setBarData({text:"",type:"text"},B[G]);break;case 15:z.setBarData(B[G-1],B[G]);break;case 16:this.$=B[G].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[G].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[G-1];break;case 20:case 30:this.$=[B[G-2],...B[G]];break;case 21:case 31:this.$=[B[G]];break;case 22:this.$={value:Number(B[G-1]),label:B[G]};break;case 23:this.$={value:Number(B[G]),label:""};break;case 24:z.setXAxisTitle(B[G]);break;case 25:z.setXAxisTitle(B[G-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[G]);break;case 28:z.setXAxisRangeData(Number(B[G-2]),Number(B[G]));break;case 29:this.$=B[G-1];break;case 32:z.setYAxisTitle(B[G]);break;case 33:z.setYAxisTitle(B[G-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[G-2]),Number(B[G]));break;case 39:this.$={text:B[G],type:"text"};break;case 40:this.$={text:B[G],type:"text"};break;case 41:this.$={text:B[G],type:"markdown"};break;case 42:this.$=B[G];break;case 43:this.$=B[G-1]+""+B[G];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:s,38:a}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:s,38:a}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:s,38:a}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:s,38:a}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:s,38:a}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:39,13:38,24:T,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:49,17:48,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:52,17:51,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(A,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b}),t(A,[2,40]),t(A,[2,41]),t(R,[2,42]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(E,[2,10]),t(E,[2,24],{32:41,31:56,24:T,29:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},t(E,[2,11]),t(E,[2,32],{35:60,29:S}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:k},{25:63,27:64,29:_},t(E,[2,14]),{17:66,24:k},t(E,[2,16]),t(E,[2,17]),t(R,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:_},t(P,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:w(function(O,D){if(D.recoverable)this.trace(O);else{var F=new Error(O);throw F.hash=D,F}},"parseError"),parse:w(function(O){var D=this,F=[0],z=[],V=[null],B=[],H=this.table,G="",W=0,K=0,q=2,oe=1,Q=B.slice.call(arguments,1),Z=Object.create(this.lexer),re={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(re.yy[ie]=this.yy[ie]);Z.setInput(O,re.yy),re.yy.lexer=Z,re.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var me=Z.yylloc;B.push(me);var te=Z.options&&Z.options.ranges;typeof re.yy.parseError=="function"?this.parseError=re.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(pe){F.length=F.length-2*pe,V.length=V.length-pe,B.length=B.length-pe}w(_e,"popStack");function $e(){var pe;return pe=z.pop()||Z.lex()||oe,typeof pe!="number"&&(pe instanceof Array&&(z=pe,pe=z.pop()),pe=D.symbols_[pe]||pe),pe}w($e,"lex");for(var Fe,ce,he,Te,ge={},He,we,Me,je;;){if(ce=F[F.length-1],this.defaultActions[ce]?he=this.defaultActions[ce]:((Fe===null||typeof Fe>"u")&&(Fe=$e()),he=H[ce]&&H[ce][Fe]),typeof he>"u"||!he.length||!he[0]){var le="";je=[];for(He in H[ce])this.terminals_[He]&&He>q&&je.push("'"+this.terminals_[He]+"'");Z.showPosition?le="Parse error on line "+(W+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var ee=this.next();return ee||this.lex()},"lex"),begin:w(function(ee){this.conditionStack.push(ee)},"begin"),popState:w(function(){var ee=this.conditionStack.length-1;return ee>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(ee){return ee=this.conditionStack.length-1-Math.abs(ee||0),ee>=0?this.conditionStack[ee]:"INITIAL"},"topState"),pushState:w(function(ee){this.begin(ee)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(ee,Ae,Re,Xe){switch(Re){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 X})();j.lexer=J;function ue(){this.yy={}}return w(ue,"Parser"),ue.prototype=j,j.Parser=ue,new ue})();oj.parser=oj;var Bfr=oj,nl=V0(),lT,Ffr=(lT=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,s,a,o,l,u,h,d,f,p,g,m,y,v,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Sn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Sn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Sn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Sn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((s=Sn.quadrantChart)==null?void 0:s.quadrantPadding)||5,xAxisLabelPadding:((a=Sn.quadrantChart)==null?void 0:a.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Sn.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Sn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Sn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Sn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Sn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Sn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Sn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Sn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Sn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Sn.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Sn.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=Sn.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:nl.quadrant1Fill,quadrant2Fill:nl.quadrant2Fill,quadrant3Fill:nl.quadrant3Fill,quadrant4Fill:nl.quadrant4Fill,quadrant1TextFill:nl.quadrant1TextFill,quadrant2TextFill:nl.quadrant2TextFill,quadrant3TextFill:nl.quadrant3TextFill,quadrant4TextFill:nl.quadrant4TextFill,quadrantPointFill:nl.quadrantPointFill,quadrantPointTextFill:nl.quadrantPointTextFill,quadrantXAxisTextFill:nl.quadrantXAxisTextFill,quadrantYAxisTextFill:nl.quadrantYAxisTextFill,quadrantTitleFill:nl.quadrantTitleFill,quadrantInternalBorderStrokeFill:nl.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:nl.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,de.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){de.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){de.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const s=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,a={top:e==="top"&&r?s:0,bottom:e==="bottom"&&r?s:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+a.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-a.top-a.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:a,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:s,titleSpace:a}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=s,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:s,quadrantTop:a}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+s,y:a,width:s,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:a,width:s,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:a+n,width:s,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+s,y:a+n,width:s,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:s,quadrantWidth:a}=r,o=s5().domain([0,1]).range([i,a+i]),l=s5().domain([0,1]).range([n+s,s]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:s,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-r,y1:l,x2:a+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+u,y1:l+r,x2:a+u,y2:l+s-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-r,y1:l+s,x2:a+u+r,y2:l+s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:l+r,x2:a,y2:l+s-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+o,y1:l+r,x2:a+o,y2:l+s-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+r,y1:l+i,x2:a+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,s=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(s),quadrants:this.getQuadrants(s),axisLabels:this.getAxisLabels(i,e,r,s),borderLines:this.getBorders(s),title:this.getTitle(n)}}},w(lT,"QuadrantBuilder"),lT),cT,sM=(cT=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(cT,"InvalidStyleError"),cT);function lj(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(lj,"validateHexCode");function pWe(t){return!/^\d+$/.test(t)}w(pWe,"validateNumber");function gWe(t){return!/^\d+px$/.test(t)}w(gWe,"validateSizeInPixels");function af(t){return Ln(t.trim(),Ve())}w(af,"textSanitizer");var Co=new Ffr;function mWe(t){Co.setData({quadrant1Text:af(t.text)})}w(mWe,"setQuadrant1Text");function yWe(t){Co.setData({quadrant2Text:af(t.text)})}w(yWe,"setQuadrant2Text");function vWe(t){Co.setData({quadrant3Text:af(t.text)})}w(vWe,"setQuadrant3Text");function bWe(t){Co.setData({quadrant4Text:af(t.text)})}w(bWe,"setQuadrant4Text");function xWe(t){Co.setData({xAxisLeftText:af(t.text)})}w(xWe,"setXAxisLeftText");function wWe(t){Co.setData({xAxisRightText:af(t.text)})}w(wWe,"setXAxisRightText");function TWe(t){Co.setData({yAxisTopText:af(t.text)})}w(TWe,"setYAxisTopText");function CWe(t){Co.setData({yAxisBottomText:af(t.text)})}w(CWe,"setYAxisBottomText");function AP(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(pWe(i))throw new sM(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(lj(i))throw new sM(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(lj(i))throw new sM(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(gWe(i))throw new sM(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(AP,"parseStyles");function kWe(t,e,r,n,i){const s=AP(i);Co.addPoints([{x:r,y:n,text:af(t.text),className:e,...s}])}w(kWe,"addPoint");function SWe(t,e){Co.addClass(t,AP(e))}w(SWe,"addClass");function EWe(t){Co.setConfig({chartWidth:t})}w(EWe,"setWidth");function AWe(t){Co.setConfig({chartHeight:t})}w(AWe,"setHeight");function MWe(){const t=Ve(),{themeVariables:e,quadrantChart:r}=t;return r&&Co.setConfig(r),Co.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Co.setData({titleText:qi()}),Co.build()}w(MWe,"getQuadrantData");var zfr=w(function(){Co.clear(),Ri()},"clear"),Vfr={setWidth:EWe,setHeight:AWe,setQuadrant1Text:mWe,setQuadrant2Text:yWe,setQuadrant3Text:vWe,setQuadrant4Text:bWe,setXAxisLeftText:xWe,setXAxisRightText:wWe,setYAxisTopText:TWe,setYAxisBottomText:CWe,parseStyles:AP,addPoint:kWe,addClass:SWe,getQuadrantData:MWe,clear:zfr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Hfr=w((t,e,r,n)=>{var E,A,R;function i(_){return _==="top"?"hanging":"middle"}w(i,"getDominantBaseLine");function s(_){return _==="left"?"start":"middle"}w(s,"getTextAnchor");function a(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}w(a,"getTransformation");const o=Ve();de.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=wt("#i"+e));const d=wt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((E=o.quadrantChart)==null?void 0:E.chartWidth)??500,g=((A=o.quadrantChart)==null?void 0:A.chartHeight)??500;Fs(d,g,p,((R=o.quadrantChart)==null?void 0:R.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),T=f.append("g").attr("class","title");m.title&&T.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",s(m.title.verticalPos)).attr("transform",a(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",_=>_.x1).attr("y1",_=>_.y1).attr("x2",_=>_.x2).attr("y2",_=>_.y2).style("stroke",_=>_.strokeFill).style("stroke-width",_=>_.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",_=>_.x).attr("y",_=>_.y).attr("width",_=>_.width).attr("height",_=>_.height).attr("fill",_=>_.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>s(_.text.verticalPos)).attr("transform",_=>a(_.text)).text(_=>_.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(_=>_.text).attr("fill",_=>_.fill).attr("font-size",_=>_.fontSize).attr("dominant-baseline",_=>i(_.horizontalPos)).attr("text-anchor",_=>s(_.verticalPos)).attr("transform",_=>a(_));const k=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",_=>_.x).attr("cy",_=>_.y).attr("r",_=>_.radius).attr("fill",_=>_.fill).attr("stroke",_=>_.strokeColor).attr("stroke-width",_=>_.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(_=>_.text.text).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>s(_.text.verticalPos)).attr("transform",_=>a(_.text))},"draw"),Gfr={draw:Hfr},Wfr={parser:Bfr,db:Vfr,renderer:Gfr,styles:w(()=>"","styles")};const qfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Wfr},Symbol.toStringTag,{value:"Module"}));var cj=(function(){var t=w(function($,O,D,F){for(D=D||{},F=$.length;F--;D[$[F]]=O);return D},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],s=[1,6],a=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],T=[1,43],C=[1,42],S=[1,47],k=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],R=[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],_=[1,65],P=[26,28],N={trace:w(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:w(function(O,D,F,z,V,B,H){var G=B.length-1;switch(V){case 5:z.setOrientation(B[G]);break;case 9:z.setDiagramTitle(B[G].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[G]);break;case 13:z.setLineData(B[G-1],B[G]);break;case 14:z.setBarData({text:"",type:"text"},B[G]);break;case 15:z.setBarData(B[G-1],B[G]);break;case 16:this.$=B[G].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[G].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[G-1];break;case 20:case 30:this.$=[B[G-2],...B[G]];break;case 21:case 31:this.$=[B[G]];break;case 22:this.$={value:Number(B[G-1]),label:B[G]};break;case 23:this.$={value:Number(B[G]),label:""};break;case 24:z.setXAxisTitle(B[G]);break;case 25:z.setXAxisTitle(B[G-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[G]);break;case 28:z.setXAxisRangeData(Number(B[G-2]),Number(B[G]));break;case 29:this.$=B[G-1];break;case 32:z.setYAxisTitle(B[G]);break;case 33:z.setYAxisTitle(B[G-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[G-2]),Number(B[G]));break;case 39:this.$={text:B[G],type:"text"};break;case 40:this.$={text:B[G],type:"text"};break;case 41:this.$={text:B[G],type:"markdown"};break;case 42:this.$=B[G];break;case 43:this.$=B[G-1]+""+B[G];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:s,38:a}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:s,38:a}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:s,38:a}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:s,38:a}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:s,38:a}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:39,13:38,24:T,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:49,17:48,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{11:52,17:51,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(A,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b}),t(A,[2,40]),t(A,[2,41]),t(R,[2,42]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(E,[2,10]),t(E,[2,24],{32:41,31:56,24:T,29:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},t(E,[2,11]),t(E,[2,32],{35:60,29:S}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:k},{25:63,27:64,29:_},t(E,[2,14]),{17:66,24:k},t(E,[2,16]),t(E,[2,17]),t(R,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:_},t(P,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:w(function(O,D){if(D.recoverable)this.trace(O);else{var F=new Error(O);throw F.hash=D,F}},"parseError"),parse:w(function(O){var D=this,F=[0],z=[],V=[null],B=[],H=this.table,G="",W=0,K=0,q=2,oe=1,Q=B.slice.call(arguments,1),Z=Object.create(this.lexer),re={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(re.yy[ie]=this.yy[ie]);Z.setInput(O,re.yy),re.yy.lexer=Z,re.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var me=Z.yylloc;B.push(me);var te=Z.options&&Z.options.ranges;typeof re.yy.parseError=="function"?this.parseError=re.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(pe){F.length=F.length-2*pe,V.length=V.length-pe,B.length=B.length-pe}w(_e,"popStack");function $e(){var pe;return pe=z.pop()||Z.lex()||oe,typeof pe!="number"&&(pe instanceof Array&&(z=pe,pe=z.pop()),pe=D.symbols_[pe]||pe),pe}w($e,"lex");for(var Fe,ce,he,Te,ge={},He,we,Me,je;;){if(ce=F[F.length-1],this.defaultActions[ce]?he=this.defaultActions[ce]:((Fe===null||typeof Fe>"u")&&(Fe=$e()),he=H[ce]&&H[ce][Fe]),typeof he>"u"||!he.length||!he[0]){var le="";je=[];for(He in H[ce])this.terminals_[He]&&He>q&&je.push("'"+this.terminals_[He]+"'");Z.showPosition?le="Parse error on line "+(W+1)+`: `+Z.showPosition()+` Expecting `+je.join(", ")+", got '"+(this.terminals_[Fe]||Fe)+"'":le="Parse error on line "+(W+1)+": Unexpected "+(Fe==oe?"end of input":"'"+(this.terminals_[Fe]||Fe)+"'"),this.parseError(le,{text:Z.match,token:this.terminals_[Fe]||Fe,line:Z.yylineno,loc:me,expected:je})}if(he[0]instanceof Array&&he.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Fe);switch(he[0]){case 1:F.push(Fe),V.push(Z.yytext),B.push(Z.yylloc),F.push(he[1]),Fe=null,K=Z.yyleng,G=Z.yytext,W=Z.yylineno,me=Z.yylloc;break;case 2:if(we=this.productions_[he[1]][1],ge.$=V[V.length-we],ge._$={first_line:B[B.length-(we||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(we||1)].first_column,last_column:B[B.length-1].last_column},te&&(ge._$.range=[B[B.length-(we||1)].range[0],B[B.length-1].range[1]]),Te=this.performAction.apply(ge,[G,K,W,re.yy,he[1],V,B].concat(Q)),typeof Te<"u")return Te;we&&(F=F.slice(0,-1*we*2),V=V.slice(0,-1*we),B=B.slice(0,-1*we)),F.push(this.productions_[he[1]][0]),V.push(ge.$),B.push(ge._$),Me=H[F[F.length-2]][F[F.length-1]],F.push(Me);break;case 3:return!0}}return!0},"parse")},L=(function(){var $={EOF:1,parseError:w(function(D,F){if(this.yy.parser)this.yy.parser.parseError(D,F);else throw new Error(D)},"parseError"),setInput:w(function(O,D){return this.yy=D||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:w(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var D=O.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),O},"input"),unput:w(function(O){var D=O.length,F=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===z.length?this.yylloc.first_column:0)+z[z.length-F.length].length-F[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-D]),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(O){this.unput(this.match.slice(O))},"less"),pastInput:w(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:w(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:w(function(){var O=this.pastInput(),D=new Array(O.length+1).join("-");return O+this.upcomingInput()+` `+D+"^"},"showPosition"),test_match:w(function(O,D){var F,z,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),z=O[0].match(/(?:\r\n?|\n).*/g),z&&(this.yylineno+=z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],F=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var B in V)this[B]=V[B];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,D,F,z;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),B=0;BD[0].length)){if(D=F,z=B,this.options.backtrack_lexer){if(O=this.test_match(F,V[B]),O!==!1)return O;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(O=this.test_match(D,V[z]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var D=this.next();return D||this.lex()},"lex"),begin:w(function(D){this.conditionStack.push(D)},"begin"),popState:w(function(){var D=this.conditionStack.length-1;return D>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(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:w(function(D){this.begin(D)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(D,F,z,V){switch(z){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/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 $})();N.lexer=L;function I(){this.yy={}}return w(I,"Parser"),I.prototype=N,N.Parser=I,new I})();sj.parser=sj;var _fr=sj;function aj(t){return t.type==="bar"}w(aj,"isBarPlot");function BI(t){return t.type==="band"}w(BI,"isBandAxisData");function qb(t){return t.type==="linear"}w(qb,"isLinearAxisData");var lT,CWe=(lT=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((s,a)=>Math.max(a.length,s),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const s of e){const a=fke(i,1,s),o=a?a.width:s.length*r,l=a?a.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},w(lT,"TextDimensionCalculatorWithFont"),lT),P1e=.7,$1e=.2,cT,kWe=(cT=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){P1e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(P1e*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=$1e*e.width;this.outerPadding=Math.min(n.width/2,i);let s=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(s=Math.max(s,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),s+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,s<=r&&(r-=s,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=$1e*e.height;this.outerPadding=Math.min(n.height/2,i);const s=n.width+this.axisConfig.labelPadding*2;s<=r&&(r-=s,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},w(cT,"BaseAxis"),cT),uT,Lfr=(uT=class extends kWe{constructor(e,r,n,i,s){super(e,i,s,r),this.categories=n,this.scale=QH().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=QH().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),de.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},w(uT,"BandAxis"),uT),hT,Ifr=(hT=class extends kWe{constructor(e,r,n,i,s){super(e,i,s,r),this.domain=n,this.scale=n5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=n5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(hT,"LinearAxis"),hT);function oj(t,e,r,n){const i=new CWe(n);return BI(t)?new Lfr(e,r,t.categories,t.title,i):new Ifr(e,r,[t.min,t.max],t.title,i)}w(oj,"getAxis");var dT,Nfr=(dT=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},w(dT,"ChartTitle"),dT);function SWe(t,e,r,n){const i=new CWe(n);return new Nfr(i,t,e,r)}w(SWe,"getChartTitleComponent");var fT,Dfr=(fT=class{constructor(e,r,n,i,s){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=s}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=g6().y(i=>i[0]).x(i=>i[1])(e):r=g6().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const a=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?a.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):a.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}a.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:a})}return n}},w(fT,"LinePlot"),fT),pT,Ofr=(pT=class{constructor(e,r,n,i,s,a){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=s,this.plotIndex=a}getDrawableElement(){const e=this.barData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(s=>({x:this.boundingRect.x,y:s[0]-i,height:n,width:s[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(s=>({x:s[0]-i,y:s[1],width:n,height:this.boundingRect.y+this.boundingRect.height-s[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},w(pT,"BarPlot"),pT),gT,Pfr=(gT=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Dfr(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Ofr(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(gT,"BasePlot"),gT);function EWe(t,e,r){return new Pfr(t,e,r)}w(EWe,"getPlotComponent");var mT,$fr=(mT=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:SWe(e,r,n,i),plot:EWe(e,r,n),xAxis:oj(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:oj(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:s,height:a});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(s+=e,e=0),r>0&&(a+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+s]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+a}),this.componentStore.yAxis.setRange([i,i+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>aj(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,s=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:a,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,s=n+l.height,e>0&&(a+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:s}),this.componentStore.yAxis.setRange([i,i+a]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(u=>aj(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},w(mT,"Orchestrator"),mT),yT,Bfr=(yT=class{static build(e,r,n,i){return new $fr(e,r,n,i).getDrawableElement()}},w(yT,"XYChartBuilder"),yT),fE=0,AWe,pE=Cne(),gE=Tne(),Un=kne(),lj=gE.plotColorPalette.split(",").map(t=>t.trim()),SP=!1,wne=!1;function Tne(){const t=$0(),e=vr();return es(t.xyChart,e.themeVariables.xyChart)}w(Tne,"getChartDefaultThemeConfig");function Cne(){const t=vr();return es(Sn.xyChart,t.xyChart)}w(Cne,"getChartDefaultConfig");function kne(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(kne,"getChartDefaultData");function K7(t){const e=vr();return Ln(t.trim(),e)}w(K7,"textSanitizer");function MWe(t){AWe=t}w(MWe,"setTmpSVGG");function RWe(t){t==="horizontal"?pE.chartOrientation="horizontal":pE.chartOrientation="vertical"}w(RWe,"setOrientation");function _We(t){Un.xAxis.title=K7(t.text)}w(_We,"setXAxisTitle");function Sne(t,e){Un.xAxis={type:"linear",title:Un.xAxis.title,min:t,max:e},SP=!0}w(Sne,"setXAxisRangeData");function LWe(t){Un.xAxis={type:"band",title:Un.xAxis.title,categories:t.map(e=>K7(e.text))},SP=!0}w(LWe,"setXAxisBand");function IWe(t){Un.yAxis.title=K7(t.text)}w(IWe,"setYAxisTitle");function NWe(t,e){Un.yAxis={type:"linear",title:Un.yAxis.title,min:t,max:e},wne=!0}w(NWe,"setYAxisRangeData");function DWe(t){const e=Math.min(...t),r=Math.max(...t),n=qb(Un.yAxis)?Un.yAxis.min:1/0,i=qb(Un.yAxis)?Un.yAxis.max:-1/0;Un.yAxis={type:"linear",title:Un.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}w(DWe,"setYAxisRangeFromPlotData");function Ene(t){let e=[];if(t.length===0)return e;if(!SP){const r=qb(Un.xAxis)?Un.xAxis.min:1/0,n=qb(Un.xAxis)?Un.xAxis.max:-1/0;Sne(Math.min(r,1),Math.max(n,t.length))}if(BI(Un.xAxis)&&t.length>Un.xAxis.categories.length&&(t=t.slice(0,Un.xAxis.categories.length)),wne||DWe(t),BI(Un.xAxis)&&(e=Un.xAxis.categories.map((r,n)=>[r,t[n]])),qb(Un.xAxis)){const r=Un.xAxis.min,n=Un.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((s,a)=>[`${r+a*i}`,s])}}return e}w(Ene,"transformDataWithoutCategory");function Ane(t){return lj[t===0?0:t%lj.length]}w(Ane,"getPlotColorFromPalette");function OWe(t,e){const r=e.map(a=>a.value),n=e.map(a=>a.label?K7(a.label):""),i=Ene(r),s=n.some(a=>a!=="");Un.plots.push({type:"line",strokeFill:Ane(fE),strokeWidth:2,data:i,...s?{pointLabels:n}:{}}),fE++}w(OWe,"setLineData");function PWe(t,e){const r=e.map(i=>i.value),n=Ene(r);Un.plots.push({type:"bar",fill:Ane(fE),data:n}),fE++}w(PWe,"setBarData");function $We(){if(Un.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Un.title=qi(),Bfr.build(pE,Un,gE,AWe)}w($We,"getDrawableElem");function BWe(){return gE}w(BWe,"getChartThemeConfig");function FWe(){return pE}w(FWe,"getChartConfig");function zWe(){return Un}w(zWe,"getXYChartData");var Ffr=w(function(){Ri(),fE=0,pE=Cne(),Un=kne(),gE=Tne(),lj=gE.plotColorPalette.split(",").map(t=>t.trim()),SP=!1,wne=!1},"clear"),zfr={getDrawableElem:$We,clear:Ffr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,setOrientation:RWe,setXAxisTitle:_We,setXAxisRangeData:Sne,setXAxisBand:LWe,setYAxisTitle:IWe,setYAxisRangeData:NWe,setLineData:OWe,setBarData:PWe,setTmpSVGG:MWe,getChartThemeConfig:BWe,getChartConfig:FWe,getXYChartData:zWe},Vfr=w((t,e,r,n)=>{const i=n.db,s=i.getChartThemeConfig(),a=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}w(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}w(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}w(h,"getTextTransformation"),de.debug(`Rendering xychart chart -`+t);const d=Xo(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");Fs(d,a.height,a.width,!0),d.attr("viewBox",`0 0 ${a.width} ${a.height}`),p.attr("fill",s.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let x=f,b="";for(const[T]of v.entries()){let C=f;T>0&&m[b]&&(C=m[b]),b+=v[T],x=m[b],x||(x=m[b]=C.append("g").attr("class",v[T]))}return x}w(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),a.showDataLabel){const b=a.showDataLabelOutsideBar;if(a.chartOrientation==="horizontal"){let T=function(_,P){const{data:N,label:L}=_;return P*L.length*C<=N.width-S};w(T,"fitsHorizontally");const C=.7,S=10,k=v.data.map((_,P)=>({data:_,label:o[P].toString()})).filter(_=>_.data.width>0&&_.data.height>0),E=k.map(_=>{const{data:P}=_;let N=P.height*.7;for(;!T(_,N)&&N>0;)N-=1;return N}),A=Math.floor(Math.min(...E)),R=w(_=>b?_.data.x+_.data.width+S:_.data.x+_.data.width-S,"determineLabelXPosition");x.selectAll("text").data(k).enter().append("text").attr("x",R).attr("y",_=>_.data.y+_.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",s.dataLabelColor).attr("font-size",`${A}px`).text(_=>_.label)}else{let T=function(R,_,P){const{data:N,label:L}=R,$=_*L.length*.7,O=N.x+N.width/2,D=O-$/2,F=O+$/2,z=D>=N.x&&F<=N.x+N.width,V=N.y+P+_<=N.y+N.height;return z&&V};w(T,"fitsInBar");const C=10,S=v.data.map((R,_)=>({data:R,label:o[_].toString()})).filter(R=>R.data.width>0&&R.data.height>0),k=S.map(R=>{const{data:_,label:P}=R;let N=_.width/(P.length*.7);for(;!T(R,N,C)&&N>0;)N-=1;return N}),E=Math.floor(Math.min(...k)),A=w(R=>b?R.data.y-C:R.data.y+C,"determineLabelYPosition");x.selectAll("text").data(S).enter().append("text").attr("x",R=>R.data.x+R.data.width/2).attr("y",A).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",s.dataLabelColor).attr("font-size",`${E}px`).text(R=>R.label)}}break;case"text":x.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":x.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),Hfr={draw:Vfr},Gfr={parser:_fr,db:zfr,renderer:Hfr};const Wfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gfr},Symbol.toStringTag,{value:"Module"}));var cj=(function(){var t=w(function(ne,j,J,ue){for(J=J||{},ue=ne.length;ue--;J[ne[ue]]=j);return J},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],s=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],a=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],T=[1,32],C=[1,30],S=[1,39],k=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],A=[1,61],R=[89,90],_=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],P=[27,29],N=[1,70],L=[1,71],I=[1,72],$=[1,73],O=[1,74],D=[1,75],F=[1,76],z=[1,83],V=[1,80],B=[1,84],H=[1,85],G=[1,86],W=[1,87],K=[1,88],q=[1,89],oe=[1,90],Q=[1,91],Z=[1,92],re=[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],ie=[63,64],me=[1,101],te=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],_e=[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],$e=[1,110],Fe=[1,106],ce=[1,107],he=[1,108],Te=[1,109],ge=[1,111],He=[1,116],we=[1,117],Me=[1,114],je=[1,115],le={trace:w(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:w(function(j,J,ue,X,fe,ee,Ae){var Re=ee.length-1;switch(fe){case 4:this.$=ee[Re].trim(),X.setAccTitle(this.$);break;case 5:case 6:this.$=ee[Re].trim(),X.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:X.setDirection("TB");break;case 18:X.setDirection("BT");break;case 19:X.setDirection("RL");break;case 20:X.setDirection("LR");break;case 21:X.addRequirement(ee[Re-3],ee[Re-4]);break;case 22:X.addRequirement(ee[Re-5],ee[Re-6]),X.setClass([ee[Re-5]],ee[Re-3]);break;case 23:X.setNewReqId(ee[Re-2]);break;case 24:X.setNewReqText(ee[Re-2]);break;case 25:X.setNewReqRisk(ee[Re-2]);break;case 26:X.setNewReqVerifyMethod(ee[Re-2]);break;case 29:this.$=X.RequirementType.REQUIREMENT;break;case 30:this.$=X.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=X.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=X.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=X.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=X.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=X.RiskLevel.LOW_RISK;break;case 36:this.$=X.RiskLevel.MED_RISK;break;case 37:this.$=X.RiskLevel.HIGH_RISK;break;case 38:this.$=X.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=X.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=X.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=X.VerifyType.VERIFY_TEST;break;case 42:X.addElement(ee[Re-3]);break;case 43:X.addElement(ee[Re-5]),X.setClass([ee[Re-5]],ee[Re-3]);break;case 44:X.setNewElementType(ee[Re-2]);break;case 45:X.setNewElementDocRef(ee[Re-2]);break;case 48:X.addRelationship(ee[Re-2],ee[Re],ee[Re-4]);break;case 49:X.addRelationship(ee[Re-2],ee[Re-4],ee[Re]);break;case 50:this.$=X.Relationships.CONTAINS;break;case 51:this.$=X.Relationships.COPIES;break;case 52:this.$=X.Relationships.DERIVES;break;case 53:this.$=X.Relationships.SATISFIES;break;case 54:this.$=X.Relationships.VERIFIES;break;case 55:this.$=X.Relationships.REFINES;break;case 56:this.$=X.Relationships.TRACES;break;case 57:this.$=ee[Re-2],X.defineClass(ee[Re-1],ee[Re]);break;case 58:X.setClass(ee[Re-1],ee[Re]);break;case 59:X.setClass([ee[Re-2]],ee[Re]);break;case 60:case 62:this.$=[ee[Re]];break;case 61:case 63:this.$=ee[Re-2].concat([ee[Re]]);break;case 64:this.$=ee[Re-2],X.setCssStyle(ee[Re-1],ee[Re]);break;case 65:this.$=[ee[Re]];break;case 66:ee[Re-2].push(ee[Re]),this.$=ee[Re-2];break;case 68:this.$=ee[Re-1]+ee[Re];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(s,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:a,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},t(s,[2,4]),t(s,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:a,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:A,89:S,90:k},{30:63,33:62,75:A,89:S,90:k},{30:64,33:62,75:A,89:S,90:k},t(R,[2,29]),t(R,[2,30]),t(R,[2,31]),t(R,[2,32]),t(R,[2,33]),t(R,[2,34]),t(_,[2,81]),t(_,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:N,66:L,67:I,68:$,69:O,70:D,71:F},{62:77,65:N,66:L,67:I,68:$,69:O,70:D,71:F},{30:78,33:62,75:A,89:S,90:k},{73:79,75:z,76:V,78:81,79:82,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z},t(re,[2,60]),t(re,[2,62]),{73:93,75:z,76:V,78:81,79:82,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z},{30:94,33:62,75:A,76:V,89:S,90:k},{5:[1,95]},{30:96,33:62,75:A,89:S,90:k},{5:[1,97]},{30:98,33:62,75:A,89:S,90:k},{63:[1,99]},t(ie,[2,50]),t(ie,[2,51]),t(ie,[2,52]),t(ie,[2,53]),t(ie,[2,54]),t(ie,[2,55]),t(ie,[2,56]),{64:[1,100]},t(E,[2,59],{76:V}),t(E,[2,64],{76:me}),{33:103,75:[1,102],89:S,90:k},t(te,[2,65],{79:104,75:z,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z}),t(_e,[2,67]),t(_e,[2,69]),t(_e,[2,70]),t(_e,[2,71]),t(_e,[2,72]),t(_e,[2,73]),t(_e,[2,74]),t(_e,[2,75]),t(_e,[2,76]),t(_e,[2,77]),t(_e,[2,78]),t(E,[2,57],{76:me}),t(E,[2,58],{76:V}),{5:$e,28:105,31:Fe,34:ce,36:he,38:Te,40:ge},{27:[1,112],76:V},{5:He,40:we,56:113,57:Me,59:je},{27:[1,118],76:V},{33:119,89:S,90:k},{33:120,89:S,90:k},{75:z,78:121,79:82,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z},t(re,[2,61]),t(re,[2,63]),t(_e,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:$e,28:126,31:Fe,34:ce,36:he,38:Te,40:ge},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:He,40:we,56:130,57:Me,59:je},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(te,[2,66],{79:104,75:z,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z}),{33:132,89:S,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:$e,28:145,31:Fe,34:ce,36:he,38:Te,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:He,40:we,56:152,57:Me,59:je},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:$e,28:159,31:Fe,34:ce,36:he,38:Te,40:ge},{5:$e,28:160,31:Fe,34:ce,36:he,38:Te,40:ge},{5:$e,28:161,31:Fe,34:ce,36:he,38:Te,40:ge},{5:$e,28:162,31:Fe,34:ce,36:he,38:Te,40:ge},{5:He,40:we,56:163,57:Me,59:je},{5:He,40:we,56:164,57:Me,59:je},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:w(function(j,J){if(J.recoverable)this.trace(j);else{var ue=new Error(j);throw ue.hash=J,ue}},"parseError"),parse:w(function(j){var J=this,ue=[0],X=[],fe=[null],ee=[],Ae=this.table,Re="",Xe=0,Ne=0,qe=2,De=1,Ke=ee.slice.call(arguments,1),ze=Object.create(this.lexer),st={yy:{}};for(var Oe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Oe)&&(st.yy[Oe]=this.yy[Oe]);ze.setInput(j,st.yy),st.yy.lexer=ze,st.yy.parser=this,typeof ze.yylloc>"u"&&(ze.yylloc={});var mt=ze.yylloc;ee.push(mt);var Le=ze.options&&ze.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(Ee){ue.length=ue.length-2*Ee,fe.length=fe.length-Ee,ee.length=ee.length-Ee}w(St,"popStack");function At(){var Ee;return Ee=X.pop()||ze.lex()||De,typeof Ee!="number"&&(Ee instanceof Array&&(X=Ee,Ee=X.pop()),Ee=J.symbols_[Ee]||Ee),Ee}w(At,"lex");for(var lt,zt,It,ft,xe={},Nt,Tt,yt,Rt;;){if(zt=ue[ue.length-1],this.defaultActions[zt]?It=this.defaultActions[zt]:((lt===null||typeof lt>"u")&&(lt=At()),It=Ae[zt]&&Ae[zt][lt]),typeof It>"u"||!It.length||!It[0]){var Or="";Rt=[];for(Nt in Ae[zt])this.terminals_[Nt]&&Nt>qe&&Rt.push("'"+this.terminals_[Nt]+"'");ze.showPosition?Or="Parse error on line "+(Xe+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var D=this.next();return D||this.lex()},"lex"),begin:w(function(D){this.conditionStack.push(D)},"begin"),popState:w(function(){var D=this.conditionStack.length-1;return D>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(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:w(function(D){this.begin(D)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(D,F,z,V){switch(z){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/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 $})();N.lexer=L;function I(){this.yy={}}return w(I,"Parser"),I.prototype=N,N.Parser=I,new I})();cj.parser=cj;var Ufr=cj;function uj(t){return t.type==="bar"}w(uj,"isBarPlot");function VI(t){return t.type==="band"}w(VI,"isBandAxisData");function Yb(t){return t.type==="linear"}w(Yb,"isLinearAxisData");var uT,RWe=(uT=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((s,a)=>Math.max(a.length,s),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const s of e){const a=bke(i,1,s),o=a?a.width:s.length*r,l=a?a.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},w(uT,"TextDimensionCalculatorWithFont"),uT),H1e=.7,G1e=.2,hT,_We=(hT=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){H1e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(H1e*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=G1e*e.width;this.outerPadding=Math.min(n.width/2,i);let s=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(s=Math.max(s,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),s+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,s<=r&&(r-=s,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=G1e*e.height;this.outerPadding=Math.min(n.height/2,i);const s=n.width+this.axisConfig.labelPadding*2;s<=r&&(r-=s,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},w(hT,"BaseAxis"),hT),dT,Yfr=(dT=class extends _We{constructor(e,r,n,i,s){super(e,i,s,r),this.categories=n,this.scale=rG().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=rG().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),de.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},w(dT,"BandAxis"),dT),fT,jfr=(fT=class extends _We{constructor(e,r,n,i,s){super(e,i,s,r),this.domain=n,this.scale=s5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=s5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(fT,"LinearAxis"),fT);function hj(t,e,r,n){const i=new RWe(n);return VI(t)?new Yfr(e,r,t.categories,t.title,i):new jfr(e,r,[t.min,t.max],t.title,i)}w(hj,"getAxis");var pT,Xfr=(pT=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},w(pT,"ChartTitle"),pT);function LWe(t,e,r,n){const i=new RWe(n);return new Xfr(i,t,e,r)}w(LWe,"getChartTitleComponent");var gT,Kfr=(gT=class{constructor(e,r,n,i,s){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=s}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=v6().y(i=>i[0]).x(i=>i[1])(e):r=v6().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const a=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?a.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):a.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}a.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:a})}return n}},w(gT,"LinePlot"),gT),mT,Zfr=(mT=class{constructor(e,r,n,i,s,a){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=s,this.plotIndex=a}getDrawableElement(){const e=this.barData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(s=>({x:this.boundingRect.x,y:s[0]-i,height:n,width:s[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(s=>({x:s[0]-i,y:s[1],width:n,height:this.boundingRect.y+this.boundingRect.height-s[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},w(mT,"BarPlot"),mT),yT,Qfr=(yT=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new Kfr(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Zfr(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(yT,"BasePlot"),yT);function IWe(t,e,r){return new Qfr(t,e,r)}w(IWe,"getPlotComponent");var vT,Jfr=(vT=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:LWe(e,r,n,i),plot:IWe(e,r,n),xAxis:hj(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:hj(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:s,height:a});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(s+=e,e=0),r>0&&(a+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+s]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+a}),this.componentStore.yAxis.setRange([i,i+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>uj(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,s=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:a,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,s=n+l.height,e>0&&(a+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:s}),this.componentStore.yAxis.setRange([i,i+a]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(u=>uj(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},w(vT,"Orchestrator"),vT),bT,e0r=(bT=class{static build(e,r,n,i){return new Jfr(e,r,n,i).getDrawableElement()}},w(bT,"XYChartBuilder"),bT),mE=0,NWe,yE=Ane(),vE=Ene(),Un=Mne(),dj=vE.plotColorPalette.split(",").map(t=>t.trim()),MP=!1,Sne=!1;function Ene(){const t=V0(),e=br();return es(t.xyChart,e.themeVariables.xyChart)}w(Ene,"getChartDefaultThemeConfig");function Ane(){const t=br();return es(Sn.xyChart,t.xyChart)}w(Ane,"getChartDefaultConfig");function Mne(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(Mne,"getChartDefaultData");function J7(t){const e=br();return Ln(t.trim(),e)}w(J7,"textSanitizer");function DWe(t){NWe=t}w(DWe,"setTmpSVGG");function OWe(t){t==="horizontal"?yE.chartOrientation="horizontal":yE.chartOrientation="vertical"}w(OWe,"setOrientation");function PWe(t){Un.xAxis.title=J7(t.text)}w(PWe,"setXAxisTitle");function Rne(t,e){Un.xAxis={type:"linear",title:Un.xAxis.title,min:t,max:e},MP=!0}w(Rne,"setXAxisRangeData");function $We(t){Un.xAxis={type:"band",title:Un.xAxis.title,categories:t.map(e=>J7(e.text))},MP=!0}w($We,"setXAxisBand");function BWe(t){Un.yAxis.title=J7(t.text)}w(BWe,"setYAxisTitle");function FWe(t,e){Un.yAxis={type:"linear",title:Un.yAxis.title,min:t,max:e},Sne=!0}w(FWe,"setYAxisRangeData");function zWe(t){const e=Math.min(...t),r=Math.max(...t),n=Yb(Un.yAxis)?Un.yAxis.min:1/0,i=Yb(Un.yAxis)?Un.yAxis.max:-1/0;Un.yAxis={type:"linear",title:Un.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}w(zWe,"setYAxisRangeFromPlotData");function _ne(t){let e=[];if(t.length===0)return e;if(!MP){const r=Yb(Un.xAxis)?Un.xAxis.min:1/0,n=Yb(Un.xAxis)?Un.xAxis.max:-1/0;Rne(Math.min(r,1),Math.max(n,t.length))}if(VI(Un.xAxis)&&t.length>Un.xAxis.categories.length&&(t=t.slice(0,Un.xAxis.categories.length)),Sne||zWe(t),VI(Un.xAxis)&&(e=Un.xAxis.categories.map((r,n)=>[r,t[n]])),Yb(Un.xAxis)){const r=Un.xAxis.min,n=Un.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((s,a)=>[`${r+a*i}`,s])}}return e}w(_ne,"transformDataWithoutCategory");function Lne(t){return dj[t===0?0:t%dj.length]}w(Lne,"getPlotColorFromPalette");function VWe(t,e){const r=e.map(a=>a.value),n=e.map(a=>a.label?J7(a.label):""),i=_ne(r),s=n.some(a=>a!=="");Un.plots.push({type:"line",strokeFill:Lne(mE),strokeWidth:2,data:i,...s?{pointLabels:n}:{}}),mE++}w(VWe,"setLineData");function HWe(t,e){const r=e.map(i=>i.value),n=_ne(r);Un.plots.push({type:"bar",fill:Lne(mE),data:n}),mE++}w(HWe,"setBarData");function GWe(){if(Un.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Un.title=qi(),e0r.build(yE,Un,vE,NWe)}w(GWe,"getDrawableElem");function WWe(){return vE}w(WWe,"getChartThemeConfig");function qWe(){return yE}w(qWe,"getChartConfig");function UWe(){return Un}w(UWe,"getXYChartData");var t0r=w(function(){Ri(),mE=0,yE=Ane(),Un=Mne(),vE=Ene(),dj=vE.plotColorPalette.split(",").map(t=>t.trim()),MP=!1,Sne=!1},"clear"),r0r={getDrawableElem:GWe,clear:t0r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,setOrientation:OWe,setXAxisTitle:PWe,setXAxisRangeData:Rne,setXAxisBand:$We,setYAxisTitle:BWe,setYAxisRangeData:FWe,setLineData:VWe,setBarData:HWe,setTmpSVGG:DWe,getChartThemeConfig:WWe,getChartConfig:qWe,getXYChartData:UWe},n0r=w((t,e,r,n)=>{const i=n.db,s=i.getChartThemeConfig(),a=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}w(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}w(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}w(h,"getTextTransformation"),de.debug(`Rendering xychart chart +`+t);const d=Xo(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");Fs(d,a.height,a.width,!0),d.attr("viewBox",`0 0 ${a.width} ${a.height}`),p.attr("fill",s.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let x=f,b="";for(const[T]of v.entries()){let C=f;T>0&&m[b]&&(C=m[b]),b+=v[T],x=m[b],x||(x=m[b]=C.append("g").attr("class",v[T]))}return x}w(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),a.showDataLabel){const b=a.showDataLabelOutsideBar;if(a.chartOrientation==="horizontal"){let T=function(_,P){const{data:N,label:L}=_;return P*L.length*C<=N.width-S};w(T,"fitsHorizontally");const C=.7,S=10,k=v.data.map((_,P)=>({data:_,label:o[P].toString()})).filter(_=>_.data.width>0&&_.data.height>0),E=k.map(_=>{const{data:P}=_;let N=P.height*.7;for(;!T(_,N)&&N>0;)N-=1;return N}),A=Math.floor(Math.min(...E)),R=w(_=>b?_.data.x+_.data.width+S:_.data.x+_.data.width-S,"determineLabelXPosition");x.selectAll("text").data(k).enter().append("text").attr("x",R).attr("y",_=>_.data.y+_.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",s.dataLabelColor).attr("font-size",`${A}px`).text(_=>_.label)}else{let T=function(R,_,P){const{data:N,label:L}=R,$=_*L.length*.7,O=N.x+N.width/2,D=O-$/2,F=O+$/2,z=D>=N.x&&F<=N.x+N.width,V=N.y+P+_<=N.y+N.height;return z&&V};w(T,"fitsInBar");const C=10,S=v.data.map((R,_)=>({data:R,label:o[_].toString()})).filter(R=>R.data.width>0&&R.data.height>0),k=S.map(R=>{const{data:_,label:P}=R;let N=_.width/(P.length*.7);for(;!T(R,N,C)&&N>0;)N-=1;return N}),E=Math.floor(Math.min(...k)),A=w(R=>b?R.data.y-C:R.data.y+C,"determineLabelYPosition");x.selectAll("text").data(S).enter().append("text").attr("x",R=>R.data.x+R.data.width/2).attr("y",A).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",s.dataLabelColor).attr("font-size",`${E}px`).text(R=>R.label)}}break;case"text":x.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":x.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),i0r={draw:n0r},s0r={parser:Ufr,db:r0r,renderer:i0r};const a0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:s0r},Symbol.toStringTag,{value:"Module"}));var fj=(function(){var t=w(function(ne,j,J,ue){for(J=J||{},ue=ne.length;ue--;J[ne[ue]]=j);return J},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],s=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],a=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],T=[1,32],C=[1,30],S=[1,39],k=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],A=[1,61],R=[89,90],_=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],P=[27,29],N=[1,70],L=[1,71],I=[1,72],$=[1,73],O=[1,74],D=[1,75],F=[1,76],z=[1,83],V=[1,80],B=[1,84],H=[1,85],G=[1,86],W=[1,87],K=[1,88],q=[1,89],oe=[1,90],Q=[1,91],Z=[1,92],re=[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],ie=[63,64],me=[1,101],te=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],_e=[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],$e=[1,110],Fe=[1,106],ce=[1,107],he=[1,108],Te=[1,109],ge=[1,111],He=[1,116],we=[1,117],Me=[1,114],je=[1,115],le={trace:w(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:w(function(j,J,ue,X,fe,ee,Ae){var Re=ee.length-1;switch(fe){case 4:this.$=ee[Re].trim(),X.setAccTitle(this.$);break;case 5:case 6:this.$=ee[Re].trim(),X.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:X.setDirection("TB");break;case 18:X.setDirection("BT");break;case 19:X.setDirection("RL");break;case 20:X.setDirection("LR");break;case 21:X.addRequirement(ee[Re-3],ee[Re-4]);break;case 22:X.addRequirement(ee[Re-5],ee[Re-6]),X.setClass([ee[Re-5]],ee[Re-3]);break;case 23:X.setNewReqId(ee[Re-2]);break;case 24:X.setNewReqText(ee[Re-2]);break;case 25:X.setNewReqRisk(ee[Re-2]);break;case 26:X.setNewReqVerifyMethod(ee[Re-2]);break;case 29:this.$=X.RequirementType.REQUIREMENT;break;case 30:this.$=X.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=X.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=X.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=X.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=X.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=X.RiskLevel.LOW_RISK;break;case 36:this.$=X.RiskLevel.MED_RISK;break;case 37:this.$=X.RiskLevel.HIGH_RISK;break;case 38:this.$=X.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=X.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=X.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=X.VerifyType.VERIFY_TEST;break;case 42:X.addElement(ee[Re-3]);break;case 43:X.addElement(ee[Re-5]),X.setClass([ee[Re-5]],ee[Re-3]);break;case 44:X.setNewElementType(ee[Re-2]);break;case 45:X.setNewElementDocRef(ee[Re-2]);break;case 48:X.addRelationship(ee[Re-2],ee[Re],ee[Re-4]);break;case 49:X.addRelationship(ee[Re-2],ee[Re-4],ee[Re]);break;case 50:this.$=X.Relationships.CONTAINS;break;case 51:this.$=X.Relationships.COPIES;break;case 52:this.$=X.Relationships.DERIVES;break;case 53:this.$=X.Relationships.SATISFIES;break;case 54:this.$=X.Relationships.VERIFIES;break;case 55:this.$=X.Relationships.REFINES;break;case 56:this.$=X.Relationships.TRACES;break;case 57:this.$=ee[Re-2],X.defineClass(ee[Re-1],ee[Re]);break;case 58:X.setClass(ee[Re-1],ee[Re]);break;case 59:X.setClass([ee[Re-2]],ee[Re]);break;case 60:case 62:this.$=[ee[Re]];break;case 61:case 63:this.$=ee[Re-2].concat([ee[Re]]);break;case 64:this.$=ee[Re-2],X.setCssStyle(ee[Re-1],ee[Re]);break;case 65:this.$=[ee[Re]];break;case 66:ee[Re-2].push(ee[Re]),this.$=ee[Re-2];break;case 68:this.$=ee[Re-1]+ee[Re];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(s,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:a,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},t(s,[2,4]),t(s,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:a,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{4:17,5:a,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:x,72:b,74:T,77:C,89:S,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:A,89:S,90:k},{30:63,33:62,75:A,89:S,90:k},{30:64,33:62,75:A,89:S,90:k},t(R,[2,29]),t(R,[2,30]),t(R,[2,31]),t(R,[2,32]),t(R,[2,33]),t(R,[2,34]),t(_,[2,81]),t(_,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:N,66:L,67:I,68:$,69:O,70:D,71:F},{62:77,65:N,66:L,67:I,68:$,69:O,70:D,71:F},{30:78,33:62,75:A,89:S,90:k},{73:79,75:z,76:V,78:81,79:82,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z},t(re,[2,60]),t(re,[2,62]),{73:93,75:z,76:V,78:81,79:82,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z},{30:94,33:62,75:A,76:V,89:S,90:k},{5:[1,95]},{30:96,33:62,75:A,89:S,90:k},{5:[1,97]},{30:98,33:62,75:A,89:S,90:k},{63:[1,99]},t(ie,[2,50]),t(ie,[2,51]),t(ie,[2,52]),t(ie,[2,53]),t(ie,[2,54]),t(ie,[2,55]),t(ie,[2,56]),{64:[1,100]},t(E,[2,59],{76:V}),t(E,[2,64],{76:me}),{33:103,75:[1,102],89:S,90:k},t(te,[2,65],{79:104,75:z,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z}),t(_e,[2,67]),t(_e,[2,69]),t(_e,[2,70]),t(_e,[2,71]),t(_e,[2,72]),t(_e,[2,73]),t(_e,[2,74]),t(_e,[2,75]),t(_e,[2,76]),t(_e,[2,77]),t(_e,[2,78]),t(E,[2,57],{76:me}),t(E,[2,58],{76:V}),{5:$e,28:105,31:Fe,34:ce,36:he,38:Te,40:ge},{27:[1,112],76:V},{5:He,40:we,56:113,57:Me,59:je},{27:[1,118],76:V},{33:119,89:S,90:k},{33:120,89:S,90:k},{75:z,78:121,79:82,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z},t(re,[2,61]),t(re,[2,63]),t(_e,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:$e,28:126,31:Fe,34:ce,36:he,38:Te,40:ge},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:He,40:we,56:130,57:Me,59:je},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(te,[2,66],{79:104,75:z,80:B,81:H,82:G,83:W,84:K,85:q,86:oe,87:Q,88:Z}),{33:132,89:S,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:$e,28:145,31:Fe,34:ce,36:he,38:Te,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:He,40:we,56:152,57:Me,59:je},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:$e,28:159,31:Fe,34:ce,36:he,38:Te,40:ge},{5:$e,28:160,31:Fe,34:ce,36:he,38:Te,40:ge},{5:$e,28:161,31:Fe,34:ce,36:he,38:Te,40:ge},{5:$e,28:162,31:Fe,34:ce,36:he,38:Te,40:ge},{5:He,40:we,56:163,57:Me,59:je},{5:He,40:we,56:164,57:Me,59:je},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:w(function(j,J){if(J.recoverable)this.trace(j);else{var ue=new Error(j);throw ue.hash=J,ue}},"parseError"),parse:w(function(j){var J=this,ue=[0],X=[],fe=[null],ee=[],Ae=this.table,Re="",Xe=0,Ne=0,qe=2,De=1,Ke=ee.slice.call(arguments,1),ze=Object.create(this.lexer),st={yy:{}};for(var Oe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Oe)&&(st.yy[Oe]=this.yy[Oe]);ze.setInput(j,st.yy),st.yy.lexer=ze,st.yy.parser=this,typeof ze.yylloc>"u"&&(ze.yylloc={});var mt=ze.yylloc;ee.push(mt);var Le=ze.options&&ze.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(Ee){ue.length=ue.length-2*Ee,fe.length=fe.length-Ee,ee.length=ee.length-Ee}w(St,"popStack");function At(){var Ee;return Ee=X.pop()||ze.lex()||De,typeof Ee!="number"&&(Ee instanceof Array&&(X=Ee,Ee=X.pop()),Ee=J.symbols_[Ee]||Ee),Ee}w(At,"lex");for(var lt,zt,It,ft,xe={},Nt,Tt,yt,Rt;;){if(zt=ue[ue.length-1],this.defaultActions[zt]?It=this.defaultActions[zt]:((lt===null||typeof lt>"u")&&(lt=At()),It=Ae[zt]&&Ae[zt][lt]),typeof It>"u"||!It.length||!It[0]){var Or="";Rt=[];for(Nt in Ae[zt])this.terminals_[Nt]&&Nt>qe&&Rt.push("'"+this.terminals_[Nt]+"'");ze.showPosition?Or="Parse error on line "+(Xe+1)+`: `+ze.showPosition()+` Expecting `+Rt.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Or="Parse error on line "+(Xe+1)+": Unexpected "+(lt==De?"end of input":"'"+(this.terminals_[lt]||lt)+"'"),this.parseError(Or,{text:ze.match,token:this.terminals_[lt]||lt,line:ze.yylineno,loc:mt,expected:Rt})}if(It[0]instanceof Array&&It.length>1)throw new Error("Parse Error: multiple actions possible at state: "+zt+", token: "+lt);switch(It[0]){case 1:ue.push(lt),fe.push(ze.yytext),ee.push(ze.yylloc),ue.push(It[1]),lt=null,Ne=ze.yyleng,Re=ze.yytext,Xe=ze.yylineno,mt=ze.yylloc;break;case 2:if(Tt=this.productions_[It[1]][1],xe.$=fe[fe.length-Tt],xe._$={first_line:ee[ee.length-(Tt||1)].first_line,last_line:ee[ee.length-1].last_line,first_column:ee[ee.length-(Tt||1)].first_column,last_column:ee[ee.length-1].last_column},Le&&(xe._$.range=[ee[ee.length-(Tt||1)].range[0],ee[ee.length-1].range[1]]),ft=this.performAction.apply(xe,[Re,Ne,Xe,st.yy,It[1],fe,ee].concat(Ke)),typeof ft<"u")return ft;Tt&&(ue=ue.slice(0,-1*Tt*2),fe=fe.slice(0,-1*Tt),ee=ee.slice(0,-1*Tt)),ue.push(this.productions_[It[1]][0]),fe.push(xe.$),ee.push(xe._$),yt=Ae[ue[ue.length-2]][ue[ue.length-1]],ue.push(yt);break;case 3:return!0}}return!0},"parse")},pe=(function(){var ne={EOF:1,parseError:w(function(J,ue){if(this.yy.parser)this.yy.parser.parseError(J,ue);else throw new Error(J)},"parseError"),setInput:w(function(j,J){return this.yy=J||this.yy||{},this._input=j,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 j=this._input[0];this.yytext+=j,this.yyleng++,this.offset++,this.match+=j,this.matched+=j;var J=j.match(/(?:\r\n?|\n).*/g);return J?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),j},"input"),unput:w(function(j){var J=j.length,ue=j.split(/(?:\r\n?|\n)/g);this._input=j+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-J),this.offset-=J;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),ue.length-1&&(this.yylineno-=ue.length-1);var fe=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:ue?(ue.length===X.length?this.yylloc.first_column:0)+X[X.length-ue.length].length-ue[0].length:this.yylloc.first_column-J},this.options.ranges&&(this.yylloc.range=[fe[0],fe[0]+this.yyleng-J]),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(j){this.unput(this.match.slice(j))},"less"),pastInput:w(function(){var j=this.matched.substr(0,this.matched.length-this.match.length);return(j.length>20?"...":"")+j.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var j=this.match;return j.length<20&&(j+=this._input.substr(0,20-j.length)),(j.substr(0,20)+(j.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var j=this.pastInput(),J=new Array(j.length+1).join("-");return j+this.upcomingInput()+` `+J+"^"},"showPosition"),test_match:w(function(j,J){var ue,X,fe;if(this.options.backtrack_lexer&&(fe={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&&(fe.yylloc.range=this.yylloc.range.slice(0))),X=j[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+j[0].length},this.yytext+=j[0],this.match+=j[0],this.matches=j,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(j[0].length),this.matched+=j[0],ue=this.performAction.call(this,this.yy,this,J,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ue)return ue;if(this._backtrack){for(var ee in fe)this[ee]=fe[ee];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var j,J,ue,X;this._more||(this.yytext="",this.match="");for(var fe=this._currentRules(),ee=0;eeJ[0].length)){if(J=ue,X=ee,this.options.backtrack_lexer){if(j=this.test_match(ue,fe[ee]),j!==!1)return j;if(this._backtrack){J=!1;continue}else return!1}else if(!this.options.flex)break}return J?(j=this.test_match(J,fe[X]),j!==!1?j:!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 J=this.next();return J||this.lex()},"lex"),begin:w(function(J){this.conditionStack.push(J)},"begin"),popState:w(function(){var J=this.conditionStack.length-1;return J>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(J){return J=this.conditionStack.length-1-Math.abs(J||0),J>=0?this.conditionStack[J]:"INITIAL"},"topState"),pushState:w(function(J){this.begin(J)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(J,ue,X,fe){switch(X){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 ue.yytext=ue.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 ne})();le.lexer=pe;function Ce(){this.yy={}}return w(Ce,"Parser"),Ce.prototype=le,le.Parser=Ce,new Ce})();cj.parser=cj;var qfr=cj,vT,Ufr=(vT=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Hi,this.getAccTitle=ts,this.setAccDescription=rs,this.getAccDescription=ns,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getConfig=w(()=>Ve().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),de.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,Ri()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const s of r)s.includes(",")?i.cssStyles.push(...s.split(",")):i.cssStyles.push(s)}}setClass(e,r){var n;for(const i of e){const s=this.requirements.get(i)??this.elements.get(i);if(s)for(const a of r){s.classes.push(a);const o=(n=this.classes.get(a))==null?void 0:n.styles;o&&s.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(s){if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)}),this.requirements.forEach(s=>{s.classes.includes(n)&&s.cssStyles.push(...r.flatMap(a=>a.split(",")))}),this.elements.forEach(s=>{s.classes.includes(n)&&s.cssStyles.push(...r.flatMap(a=>a.split(",")))})}}getClasses(){return this.classes}getData(){var i,s,a,o;const e=Ve(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((s=this.elements.get(l.src))==null?void 0:s.name),end:((a=this.requirements.get(l.dst))==null?void 0:a.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},w(vT,"RequirementDB"),vT),Yfr=w(t=>{const e=vr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:s}=r;if(!(s!=null&&s.length))return"";let a="";for(let o=0;o0?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(J){return J=this.conditionStack.length-1-Math.abs(J||0),J>=0?this.conditionStack[J]:"INITIAL"},"topState"),pushState:w(function(J){this.begin(J)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(J,ue,X,fe){switch(X){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 ue.yytext=ue.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 ne})();le.lexer=pe;function Ce(){this.yy={}}return w(Ce,"Parser"),Ce.prototype=le,le.Parser=Ce,new Ce})();fj.parser=fj;var o0r=fj,xT,l0r=(xT=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Hi,this.getAccTitle=ts,this.setAccDescription=rs,this.getAccDescription=ns,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getConfig=w(()=>Ve().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),de.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,Ri()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const s of r)s.includes(",")?i.cssStyles.push(...s.split(",")):i.cssStyles.push(s)}}setClass(e,r){var n;for(const i of e){const s=this.requirements.get(i)??this.elements.get(i);if(s)for(const a of r){s.classes.push(a);const o=(n=this.classes.get(a))==null?void 0:n.styles;o&&s.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(s){if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)}),this.requirements.forEach(s=>{s.classes.includes(n)&&s.cssStyles.push(...r.flatMap(a=>a.split(",")))}),this.elements.forEach(s=>{s.classes.includes(n)&&s.cssStyles.push(...r.flatMap(a=>a.split(",")))})}}getClasses(){return this.classes}getData(){var i,s,a,o;const e=Ve(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((s=this.elements.get(l.src))==null?void 0:s.name),end:((a=this.requirements.get(l.dst))==null?void 0:a.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},w(xT,"RequirementDB"),xT),c0r=w(t=>{const e=br(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:s}=r;if(!(s!=null&&s.length))return"";let a="";for(let o=0;o{const e=vr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${Yfr(t)} + `;return a},"genColor"),u0r=w(t=>{const e=br(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${c0r(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -4112,16 +4119,16 @@ Expecting `+Rt.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Or="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),Xfr=jfr,VWe={};ON(VWe,{draw:()=>Kfr});var Kfr=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:s,layout:a,look:o}=Ve(),l=n.db.getData(),u=S3(e,i);l.type=n.type,l.layoutAlgorithm=n7(a),l.nodeSpacing=(s==null?void 0:s.nodeSpacing)??50,l.rankSpacing=(s==null?void 0:s.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await o3(l,u);const h=8;Kr.insertTitle(u,"requirementDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),sv(u,h,"requirementDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),Zfr={parser:qfr,get db(){return new Ufr},renderer:VWe,styles:Xfr};const Qfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zfr},Symbol.toStringTag,{value:"Module"}));var uj=(function(){var t=w(function(Ne,qe,De,Ke){for(De=De||{},Ke=Ne.length;Ke--;De[Ne[Ke]]=qe);return De},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],s=[1,9],a=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],T=[1,32],C=[1,33],S=[1,34],k=[1,35],E=[1,36],A=[1,37],R=[1,38],_=[1,39],P=[1,40],N=[1,42],L=[1,43],I=[1,44],$=[1,45],O=[1,46],D=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],z=[1,74],V=[1,80],B=[1,81],H=[1,82],G=[1,83],W=[1,84],K=[1,85],q=[1,86],oe=[1,87],Q=[1,88],Z=[1,89],re=[1,90],ie=[1,91],me=[1,92],te=[1,93],_e=[1,94],$e=[1,95],Fe=[1,96],ce=[1,97],he=[1,98],Te=[1,99],ge=[1,100],He=[1,101],we=[1,102],Me=[1,103],je=[1,104],le=[1,105],pe=[2,78],Ce=[4,5,17,51,53,54],ne=[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],j=[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],J=[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],ue=[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],X=[5,52],fe=[70,71,72,73],ee=[1,151],Ae={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:w(function(qe,De,Ke,ze,st,Oe,mt){var Le=Oe.length-1;switch(st){case 3:return ze.apply(Oe[Le]),Oe[Le];case 4:case 10:this.$=[];break;case 5:case 11:Oe[Le-1].push(Oe[Le]),this.$=Oe[Le-1];break;case 6:case 7:case 12:case 13:this.$=Oe[Le];break;case 8:case 9:case 14:this.$=[];break;case 16:Oe[Le].type="createParticipant",this.$=Oe[Le];break;case 17:Oe[Le-1].unshift({type:"boxStart",boxData:ze.parseBoxData(Oe[Le-2])}),Oe[Le-1].push({type:"boxEnd",boxText:Oe[Le-2]}),this.$=Oe[Le-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Oe[Le-2]),sequenceIndexStep:Number(Oe[Le-1]),sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Oe[Le-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:ze.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:ze.LINETYPE.ACTIVE_START,actor:Oe[Le-1].actor};break;case 24:this.$={type:"activeEnd",signalType:ze.LINETYPE.ACTIVE_END,actor:Oe[Le-1].actor};break;case 30:ze.setDiagramTitle(Oe[Le].substring(6)),this.$=Oe[Le].substring(6);break;case 31:ze.setDiagramTitle(Oe[Le].substring(7)),this.$=Oe[Le].substring(7);break;case 32:this.$=Oe[Le].trim(),ze.setAccTitle(this.$);break;case 33:case 34:this.$=Oe[Le].trim(),ze.setAccDescription(this.$);break;case 35:Oe[Le-1].unshift({type:"loopStart",loopText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.LOOP_START}),Oe[Le-1].push({type:"loopEnd",loopText:Oe[Le-2],signalType:ze.LINETYPE.LOOP_END}),this.$=Oe[Le-1];break;case 36:Oe[Le-1].unshift({type:"rectStart",color:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.RECT_START}),Oe[Le-1].push({type:"rectEnd",color:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.RECT_END}),this.$=Oe[Le-1];break;case 37:Oe[Le-1].unshift({type:"optStart",optText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.OPT_START}),Oe[Le-1].push({type:"optEnd",optText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.OPT_END}),this.$=Oe[Le-1];break;case 38:Oe[Le-1].unshift({type:"altStart",altText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.ALT_START}),Oe[Le-1].push({type:"altEnd",signalType:ze.LINETYPE.ALT_END}),this.$=Oe[Le-1];break;case 39:Oe[Le-1].unshift({type:"parStart",parText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.PAR_START}),Oe[Le-1].push({type:"parEnd",signalType:ze.LINETYPE.PAR_END}),this.$=Oe[Le-1];break;case 40:Oe[Le-1].unshift({type:"parStart",parText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.PAR_OVER_START}),Oe[Le-1].push({type:"parEnd",signalType:ze.LINETYPE.PAR_END}),this.$=Oe[Le-1];break;case 41:Oe[Le-1].unshift({type:"criticalStart",criticalText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.CRITICAL_START}),Oe[Le-1].push({type:"criticalEnd",signalType:ze.LINETYPE.CRITICAL_END}),this.$=Oe[Le-1];break;case 42:Oe[Le-1].unshift({type:"breakStart",breakText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.BREAK_START}),Oe[Le-1].push({type:"breakEnd",optText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.BREAK_END}),this.$=Oe[Le-1];break;case 44:this.$=Oe[Le-3].concat([{type:"option",optionText:ze.parseMessage(Oe[Le-1]),signalType:ze.LINETYPE.CRITICAL_OPTION},Oe[Le]]);break;case 46:this.$=Oe[Le-3].concat([{type:"and",parText:ze.parseMessage(Oe[Le-1]),signalType:ze.LINETYPE.PAR_AND},Oe[Le]]);break;case 48:this.$=Oe[Le-3].concat([{type:"else",altText:ze.parseMessage(Oe[Le-1]),signalType:ze.LINETYPE.ALT_ELSE},Oe[Le]]);break;case 49:Oe[Le-3].draw="participant",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 50:Oe[Le-1].draw="participant",Oe[Le-1].type="addParticipant",this.$=Oe[Le-1];break;case 51:Oe[Le-3].draw="actor",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 52:case 57:Oe[Le-1].draw="actor",Oe[Le-1].type="addParticipant",this.$=Oe[Le-1];break;case 53:Oe[Le-1].type="destroyParticipant",this.$=Oe[Le-1];break;case 54:Oe[Le-3].draw="participant",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 55:Oe[Le-1].draw="participant",Oe[Le-1].type="addParticipant",this.$=Oe[Le-1];break;case 56:Oe[Le-3].draw="actor",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 58:this.$=[Oe[Le-1],{type:"addNote",placement:Oe[Le-2],actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 59:Oe[Le-2]=[].concat(Oe[Le-1],Oe[Le-1]).slice(0,2),Oe[Le-2][0]=Oe[Le-2][0].actor,Oe[Le-2][1]=Oe[Le-2][1].actor,this.$=[Oe[Le-1],{type:"addNote",placement:ze.PLACEMENT.OVER,actor:Oe[Le-2].slice(0,2),text:Oe[Le]}];break;case 60:this.$=[Oe[Le-1],{type:"addLinks",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 61:this.$=[Oe[Le-1],{type:"addALink",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 62:this.$=[Oe[Le-1],{type:"addProperties",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 63:this.$=[Oe[Le-1],{type:"addDetails",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 66:this.$=[Oe[Le-2],Oe[Le]];break;case 67:this.$=Oe[Le];break;case 68:this.$=ze.PLACEMENT.LEFTOF;break;case 69:this.$=ze.PLACEMENT.RIGHTOF;break;case 70:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le],activate:!0},{type:"activeStart",signalType:ze.LINETYPE.ACTIVE_START,actor:Oe[Le-1].actor}];break;case 71:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le]},{type:"activeEnd",signalType:ze.LINETYPE.ACTIVE_END,actor:Oe[Le-4].actor}];break;case 72:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le],activate:!0,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:ze.LINETYPE.CENTRAL_CONNECTION,actor:Oe[Le-1].actor}];break;case 73:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-2],msg:Oe[Le],activate:!1,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Oe[Le-4].actor}];break;case 74:this.$=[Oe[Le-5],Oe[Le-1],{type:"addMessage",from:Oe[Le-5].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le],activate:!0,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:ze.LINETYPE.CENTRAL_CONNECTION,actor:Oe[Le-1].actor},{type:"centralConnectionReverse",signalType:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Oe[Le-5].actor}];break;case 75:this.$=[Oe[Le-3],Oe[Le-1],{type:"addMessage",from:Oe[Le-3].actor,to:Oe[Le-1].actor,signalType:Oe[Le-2],msg:Oe[Le]}];break;case 76:this.$={type:"addParticipant",actor:Oe[Le-1],config:Oe[Le]};break;case 77:this.$=Oe[Le-1].trim();break;case 78:this.$={type:"addParticipant",actor:Oe[Le]};break;case 79:this.$=ze.LINETYPE.SOLID_OPEN;break;case 80:this.$=ze.LINETYPE.DOTTED_OPEN;break;case 81:this.$=ze.LINETYPE.SOLID;break;case 82:this.$=ze.LINETYPE.SOLID_TOP;break;case 83:this.$=ze.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=ze.LINETYPE.STICK_TOP;break;case 85:this.$=ze.LINETYPE.STICK_BOTTOM;break;case 86:this.$=ze.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=ze.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=ze.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=ze.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=ze.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=ze.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=ze.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=ze.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=ze.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=ze.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=ze.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=ze.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=ze.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=ze.LINETYPE.DOTTED;break;case 100:this.$=ze.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=ze.LINETYPE.SOLID_CROSS;break;case 102:this.$=ze.LINETYPE.DOTTED_CROSS;break;case 103:this.$=ze.LINETYPE.SOLID_POINT;break;case 104:this.$=ze.LINETYPE.DOTTED_POINT;break;case 105:this.$=ze.parseMessage(Oe[Le].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:R,53:_,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:D},{23:56,73:D},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:z},{23:75,55:76,73:z},{23:77,73:D},{69:78,72:[1,79],78:V,79:B,80:H,81:G,82:W,83:K,84:q,85:oe,86:Q,87:Z,88:re,89:ie,90:me,91:te,92:_e,93:$e,94:Fe,95:ce,96:he,97:Te,98:ge,99:He,100:we,101:Me,102:je,103:le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:D},{23:111,73:D},{23:112,73:D},{23:113,73:D},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],pe),t(F,[2,6]),t(F,[2,16]),t(Ce,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ne,i,{7:120}),t(ne,i,{7:121}),t(ne,i,{7:122}),t(j,i,{41:123,7:124}),t(J,i,{43:125,7:126}),t(J,i,{7:126,43:127}),t(ue,i,{46:128,7:129}),t(ne,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(X,pe,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:D},{69:146,78:V,79:B,80:H,81:G,82:W,83:K,84:q,85:oe,86:Q,87:Z,88:re,89:ie,90:me,91:te,92:_e,93:$e,94:Fe,95:ce,96:he,97:Te,98:ge,99:He,100:we,101:Me,102:je,103:le},t(fe,[2,79]),t(fe,[2,80]),t(fe,[2,81]),t(fe,[2,82]),t(fe,[2,83]),t(fe,[2,84]),t(fe,[2,85]),t(fe,[2,86]),t(fe,[2,87]),t(fe,[2,88]),t(fe,[2,89]),t(fe,[2,90]),t(fe,[2,91]),t(fe,[2,92]),t(fe,[2,93]),t(fe,[2,94]),t(fe,[2,95]),t(fe,[2,96]),t(fe,[2,97]),t(fe,[2,98]),t(fe,[2,99]),t(fe,[2,100]),t(fe,[2,101]),t(fe,[2,102]),t(fe,[2,103]),t(fe,[2,104]),{23:147,73:D},{23:149,60:148,73:D},{73:[2,68]},{73:[2,69]},{58:150,104:ee},{58:152,104:ee},{58:153,104:ee},{58:154,104:ee},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:R,53:_,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,164]},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,50:[1,165],51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,166]},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,49:[1,167],51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,168]},{17:[1,169]},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,48:[1,170],51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(X,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:D},{23:178,73:D},{23:179,73:D},{58:180,104:ee},{23:181,72:[1,182],73:D},{58:183,104:ee},{58:184,104:ee},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(Ce,[2,11]),{13:186,51:R,53:_,54:P},t(Ce,[2,13]),t(Ce,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ee},{58:196,104:ee},{58:197,104:ee},{5:[2,75]},{58:198,104:ee},{23:199,73:D},{5:[2,58]},{5:[2,59]},{23:200,73:D},t(Ce,[2,12]),t(j,i,{7:124,41:201}),t(J,i,{7:126,43:202}),t(ue,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(X,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ee},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:w(function(qe,De){if(De.recoverable)this.trace(qe);else{var Ke=new Error(qe);throw Ke.hash=De,Ke}},"parseError"),parse:w(function(qe){var De=this,Ke=[0],ze=[],st=[null],Oe=[],mt=this.table,Le="",St=0,At=0,lt=2,zt=1,It=Oe.slice.call(arguments,1),ft=Object.create(this.lexer),xe={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(xe.yy[Nt]=this.yy[Nt]);ft.setInput(qe,xe.yy),xe.yy.lexer=ft,xe.yy.parser=this,typeof ft.yylloc>"u"&&(ft.yylloc={});var Tt=ft.yylloc;Oe.push(Tt);var yt=ft.options&&ft.options.ranges;typeof xe.yy.parseError=="function"?this.parseError=xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Rt(Tr){Ke.length=Ke.length-2*Tr,st.length=st.length-Tr,Oe.length=Oe.length-Tr}w(Rt,"popStack");function Or(){var Tr;return Tr=ze.pop()||ft.lex()||zt,typeof Tr!="number"&&(Tr instanceof Array&&(ze=Tr,Tr=ze.pop()),Tr=De.symbols_[Tr]||Tr),Tr}w(Or,"lex");for(var Ee,it,gt,xt,nr={},$r,Cr,Ur,Er;;){if(it=Ke[Ke.length-1],this.defaultActions[it]?gt=this.defaultActions[it]:((Ee===null||typeof Ee>"u")&&(Ee=Or()),gt=mt[it]&&mt[it][Ee]),typeof gt>"u"||!gt.length||!gt[0]){var nn="";Er=[];for($r in mt[it])this.terminals_[$r]&&$r>lt&&Er.push("'"+this.terminals_[$r]+"'");ft.showPosition?nn="Parse error on line "+(St+1)+`: +`},"getStyles"),h0r=u0r,YWe={};BN(YWe,{draw:()=>d0r});var d0r=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:s,layout:a,look:o}=Ve(),l=n.db.getData(),u=M3(e,i);l.type=n.type,l.layoutAlgorithm=a7(a),l.nodeSpacing=(s==null?void 0:s.nodeSpacing)??50,l.rankSpacing=(s==null?void 0:s.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await u3(l,u);const h=8;Kr.insertTitle(u,"requirementDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),ov(u,h,"requirementDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),f0r={parser:o0r,get db(){return new l0r},renderer:YWe,styles:h0r};const p0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:f0r},Symbol.toStringTag,{value:"Module"}));var pj=(function(){var t=w(function(Ne,qe,De,Ke){for(De=De||{},Ke=Ne.length;Ke--;De[Ne[Ke]]=qe);return De},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],s=[1,9],a=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],x=[1,30],b=[1,31],T=[1,32],C=[1,33],S=[1,34],k=[1,35],E=[1,36],A=[1,37],R=[1,38],_=[1,39],P=[1,40],N=[1,42],L=[1,43],I=[1,44],$=[1,45],O=[1,46],D=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],z=[1,74],V=[1,80],B=[1,81],H=[1,82],G=[1,83],W=[1,84],K=[1,85],q=[1,86],oe=[1,87],Q=[1,88],Z=[1,89],re=[1,90],ie=[1,91],me=[1,92],te=[1,93],_e=[1,94],$e=[1,95],Fe=[1,96],ce=[1,97],he=[1,98],Te=[1,99],ge=[1,100],He=[1,101],we=[1,102],Me=[1,103],je=[1,104],le=[1,105],pe=[2,78],Ce=[4,5,17,51,53,54],ne=[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],j=[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],J=[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],ue=[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],X=[5,52],fe=[70,71,72,73],ee=[1,151],Ae={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:w(function(qe,De,Ke,ze,st,Oe,mt){var Le=Oe.length-1;switch(st){case 3:return ze.apply(Oe[Le]),Oe[Le];case 4:case 10:this.$=[];break;case 5:case 11:Oe[Le-1].push(Oe[Le]),this.$=Oe[Le-1];break;case 6:case 7:case 12:case 13:this.$=Oe[Le];break;case 8:case 9:case 14:this.$=[];break;case 16:Oe[Le].type="createParticipant",this.$=Oe[Le];break;case 17:Oe[Le-1].unshift({type:"boxStart",boxData:ze.parseBoxData(Oe[Le-2])}),Oe[Le-1].push({type:"boxEnd",boxText:Oe[Le-2]}),this.$=Oe[Le-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Oe[Le-2]),sequenceIndexStep:Number(Oe[Le-1]),sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Oe[Le-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:ze.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:ze.LINETYPE.ACTIVE_START,actor:Oe[Le-1].actor};break;case 24:this.$={type:"activeEnd",signalType:ze.LINETYPE.ACTIVE_END,actor:Oe[Le-1].actor};break;case 30:ze.setDiagramTitle(Oe[Le].substring(6)),this.$=Oe[Le].substring(6);break;case 31:ze.setDiagramTitle(Oe[Le].substring(7)),this.$=Oe[Le].substring(7);break;case 32:this.$=Oe[Le].trim(),ze.setAccTitle(this.$);break;case 33:case 34:this.$=Oe[Le].trim(),ze.setAccDescription(this.$);break;case 35:Oe[Le-1].unshift({type:"loopStart",loopText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.LOOP_START}),Oe[Le-1].push({type:"loopEnd",loopText:Oe[Le-2],signalType:ze.LINETYPE.LOOP_END}),this.$=Oe[Le-1];break;case 36:Oe[Le-1].unshift({type:"rectStart",color:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.RECT_START}),Oe[Le-1].push({type:"rectEnd",color:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.RECT_END}),this.$=Oe[Le-1];break;case 37:Oe[Le-1].unshift({type:"optStart",optText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.OPT_START}),Oe[Le-1].push({type:"optEnd",optText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.OPT_END}),this.$=Oe[Le-1];break;case 38:Oe[Le-1].unshift({type:"altStart",altText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.ALT_START}),Oe[Le-1].push({type:"altEnd",signalType:ze.LINETYPE.ALT_END}),this.$=Oe[Le-1];break;case 39:Oe[Le-1].unshift({type:"parStart",parText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.PAR_START}),Oe[Le-1].push({type:"parEnd",signalType:ze.LINETYPE.PAR_END}),this.$=Oe[Le-1];break;case 40:Oe[Le-1].unshift({type:"parStart",parText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.PAR_OVER_START}),Oe[Le-1].push({type:"parEnd",signalType:ze.LINETYPE.PAR_END}),this.$=Oe[Le-1];break;case 41:Oe[Le-1].unshift({type:"criticalStart",criticalText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.CRITICAL_START}),Oe[Le-1].push({type:"criticalEnd",signalType:ze.LINETYPE.CRITICAL_END}),this.$=Oe[Le-1];break;case 42:Oe[Le-1].unshift({type:"breakStart",breakText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.BREAK_START}),Oe[Le-1].push({type:"breakEnd",optText:ze.parseMessage(Oe[Le-2]),signalType:ze.LINETYPE.BREAK_END}),this.$=Oe[Le-1];break;case 44:this.$=Oe[Le-3].concat([{type:"option",optionText:ze.parseMessage(Oe[Le-1]),signalType:ze.LINETYPE.CRITICAL_OPTION},Oe[Le]]);break;case 46:this.$=Oe[Le-3].concat([{type:"and",parText:ze.parseMessage(Oe[Le-1]),signalType:ze.LINETYPE.PAR_AND},Oe[Le]]);break;case 48:this.$=Oe[Le-3].concat([{type:"else",altText:ze.parseMessage(Oe[Le-1]),signalType:ze.LINETYPE.ALT_ELSE},Oe[Le]]);break;case 49:Oe[Le-3].draw="participant",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 50:Oe[Le-1].draw="participant",Oe[Le-1].type="addParticipant",this.$=Oe[Le-1];break;case 51:Oe[Le-3].draw="actor",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 52:case 57:Oe[Le-1].draw="actor",Oe[Le-1].type="addParticipant",this.$=Oe[Le-1];break;case 53:Oe[Le-1].type="destroyParticipant",this.$=Oe[Le-1];break;case 54:Oe[Le-3].draw="participant",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 55:Oe[Le-1].draw="participant",Oe[Le-1].type="addParticipant",this.$=Oe[Le-1];break;case 56:Oe[Le-3].draw="actor",Oe[Le-3].type="addParticipant",Oe[Le-3].description=ze.parseMessage(Oe[Le-1]),this.$=Oe[Le-3];break;case 58:this.$=[Oe[Le-1],{type:"addNote",placement:Oe[Le-2],actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 59:Oe[Le-2]=[].concat(Oe[Le-1],Oe[Le-1]).slice(0,2),Oe[Le-2][0]=Oe[Le-2][0].actor,Oe[Le-2][1]=Oe[Le-2][1].actor,this.$=[Oe[Le-1],{type:"addNote",placement:ze.PLACEMENT.OVER,actor:Oe[Le-2].slice(0,2),text:Oe[Le]}];break;case 60:this.$=[Oe[Le-1],{type:"addLinks",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 61:this.$=[Oe[Le-1],{type:"addALink",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 62:this.$=[Oe[Le-1],{type:"addProperties",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 63:this.$=[Oe[Le-1],{type:"addDetails",actor:Oe[Le-1].actor,text:Oe[Le]}];break;case 66:this.$=[Oe[Le-2],Oe[Le]];break;case 67:this.$=Oe[Le];break;case 68:this.$=ze.PLACEMENT.LEFTOF;break;case 69:this.$=ze.PLACEMENT.RIGHTOF;break;case 70:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le],activate:!0},{type:"activeStart",signalType:ze.LINETYPE.ACTIVE_START,actor:Oe[Le-1].actor}];break;case 71:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le]},{type:"activeEnd",signalType:ze.LINETYPE.ACTIVE_END,actor:Oe[Le-4].actor}];break;case 72:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le],activate:!0,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:ze.LINETYPE.CENTRAL_CONNECTION,actor:Oe[Le-1].actor}];break;case 73:this.$=[Oe[Le-4],Oe[Le-1],{type:"addMessage",from:Oe[Le-4].actor,to:Oe[Le-1].actor,signalType:Oe[Le-2],msg:Oe[Le],activate:!1,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Oe[Le-4].actor}];break;case 74:this.$=[Oe[Le-5],Oe[Le-1],{type:"addMessage",from:Oe[Le-5].actor,to:Oe[Le-1].actor,signalType:Oe[Le-3],msg:Oe[Le],activate:!0,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:ze.LINETYPE.CENTRAL_CONNECTION,actor:Oe[Le-1].actor},{type:"centralConnectionReverse",signalType:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Oe[Le-5].actor}];break;case 75:this.$=[Oe[Le-3],Oe[Le-1],{type:"addMessage",from:Oe[Le-3].actor,to:Oe[Le-1].actor,signalType:Oe[Le-2],msg:Oe[Le]}];break;case 76:this.$={type:"addParticipant",actor:Oe[Le-1],config:Oe[Le]};break;case 77:this.$=Oe[Le-1].trim();break;case 78:this.$={type:"addParticipant",actor:Oe[Le]};break;case 79:this.$=ze.LINETYPE.SOLID_OPEN;break;case 80:this.$=ze.LINETYPE.DOTTED_OPEN;break;case 81:this.$=ze.LINETYPE.SOLID;break;case 82:this.$=ze.LINETYPE.SOLID_TOP;break;case 83:this.$=ze.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=ze.LINETYPE.STICK_TOP;break;case 85:this.$=ze.LINETYPE.STICK_BOTTOM;break;case 86:this.$=ze.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=ze.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=ze.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=ze.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=ze.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=ze.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=ze.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=ze.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=ze.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=ze.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=ze.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=ze.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=ze.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=ze.LINETYPE.DOTTED;break;case 100:this.$=ze.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=ze.LINETYPE.SOLID_CROSS;break;case 102:this.$=ze.LINETYPE.DOTTED_CROSS;break;case 103:this.$=ze.LINETYPE.SOLID_POINT;break;case 104:this.$=ze.LINETYPE.DOTTED_POINT;break;case 105:this.$=ze.parseMessage(Oe[Le].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:R,53:_,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:D},{23:56,73:D},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:z},{23:75,55:76,73:z},{23:77,73:D},{69:78,72:[1,79],78:V,79:B,80:H,81:G,82:W,83:K,84:q,85:oe,86:Q,87:Z,88:re,89:ie,90:me,91:te,92:_e,93:$e,94:Fe,95:ce,96:he,97:Te,98:ge,99:He,100:we,101:Me,102:je,103:le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:D},{23:111,73:D},{23:112,73:D},{23:113,73:D},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],pe),t(F,[2,6]),t(F,[2,16]),t(Ce,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ne,i,{7:120}),t(ne,i,{7:121}),t(ne,i,{7:122}),t(j,i,{41:123,7:124}),t(J,i,{43:125,7:126}),t(J,i,{7:126,43:127}),t(ue,i,{46:128,7:129}),t(ne,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(X,pe,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:D},{69:146,78:V,79:B,80:H,81:G,82:W,83:K,84:q,85:oe,86:Q,87:Z,88:re,89:ie,90:me,91:te,92:_e,93:$e,94:Fe,95:ce,96:he,97:Te,98:ge,99:He,100:we,101:Me,102:je,103:le},t(fe,[2,79]),t(fe,[2,80]),t(fe,[2,81]),t(fe,[2,82]),t(fe,[2,83]),t(fe,[2,84]),t(fe,[2,85]),t(fe,[2,86]),t(fe,[2,87]),t(fe,[2,88]),t(fe,[2,89]),t(fe,[2,90]),t(fe,[2,91]),t(fe,[2,92]),t(fe,[2,93]),t(fe,[2,94]),t(fe,[2,95]),t(fe,[2,96]),t(fe,[2,97]),t(fe,[2,98]),t(fe,[2,99]),t(fe,[2,100]),t(fe,[2,101]),t(fe,[2,102]),t(fe,[2,103]),t(fe,[2,104]),{23:147,73:D},{23:149,60:148,73:D},{73:[2,68]},{73:[2,69]},{58:150,104:ee},{58:152,104:ee},{58:153,104:ee},{58:154,104:ee},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:R,53:_,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,164]},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,50:[1,165],51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,166]},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,49:[1,167],51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,168]},{17:[1,169]},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,48:[1,170],51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:x,38:b,39:T,40:C,42:S,44:k,45:E,47:A,51:R,53:_,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(X,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:D},{23:178,73:D},{23:179,73:D},{58:180,104:ee},{23:181,72:[1,182],73:D},{58:183,104:ee},{58:184,104:ee},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(Ce,[2,11]),{13:186,51:R,53:_,54:P},t(Ce,[2,13]),t(Ce,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ee},{58:196,104:ee},{58:197,104:ee},{5:[2,75]},{58:198,104:ee},{23:199,73:D},{5:[2,58]},{5:[2,59]},{23:200,73:D},t(Ce,[2,12]),t(j,i,{7:124,41:201}),t(J,i,{7:126,43:202}),t(ue,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(X,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ee},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:w(function(qe,De){if(De.recoverable)this.trace(qe);else{var Ke=new Error(qe);throw Ke.hash=De,Ke}},"parseError"),parse:w(function(qe){var De=this,Ke=[0],ze=[],st=[null],Oe=[],mt=this.table,Le="",St=0,At=0,lt=2,zt=1,It=Oe.slice.call(arguments,1),ft=Object.create(this.lexer),xe={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(xe.yy[Nt]=this.yy[Nt]);ft.setInput(qe,xe.yy),xe.yy.lexer=ft,xe.yy.parser=this,typeof ft.yylloc>"u"&&(ft.yylloc={});var Tt=ft.yylloc;Oe.push(Tt);var yt=ft.options&&ft.options.ranges;typeof xe.yy.parseError=="function"?this.parseError=xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Rt(Cr){Ke.length=Ke.length-2*Cr,st.length=st.length-Cr,Oe.length=Oe.length-Cr}w(Rt,"popStack");function Or(){var Cr;return Cr=ze.pop()||ft.lex()||zt,typeof Cr!="number"&&(Cr instanceof Array&&(ze=Cr,Cr=ze.pop()),Cr=De.symbols_[Cr]||Cr),Cr}w(Or,"lex");for(var Ee,it,gt,xt,nr={},$r,kr,Ur,Er;;){if(it=Ke[Ke.length-1],this.defaultActions[it]?gt=this.defaultActions[it]:((Ee===null||typeof Ee>"u")&&(Ee=Or()),gt=mt[it]&&mt[it][Ee]),typeof gt>"u"||!gt.length||!gt[0]){var nn="";Er=[];for($r in mt[it])this.terminals_[$r]&&$r>lt&&Er.push("'"+this.terminals_[$r]+"'");ft.showPosition?nn="Parse error on line "+(St+1)+`: `+ft.showPosition()+` -Expecting `+Er.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":nn="Parse error on line "+(St+1)+": Unexpected "+(Ee==zt?"end of input":"'"+(this.terminals_[Ee]||Ee)+"'"),this.parseError(nn,{text:ft.match,token:this.terminals_[Ee]||Ee,line:ft.yylineno,loc:Tt,expected:Er})}if(gt[0]instanceof Array&>.length>1)throw new Error("Parse Error: multiple actions possible at state: "+it+", token: "+Ee);switch(gt[0]){case 1:Ke.push(Ee),st.push(ft.yytext),Oe.push(ft.yylloc),Ke.push(gt[1]),Ee=null,At=ft.yyleng,Le=ft.yytext,St=ft.yylineno,Tt=ft.yylloc;break;case 2:if(Cr=this.productions_[gt[1]][1],nr.$=st[st.length-Cr],nr._$={first_line:Oe[Oe.length-(Cr||1)].first_line,last_line:Oe[Oe.length-1].last_line,first_column:Oe[Oe.length-(Cr||1)].first_column,last_column:Oe[Oe.length-1].last_column},yt&&(nr._$.range=[Oe[Oe.length-(Cr||1)].range[0],Oe[Oe.length-1].range[1]]),xt=this.performAction.apply(nr,[Le,At,St,xe.yy,gt[1],st,Oe].concat(It)),typeof xt<"u")return xt;Cr&&(Ke=Ke.slice(0,-1*Cr*2),st=st.slice(0,-1*Cr),Oe=Oe.slice(0,-1*Cr)),Ke.push(this.productions_[gt[1]][0]),st.push(nr.$),Oe.push(nr._$),Ur=mt[Ke[Ke.length-2]][Ke[Ke.length-1]],Ke.push(Ur);break;case 3:return!0}}return!0},"parse")},Re=(function(){var Ne={EOF:1,parseError:w(function(De,Ke){if(this.yy.parser)this.yy.parser.parseError(De,Ke);else throw new Error(De)},"parseError"),setInput:w(function(qe,De){return this.yy=De||this.yy||{},this._input=qe,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 qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var De=qe.match(/(?:\r\n?|\n).*/g);return De?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:w(function(qe){var De=qe.length,Ke=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-De),this.offset-=De;var ze=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),Ke.length-1&&(this.yylineno-=Ke.length-1);var st=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:Ke?(Ke.length===ze.length?this.yylloc.first_column:0)+ze[ze.length-Ke.length].length-Ke[0].length:this.yylloc.first_column-De},this.options.ranges&&(this.yylloc.range=[st[0],st[0]+this.yyleng-De]),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). +Expecting `+Er.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":nn="Parse error on line "+(St+1)+": Unexpected "+(Ee==zt?"end of input":"'"+(this.terminals_[Ee]||Ee)+"'"),this.parseError(nn,{text:ft.match,token:this.terminals_[Ee]||Ee,line:ft.yylineno,loc:Tt,expected:Er})}if(gt[0]instanceof Array&>.length>1)throw new Error("Parse Error: multiple actions possible at state: "+it+", token: "+Ee);switch(gt[0]){case 1:Ke.push(Ee),st.push(ft.yytext),Oe.push(ft.yylloc),Ke.push(gt[1]),Ee=null,At=ft.yyleng,Le=ft.yytext,St=ft.yylineno,Tt=ft.yylloc;break;case 2:if(kr=this.productions_[gt[1]][1],nr.$=st[st.length-kr],nr._$={first_line:Oe[Oe.length-(kr||1)].first_line,last_line:Oe[Oe.length-1].last_line,first_column:Oe[Oe.length-(kr||1)].first_column,last_column:Oe[Oe.length-1].last_column},yt&&(nr._$.range=[Oe[Oe.length-(kr||1)].range[0],Oe[Oe.length-1].range[1]]),xt=this.performAction.apply(nr,[Le,At,St,xe.yy,gt[1],st,Oe].concat(It)),typeof xt<"u")return xt;kr&&(Ke=Ke.slice(0,-1*kr*2),st=st.slice(0,-1*kr),Oe=Oe.slice(0,-1*kr)),Ke.push(this.productions_[gt[1]][0]),st.push(nr.$),Oe.push(nr._$),Ur=mt[Ke[Ke.length-2]][Ke[Ke.length-1]],Ke.push(Ur);break;case 3:return!0}}return!0},"parse")},Re=(function(){var Ne={EOF:1,parseError:w(function(De,Ke){if(this.yy.parser)this.yy.parser.parseError(De,Ke);else throw new Error(De)},"parseError"),setInput:w(function(qe,De){return this.yy=De||this.yy||{},this._input=qe,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 qe=this._input[0];this.yytext+=qe,this.yyleng++,this.offset++,this.match+=qe,this.matched+=qe;var De=qe.match(/(?:\r\n?|\n).*/g);return De?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),qe},"input"),unput:w(function(qe){var De=qe.length,Ke=qe.split(/(?:\r\n?|\n)/g);this._input=qe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-De),this.offset-=De;var ze=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),Ke.length-1&&(this.yylineno-=Ke.length-1);var st=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:Ke?(Ke.length===ze.length?this.yylloc.first_column:0)+ze[ze.length-Ke.length].length-Ke[0].length:this.yylloc.first_column-De},this.options.ranges&&(this.yylloc.range=[st[0],st[0]+this.yyleng-De]),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(qe){this.unput(this.match.slice(qe))},"less"),pastInput:w(function(){var qe=this.matched.substr(0,this.matched.length-this.match.length);return(qe.length>20?"...":"")+qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var qe=this.match;return qe.length<20&&(qe+=this._input.substr(0,20-qe.length)),(qe.substr(0,20)+(qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var qe=this.pastInput(),De=new Array(qe.length+1).join("-");return qe+this.upcomingInput()+` `+De+"^"},"showPosition"),test_match:w(function(qe,De){var Ke,ze,st;if(this.options.backtrack_lexer&&(st={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&&(st.yylloc.range=this.yylloc.range.slice(0))),ze=qe[0].match(/(?:\r\n?|\n).*/g),ze&&(this.yylineno+=ze.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ze?ze[ze.length-1].length-ze[ze.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+qe[0].length},this.yytext+=qe[0],this.match+=qe[0],this.matches=qe,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(qe[0].length),this.matched+=qe[0],Ke=this.performAction.call(this,this.yy,this,De,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ke)return Ke;if(this._backtrack){for(var Oe in st)this[Oe]=st[Oe];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var qe,De,Ke,ze;this._more||(this.yytext="",this.match="");for(var st=this._currentRules(),Oe=0;OeDe[0].length)){if(De=Ke,ze=Oe,this.options.backtrack_lexer){if(qe=this.test_match(Ke,st[Oe]),qe!==!1)return qe;if(this._backtrack){De=!1;continue}else return!1}else if(!this.options.flex)break}return De?(qe=this.test_match(De,st[ze]),qe!==!1?qe:!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 De=this.next();return De||this.lex()},"lex"),begin:w(function(De){this.conditionStack.push(De)},"begin"),popState:w(function(){var De=this.conditionStack.length-1;return De>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(De){return De=this.conditionStack.length-1-Math.abs(De||0),De>=0?this.conditionStack[De]:"INITIAL"},"topState"),pushState:w(function(De){this.begin(De)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(De,Ke,ze,st){switch(ze){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 Ke.yytext=Ke.yytext.trim(),73;case 12:return Ke.yytext=Ke.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ke.yytext=Ke.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ke.yytext=Ke.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 Ke.yytext=Ke.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return Ne})();Ae.lexer=Re;function Xe(){this.yy={}}return w(Xe,"Parser"),Xe.prototype=Ae,Ae.Parser=Xe,new Xe})();uj.parser=uj;var Jfr=uj,e0r={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},t0r={FILLED:0,OPEN:1},r0r={LEFTOF:0,RIGHTOF:1,OVER:2},rM={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},bT,n0r=(bT=class{constructor(){this.state=new mee(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Hi,this.setAccDescription=rs,this.setDiagramTitle=Ji,this.getAccTitle=ts,this.getAccDescription=ns,this.getDiagramTitle=qi,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Ve().wrap),this.LINETYPE=e0r,this.ARROWTYPE=t0r,this.PLACEMENT=r0r}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,s){let a=this.state.records.currentBox,o;if(s!==void 0){let u;s.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var De=this.next();return De||this.lex()},"lex"),begin:w(function(De){this.conditionStack.push(De)},"begin"),popState:w(function(){var De=this.conditionStack.length-1;return De>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(De){return De=this.conditionStack.length-1-Math.abs(De||0),De>=0?this.conditionStack[De]:"INITIAL"},"topState"),pushState:w(function(De){this.begin(De)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(De,Ke,ze,st){switch(ze){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 Ke.yytext=Ke.yytext.trim(),73;case 12:return Ke.yytext=Ke.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ke.yytext=Ke.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ke.yytext=Ke.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 Ke.yytext=Ke.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return Ne})();Ae.lexer=Re;function Xe(){this.yy={}}return w(Xe,"Parser"),Xe.prototype=Ae,Ae.Parser=Xe,new Xe})();pj.parser=pj;var g0r=pj,m0r={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},y0r={FILLED:0,OPEN:1},v0r={LEFTOF:0,RIGHTOF:1,OVER:2},aM={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},wT,b0r=(wT=class{constructor(){this.state=new xee(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Hi,this.setAccDescription=rs,this.setDiagramTitle=Ji,this.getAccTitle=ts,this.getAccDescription=ns,this.getDiagramTitle=qi,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Ve().wrap),this.LINETYPE=m0r,this.ARROWTYPE=y0r,this.PLACEMENT=v0r}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,s){let a=this.state.records.currentBox,o;if(s!==void 0){let u;s.includes(` `)?u=s+` `:u=`{ `+s+` -}`,o=KN(u,{schema:XN})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=l.box?l.box:this.state.records.currentBox,l.box=a,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:a,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:s,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Ve().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Ri()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),s={text:i,wrap:n};return de.debug(`parseMessage: ${JSON.stringify(s)}`),s}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:s,cleanedText:a}=this.extractWrap(i);return{text:a?Ln(a,Ve()):void 0,color:n,wrap:s}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},s=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Ln(r.text,Ve());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const s=JSON.parse(i);this.insertLinks(n,s)}catch(i){de.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let s=Ln(r.text,Ve());const a=s.indexOf("@");s=s.replace(/=/g,"="),s=s.replace(/&/g,"&");const o=s.slice(0,a-1).trim(),l=s.slice(a+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){de.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Ln(r.text,Ve()),s=JSON.parse(i);this.insertProperties(n,s)}catch(i){de.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const s=i.innerHTML,a=JSON.parse(s);a.properties&&this.insertProperties(n,a.properties),a.links&&this.insertLinks(n,a.links)}catch(s){de.error("error while parsing actor details text",s)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Hi(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Ve().sequence}},w(bT,"SequenceDB"),bT),i0r=w(t=>{const e=t.dropShadow??"none",{look:r}=Ve();return`.actor { +}`,o=JN(u,{schema:QN})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=l.box?l.box:this.state.records.currentBox,l.box=a,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:a,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:s,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Ve().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Ri()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),s={text:i,wrap:n};return de.debug(`parseMessage: ${JSON.stringify(s)}`),s}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:s,cleanedText:a}=this.extractWrap(i);return{text:a?Ln(a,Ve()):void 0,color:n,wrap:s}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},s=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Ln(r.text,Ve());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const s=JSON.parse(i);this.insertLinks(n,s)}catch(i){de.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let s=Ln(r.text,Ve());const a=s.indexOf("@");s=s.replace(/=/g,"="),s=s.replace(/&/g,"&");const o=s.slice(0,a-1).trim(),l=s.slice(a+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){de.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Ln(r.text,Ve()),s=JSON.parse(i);this.insertProperties(n,s)}catch(i){de.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const s=i.innerHTML,a=JSON.parse(s);a.properties&&this.insertProperties(n,a.properties),a.links&&this.insertLinks(n,a.links)}catch(s){de.error("error while parsing actor details text",s)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Hi(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Ve().sequence}},w(wT,"SequenceDB"),wT),x0r=w(t=>{const e=t.dropShadow??"none",{look:r}=Ve();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -4260,25 +4267,25 @@ Expecting `+Er.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":nn="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),s0r=i0r,G1=36,dm="actor-top",fm="actor-bottom",EP="actor-box",By="actor-man",Q0=new Set(["redux-color","redux-dark-color"]),mE=w(function(t,e){const r=hO(t,e);return vr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),a0r=w(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const s=e.links,a=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+a+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),s!=null){var p=20;for(let y in s){var g=u.append("a"),m=Xy.sanitizeUrl(s[y]);g.attr("xlink:href",m),g.attr("target","_blank"),R0r(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),AP=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),FI=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await BN(e.text,vr()),a=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",a.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-a.width/2)).attr("y",Math.round(l.y+l.height/2-a.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-a.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-a.height))}return[n]},"drawKatex"),V5=w(function(t,e){let r=0,n=0;const i=e.text.split(Vt.lineBreakRegex),[s,a]=B0(e.fontSize);let o=[],l=0,u=w(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=w(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=w(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=w(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&s!==void 0&&(l=h*s);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),a!==void 0&&f.style("font-size",a),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||LCe;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),HWe=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+o)}w(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,V5(t,e),n},"drawLabel"),Pn=-1,GWe=w((t,e,r,n)=>{t.select&&r.forEach(i=>{const s=e.get(i),a=t.select("#actor"+s.actorCnt);!n.mirrorActors&&s.stopy?a.attr("y2",s.stopy+s.height/2):n.mirrorActors&&a.attr("y2",s.stopy)})},"fixLifeLineHeights"),o0r=w(function(t,e,r,n,i){var T,C;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AP(`actor${Pn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Pn,e.links!=null&&g.attr("id","root-"+Pn),l==="neo"&&g.attr("data-look","neo"));const m=jc();var y="actor";(T=e.properties)!=null&&T.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${fm}`:y+=` ${dm}`,m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=mE(g,m),x=i.get(e.name)??0;if(Q0.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?oee(g,m.x+m.width-20,m.y+10,S.substr(1)):aee(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),J0(r,Ks(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${EP}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),l0r=w(function(t,e,r,n,i){var k,E;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AP(`actor${Pn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Pn,e.links!=null&&g.attr("id","root-"+Pn),l==="neo"&&g.attr("data-look","neo"));const m=jc();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${fm}`:y+=` ${dm}`,m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=mE(g,m),T=mE(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(Q0.has(u)&&(b.style("stroke",f[C%f.length]),b.style("fill",d[C%f.length]),T.style("stroke",f[C%f.length]),T.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?oee(g,m.x+m.width-20,m.y+10,A.substr(1)):aee(g,m.x+m.width-20,m.y+10,A)}J0(r,Ks(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${EP}`},r);let S=e.height;if(b.node){const A=b.node().getBBox();e.height=A.height,S=A.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),c0r=w(function(t,e,r,n,i){var A,R;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AP(`actor${Pn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Pn,e.links!=null&&g.attr("id","root-"+Pn),l==="neo"&&g.attr("data-look","neo"));const m=jc();let y="actor";(A=e.properties)!=null&&A.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${fm}`:y+=` ${dm}`,g.attr("class",y),m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,x=v/(2.5+m.height/50),b=g.append("g"),T=g.append("g"),C=`M ${m.x},${m.y+v} +`},"getStyles"),w0r=x0r,q1=36,gm="actor-top",mm="actor-bottom",RP="actor-box",zy="actor-man",rp=new Set(["redux-color","redux-dark-color"]),bE=w(function(t,e){const r=pO(t,e);return br().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),T0r=w(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const s=e.links,a=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+a+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),s!=null){var p=20;for(let y in s){var g=u.append("a"),m=Zy.sanitizeUrl(s[y]);g.attr("xlink:href",m),g.attr("target","_blank"),q0r(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),_P=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),HI=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await VN(e.text,br()),a=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",a.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-a.width/2)).attr("y",Math.round(l.y+l.height/2-a.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-a.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-a.height))}return[n]},"drawKatex"),W5=w(function(t,e){let r=0,n=0;const i=e.text.split(Vt.lineBreakRegex),[s,a]=H0(e.fontSize);let o=[],l=0,u=w(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=w(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=w(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=w(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&s!==void 0&&(l=h*s);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),a!==void 0&&f.style("font-size",a),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||$Ce;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),jWe=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+o)}w(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,W5(t,e),n},"drawLabel"),Pn=-1,XWe=w((t,e,r,n)=>{t.select&&r.forEach(i=>{const s=e.get(i),a=t.select("#actor"+s.actorCnt);!n.mirrorActors&&s.stopy?a.attr("y2",s.stopy+s.height/2):n.mirrorActors&&a.attr("y2",s.stopy)})},"fixLifeLineHeights"),C0r=w(function(t,e,r,n,i){var T,C;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_P(`actor${Pn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Pn,e.links!=null&&g.attr("id","root-"+Pn),l==="neo"&&g.attr("data-look","neo"));const m=Zc();var y="actor";(T=e.properties)!=null&&T.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${mm}`:y+=` ${gm}`,m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=bE(g,m),x=i.get(e.name)??0;if(rp.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?hee(g,m.x+m.width-20,m.y+10,S.substr(1)):uee(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),np(r,Ks(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${RP}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),k0r=w(function(t,e,r,n,i){var k,E;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_P(`actor${Pn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Pn,e.links!=null&&g.attr("id","root-"+Pn),l==="neo"&&g.attr("data-look","neo"));const m=Zc();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${mm}`:y+=` ${gm}`,m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=bE(g,m),T=bE(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(rp.has(u)&&(b.style("stroke",f[C%f.length]),b.style("fill",d[C%f.length]),T.style("stroke",f[C%f.length]),T.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?hee(g,m.x+m.width-20,m.y+10,A.substr(1)):uee(g,m.x+m.width-20,m.y+10,A)}np(r,Ks(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${RP}`},r);let S=e.height;if(b.node){const A=b.node().getBBox();e.height=A.height,S=A.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),S0r=w(function(t,e,r,n,i){var A,R;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_P(`actor${Pn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Pn,e.links!=null&&g.attr("id","root-"+Pn),l==="neo"&&g.attr("data-look","neo"));const m=Zc();let y="actor";(A=e.properties)!=null&&A.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${mm}`:y+=` ${gm}`,g.attr("class",y),m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,x=v/(2.5+m.height/50),b=g.append("g"),T=g.append("g"),C=`M ${m.x},${m.y+v} a ${x},${v} 0 0 0 0,${m.height} h ${m.width-2*x} a ${x},${v} 0 0 0 0,-${m.height} Z `;b.append("path").attr("d",C),T.append("path").attr("d",`M ${m.x},${m.y+v} - a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),T.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(Q0.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),T.style("stroke",f[S%f.length]),T.style("fill",d[S%f.length])),(R=e.properties)!=null&&R.icon){const _=e.properties.icon.trim(),P=m.x+m.width-20,N=m.y+10;_.charAt(0)==="@"?oee(g,P,N,_.substr(1)):aee(g,P,N,_)}J0(r,Ks(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${EP}`},r);let k=e.height;const E=b.select("path:last-child");if(E.node()){const _=E.node().getBBox();e.height=_.height,k=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),u0r=w(function(t,e,r,n,i,s){var A;const a=n?e.stopy:e.starty,o=e.x+e.width/2,l=a+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Pn++,y.append("line").attr("id","actor"+Pn).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn);const v=t.append("g");let x=By;n?x+=` ${fm}`:x+=` ${dm}`,v.attr("class",x),v.attr("name",e.name);const b=jc();b.x=e.x,b.y=a,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const T=e.x+e.width/2,C=a+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",T).attr("cy",C).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${T}, ${C-S})`);const k=s.get(e.name)??0;Q0.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),J0(r,Ks(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${By}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),h0r=w(function(t,e,r,n,i){var S;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${fm}`:m+=` ${dm}`,g.attr("class",m),g.attr("name",e.name);const y=jc();y.x=e.x,y.y=s,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,x=s+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;Q0.has(u)&&(g.style("stroke",f[T%f.length]),g.style("fill",d[T%f.length]));const C=g.node().getBBox();return e.height=C.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Pn++,p.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn),J0(r,Ks(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${By}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),d0r=w(function(t,e,r,n,i){var R;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",AP(`actor${Pn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Pn,e.links!=null&&m.attr("id","root-"+Pn),h==="neo"&&m.attr("data-look","neo"));const y=jc();let v="actor";(R=e.properties)!=null&&R.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${fm}`:v+=` ${dm}`,y.x=e.x,y.y=s,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=s;const x=y.width/3,b=y.width/3,T=x/2,C=T/(2.5+x/50),S=m.append("g");S.attr("class",v);const k=` + a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),T.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(rp.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),T.style("stroke",f[S%f.length]),T.style("fill",d[S%f.length])),(R=e.properties)!=null&&R.icon){const _=e.properties.icon.trim(),P=m.x+m.width-20,N=m.y+10;_.charAt(0)==="@"?hee(g,P,N,_.substr(1)):uee(g,P,N,_)}np(r,Ks(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${RP}`},r);let k=e.height;const E=b.select("path:last-child");if(E.node()){const _=E.node().getBBox();e.height=_.height,k=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),E0r=w(function(t,e,r,n,i,s){var A;const a=n?e.stopy:e.starty,o=e.x+e.width/2,l=a+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Pn++,y.append("line").attr("id","actor"+Pn).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn);const v=t.append("g");let x=zy;n?x+=` ${mm}`:x+=` ${gm}`,v.attr("class",x),v.attr("name",e.name);const b=Zc();b.x=e.x,b.y=a,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const T=e.x+e.width/2,C=a+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",T).attr("cy",C).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${T}, ${C-S})`);const k=s.get(e.name)??0;rp.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),np(r,Ks(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${zy}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),A0r=w(function(t,e,r,n,i){var S;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${mm}`:m+=` ${gm}`,g.attr("class",m),g.attr("name",e.name);const y=Zc();y.x=e.x,y.y=s,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,x=s+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;rp.has(u)&&(g.style("stroke",f[T%f.length]),g.style("fill",d[T%f.length]));const C=g.node().getBBox();return e.height=C.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Pn++,p.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn),np(r,Ks(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${zy}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),M0r=w(function(t,e,r,n,i){var R;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Pn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",_P(`actor${Pn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Pn,e.links!=null&&m.attr("id","root-"+Pn),h==="neo"&&m.attr("data-look","neo"));const y=Zc();let v="actor";(R=e.properties)!=null&&R.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${mm}`:v+=` ${gm}`,y.x=e.x,y.y=s,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=s;const x=y.width/3,b=y.width/3,T=x/2,C=T/(2.5+x/50),S=m.append("g");S.attr("class",v);const k=` M ${y.x},${y.y+C} a ${T},${C} 0 0 0 ${x},0 a ${T},${C} 0 0 0 -${x},0 l 0,${b-2*C} a ${T},${C} 0 0 0 ${x},0 l 0,-${b-2*C} -`;S.append("path").attr("d",k),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;Q0.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${x}, ${C})`),e.rectData=y,J0(r,Ks(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${EP}`},r);const A=S.select("path:last-child");if(A.node()){const _=A.node().getBBox();e.height=_.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),f0r=w(function(t,e,r,n,i){const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Pn++,u.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn);const y=t.append("g");let v=By;n?v+=` ${fm}`:v+=` ${dm}`,y.attr("class",v),y.attr("name",e.name);const x=jc();x.x=e.x,x.y=s,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Pn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",s+12).attr("x2",e.x+e.width/2-15).attr("y2",s+12),y.append("line").attr("id","actor-man-arms"+Pn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",s+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",s+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",s+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;Q0.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const T=y.node().getBBox();return e.height=T.height+(r.sequence.labelBoxHeight??0),J0(r,Ks(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${By}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),p0r=w(function(t,e,r,n,i){const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Pn++,g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn);const m=t.append("g");let y=By;n?y+=` ${fm}`:y+=` ${dm}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,x=l==="neo"?s+(1-v)*30:s;m.append("line").attr("id","actor-man-torso"+Pn).attr("x1",a).attr("y1",x+25*v).attr("x2",a).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Pn).attr("x1",a-G1/2*v).attr("y1",x+33*v).attr("x2",a+G1/2*v).attr("y2",x+33*v),m.append("line").attr("x1",a-G1/2*v).attr("y1",x+60*v).attr("x2",a).attr("y2",x+45*v),m.append("line").attr("x1",a).attr("y1",x+45*v).attr("x2",a+(G1/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const T=m.node().getBBox();e.height=T.height;const C=jc();C.x=e.x,C.y=x,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const S=i.get(e.name)??0;return Q0.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),J0(r,Ks(e.description))(e.description,m,C.x,x+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${By}`},r),e.height},"drawActorTypeActor"),g0r=w(async function(t,e,r,n,i,s,a){const o=a??new Map([...s.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await p0r(t,e,r,n,o);case"participant":return await o0r(t,e,r,n,o);case"boundary":return await f0r(t,e,r,n,o);case"control":return await u0r(t,e,r,n,i,o);case"entity":return await h0r(t,e,r,n,o);case"database":return await d0r(t,e,r,n,o);case"collections":return await l0r(t,e,r,n,o);case"queue":return await c0r(t,e,r,n,o)}},"drawActor"),m0r=w(function(t,e,r){const i=t.append("g");WWe(i,e),e.name&&J0(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),y0r=w(function(t){return t.append("g")},"anchorElement"),v0r=w(function(t,e,r,n,i,s,a){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=jc(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=mE(p,f),v=(a??new Map([...s.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;Q0.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),b0r=w(async function(t,e,r,n,i){const{boxMargin:s,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=w(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=lee();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=a,g.class="labelText",HWe(f,g),g=qWe(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+s+a,g.anchor="middle",g.valign="middle",g.textMargin=a,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=Ks(g.text)?await FI(f,g,e):V5(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+s+a,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,Ks(g.text)?(e.starty=e.sections[y].y,await FI(f,g,e)):V5(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,T)=>b+T));e.sections[y].height+=x-(s+a)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),WWe=w(function(t,e){sIe(t,e)},"drawBackgroundRect"),x0r=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),w0r=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),T0r=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),C0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),k0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),S0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),E0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),A0r=w(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),qWe=w(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),M0r=w(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),J0=(function(){function t(s,a,o,l,u,h,d){const f=a.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(s);i(f,d)}w(t,"byText");function e(s,a,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=B0(p),x=s.split(Vt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:w(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:w(function(t){this.boxes.push(t)},"addBox"),addActor:w(function(t){this.actors.push(t)},"addActor"),addLoop:w(function(t){this.loops.push(t)},"addLoop"),addMessage:w(function(t){this.messages.push(t)},"addMessage"),addNote:w(function(t){this.notes.push(t)},"addNote"),lastActor:w(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:w(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:w(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:w(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:w(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,jWe(Ve())},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=this;let s=0;function a(o){return w(function(u){s++;const h=i.sequenceItems.length-s+1;i.updateVal(u,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*tt.boxMargin,Math.max),i.updateVal(Lt.data,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(Lt.data,"stopx",r+h*tt.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*tt.boxMargin,Math.max),i.updateVal(Lt.data,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(Lt.data,"stopy",n+h*tt.boxMargin,Math.max))},"updateItemBounds")}w(a,"updateFn"),this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},"updateBounds"),insert:w(function(t,e,r,n){const i=Vt.getMin(t,r),s=Vt.getMax(t,r),a=Vt.getMin(e,n),o=Vt.getMax(e,n);this.updateVal(Lt.data,"startx",i,Math.min),this.updateVal(Lt.data,"starty",a,Math.min),this.updateVal(Lt.data,"stopx",s,Math.max),this.updateVal(Lt.data,"stopy",o,Math.max),this.updateBounds(i,a,s,o)},"insert"),newActivation:w(function(t,e,r){const n=r.get(t.from),i=MP(t.from).length||0,s=n.x+n.width/2+(i-1)*tt.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+tt.activationWidth,stopy:void 0,actor:t.from,anchored:Di.anchorElement(e)})},"newActivation"),endActivation:w(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:w(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:w(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:w(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:w(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:w(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Lt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:w(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:w(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Vt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return{bounds:this.data,models:this.models}},"getBounds")},D0r=w(async function(t,e,r){Lt.bumpVerticalPos(tt.boxMargin),e.height=tt.boxMargin,e.starty=Lt.getVerticalPos();const n=jc();n.x=e.startx,n.y=e.starty,n.width=e.width||tt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const s=Di.drawRect(i,n),a=lee();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=tt.noteFontFamily,a.fontSize=tt.noteFontSize,a.fontWeight=tt.noteFontWeight,a.anchor=tt.noteAlign,a.textMargin=tt.noteMargin,a.valign="center";const o=Ks(a.text)?await FI(i,a):V5(i,a),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));s.attr("height",l+2*tt.noteMargin),e.height+=l+2*tt.noteMargin,Lt.bumpVerticalPos(l+2*tt.noteMargin),e.stopy=e.starty+l+2*tt.noteMargin,e.stopx=e.startx+n.width,Lt.insert(e.startx,e.starty,e.stopx,e.stopy),Lt.models.addNote(e)},"drawNote"),B1e=w(function(t,e,r,n,i,s,a){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=QWe(e,n),m=t.append("g"),y=16.5,v=w((S,k)=>{const E=S?y:-y;return k?-E:E},"getCircleOffset"),x=w(S=>{m.append("circle").attr("cx",S).attr("cy",a).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:T,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case T:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case T:x(d);break;case C:x(d),x(f);break}},"drawCentralConnection"),Fy=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),V2=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),hj=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function UWe(t,e){Lt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,s=Vt.splitBreaks(i).length,a=Ks(i),o=a?await YE(i,Ve()):Kr.calculateTextDimensions(i,Fy(tt));if(!a){const d=o.height/s;e.height+=d,Lt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Lt.getVerticalPos()+u,tt.rightAngles||(u+=tt.boxMargin,l=Lt.getVerticalPos()+u),u+=30;const d=Vt.getMax(h/2,tt.width/2);Lt.insert(r-d,Lt.getVerticalPos()-10+u,n+d,Lt.getVerticalPos()+30+u)}else u+=tt.boxMargin,l=Lt.getVerticalPos()+u,Lt.insert(r,l-10,n,l);return Lt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Lt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}w(UWe,"boundMessage");var O0r=w(async function(t,e,r,n,i,s){const{startx:a,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Kr.calculateTextDimensions(u,Fy(tt)),g=lee();g.x=Math.min(a,o),g.y=l+10,g.width=Math.abs(o-a),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=tt.messageFontFamily,g.fontSize=tt.messageFontSize,g.fontWeight=tt.messageFontWeight,g.anchor=tt.messageAlign,g.valign="center",g.textMargin=tt.wrapPadding,g.tspan=!1,Ks(g.text)?await FI(t,g,{startx:a,stopx:o,starty:r}):V5(t,g);const m=p.width;let y;if(a===o){const x=f||tt.showSequenceNumbers,b=QWe(i,n),T=H0r(i,n),C=a+(x&&(b||T)?10:0);tt.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${a+Vt.getMax(tt.width/2,m/2)} V ${r+25} H ${a}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(a+60)+","+(r+30)+" "+a+","+(r+20)),gV(i,n)&&B1e(t,i,e,n,a,o,r)}else y=t.append("line"),y.attr("x1",a),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),gV(i,n)&&B1e(t,i,e,n,a,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(tt.arrowMarkerAbsolute&&(v=$N(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+s+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+s+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+s+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+s+"-crosshead)"),f||tt.showSequenceNumbers){const x=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,T=6,C=gV(i,n);let S=a,k=o;x?(aa?k=o-2*T:(k=o-T,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),k+=C?15:0,y.attr("x2",k),y.attr("x1",S)):y.attr("x1",a+T);let E=0;const A=a===o,R=a<=o;A?E=e.fromBounds+1:b?E=R?e.toBounds-1:e.fromBounds+1:E=R?e.fromBounds+1:e.toBounds-1;let _="12px";const P=d.toString().length;P>5?_="7px":P>3&&(_="9px"),t.append("line").attr("x1",E).attr("y1",r).attr("x2",E).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+s+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",_).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),P0r=w(function(t,e,r,n,i,s,a){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(a||Lt.models.addBox(u),l+=tt.boxMargin+u.margin),p&&p!=u&&(a||(p.x=o+l,p.y=i),l+=p.margin),f.width=Vt.getMax(f.width||tt.width,tt.width),f.height=Vt.getMax(f.height||tt.height,tt.height),f.margin=f.margin||tt.actorMargin,h=Vt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Lt.getVerticalPos(),Lt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Lt.models.addActor(f)}u&&!a&&Lt.models.addBox(u),Lt.bumpVerticalPos(h)},"addActorRenderingData"),dj=w(async function(t,e,r,n,i,s,a){if(n){let o=0;Lt.bumpVerticalPos(tt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Lt.getVerticalPos());const h=await Di.drawActor(t,u,tt,!0,i,s,a);o=Vt.getMax(o,h)}Lt.bumpVerticalPos(o+tt.boxMargin)}else for(const o of r){const l=e.get(o);await Di.drawActor(t,l,tt,!1,i,s,a)}},"drawActors"),YWe=w(function(t,e,r,n){let i=0,s=0;for(const a of r){const o=e.get(a),l=B0r(o),u=Di.drawPopup(t,o,l,tt,tt.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>s&&(s=u.width+o.x)}return{maxHeight:i,maxWidth:s}},"drawActorsPopup"),jWe=w(function(t){sa(tt,t),t.fontFamily&&(tt.actorFontFamily=tt.noteFontFamily=tt.messageFontFamily=t.fontFamily),t.fontSize&&(tt.actorFontSize=tt.noteFontSize=tt.messageFontSize=t.fontSize),t.fontWeight&&(tt.actorFontWeight=tt.noteFontWeight=tt.messageFontWeight=t.fontWeight)},"setConf"),MP=w(function(t){return Lt.activations.filter(function(e){return e.actor===t})},"actorActivations"),F1e=w(function(t,e){const r=e.get(t),n=MP(t),i=n.reduce(function(a,o){return Vt.getMin(a,o.startx)},r.x+r.width/2-1),s=n.reduce(function(a,o){return Vt.getMax(a,o.stopx)},r.x+r.width/2+1);return[i,s]},"activationBounds");function Gu(t,e,r,n,i){Lt.bumpVerticalPos(r);let s=n;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,o=Fy(tt);e.message=Kr.wrapLabel(`[${e.message}]`,a-2*tt.wrapPadding,o),e.width=a,e.wrap=!0;const l=Kr.calculateTextDimensions(e.message,o),u=Vt.getMax(l.height,tt.labelBoxHeight);s=n+u,de.debug(`${u} - ${e.message}`)}i(e),Lt.bumpVerticalPos(s)}w(Gu,"adjustLoopHeightForWrap");function XWe(t,e,r,n,i,s,a){function o(h,d){h.x{B.add(H.from),B.add(H.to)}),y=y.filter(H=>B.has(H))}const S=new Map(y.map((B,H)=>{var G;return[((G=f.get(B))==null?void 0:G.name)??B,H]}));P0r(d,f,p,y,0,v,!1);const k=await W0r(v,f,C,n);Di.insertArrowHead(d,e),Di.insertArrowCrossHead(d,e),Di.insertArrowFilledHead(d,e),Di.insertSequenceNumber(d,e),Di.insertSolidTopArrowHead(d,e),Di.insertSolidBottomArrowHead(d,e),Di.insertStickTopArrowHead(d,e),Di.insertStickBottomArrowHead(d,e),a==="neo"&&Di.insertDropShadow(d,tt);function E(B,H){const G=Lt.endActivation(B);G.starty+18>H&&(G.starty=H-6,H+=12),Di.drawActivation(d,G,H,tt,MP(B.from).length,n,S),Lt.insert(G.startx,H-10,G.stopx,H)}w(E,"activeEnd");let A=1,R=1;const _=[],P=[];let N=0;for(const B of v){let H,G,W;switch(B.type){case n.db.LINETYPE.NOTE:Lt.resetVerticalPos(),G=B.noteModel,await D0r(d,G,B.id);break;case n.db.LINETYPE.ACTIVE_START:Lt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Lt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Lt.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,Lt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Gu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.LOOP_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"loop",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.RECT_START:Gu(k,B,tt.boxMargin,tt.boxMargin,K=>{let q=K.message;q||(q=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),Lt.newLoop(void 0,q)});break;case n.db.LINETYPE.RECT_END:H=Lt.endLoop(),P.push(H),Lt.models.addLoop(H),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Gu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.OPT_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"opt",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.ALT_START:Gu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.ALT_ELSE:Gu(k,B,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Lt.addSectionToLoop(K));break;case n.db.LINETYPE.ALT_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"alt",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Gu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K)),Lt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Gu(k,B,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Lt.addSectionToLoop(K));break;case n.db.LINETYPE.PAR_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"par",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.AUTONUMBER:A=B.message.start||A,R=B.message.step||R,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Gu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.CRITICAL_OPTION:Gu(k,B,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Lt.addSectionToLoop(K));break;case n.db.LINETYPE.CRITICAL_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"critical",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.BREAK_START:Gu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.BREAK_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"break",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;default:try{W=B.msgModel,W.starty=Lt.getVerticalPos(),W.sequenceIndex=A,W.sequenceVisible=n.db.showSequenceNumbers(),W.id=B.id,W.from=B.from,W.to=B.to;const K=await UWe(d,W);XWe(B,W,K,N,f,p,g),_.push({messageModel:W,lineStartY:K,msg:B}),Lt.models.addMessage(W)}catch(K){de.error("error while drawing message",K)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(B.type)&&(A=Math.round((A+R)*100)/100),N++}de.debug("createdActors",p),de.debug("destroyedActors",g),await dj(d,f,y,!1,e,n,S);for(const B of _)await O0r(d,B.messageModel,B.lineStartY,n,B.msg,e);tt.mirrorActors&&await dj(d,f,y,!0,e,n,S),P.forEach(B=>Di.drawBackgroundRect(d,B)),GWe(d,f,y,tt);for(const B of Lt.models.boxes){B.height=Lt.getVerticalPos()-B.y,Lt.insert(B.x,B.y,B.x+B.width,B.height);const H=tt.boxMargin*2;B.startx=B.x-H,B.starty=B.y-H*.25,B.stopx=B.startx+B.width+2*H,B.stopy=B.starty+B.height+H*.75,B.stroke="rgb(0,0,0, 0.5)",Di.drawBox(d,B,tt)}b&&Lt.bumpVerticalPos(tt.boxMargin);const L=YWe(d,f,y,h),{bounds:I}=Lt.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let $=I.stopy-I.starty;${const a=Fy(tt);let o=s.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=tt.boxMargin*8;o+=l,o-=2*tt.boxTextMargin,s.wrap&&(s.name=Kr.wrapLabel(s.name,o-2*tt.wrapPadding,a));const u=Kr.calculateTextDimensions(s.name,a);i=Vt.getMax(u.height,i);const h=Vt.getMax(o,u.width+2*tt.wrapPadding);if(s.margin=tt.boxTextMargin,os.textMaxHeight=i),Vt.getMax(n,tt.height)}w(ZWe,"calculateActorMargins");var F0r=w(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),s=n.x,a=i.x,o=t.wrap&&t.message;let l=Ks(t.message)?await YE(t.message,Ve()):Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,tt.width,V2(tt)):t.message,V2(tt));const u={width:o?tt.width:Vt.getMax(tt.width,l.width+2*tt.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?Vt.getMax(tt.width,l.width):Vt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=s+(n.width+tt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Vt.getMax(tt.width,l.width+2*tt.noteMargin):Vt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=s-u.width+(n.width-tt.actorMargin)/2):t.to===t.from?(l=Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,Vt.getMax(tt.width,n.width),V2(tt)):t.message,V2(tt)),u.width=o?Vt.getMax(tt.width,n.width):Vt.getMax(n.width,tt.width,l.width+2*tt.noteMargin),u.startx=s+(n.width-u.width)/2):(u.width=Math.abs(s+n.width/2-(a+i.width/2))+tt.actorMargin,u.startx=s2,f=w(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(tt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,s,a,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Kr.wrapLabel(t.message,Vt.getMax(g+2*tt.wrapPadding,tt.width),Fy(tt)));const m=Kr.calculateTextDimensions(t.message,Fy(tt));return{width:Vt.getMax(t.wrap?0:m.width+2*tt.wrapPadding,g+2*tt.wrapPadding,tt.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),W0r=w(async function(t,e,r,n){const i={},s=[];let a,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:s.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(a=s.pop(),i[a.id]=a,i[u.id]=a,s.push(a));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:a=s.pop(),i[a.id]=a;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=MP(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*tt.activationWidth/2,g={startx:p,stopx:p+tt.activationWidth,actor:u.from,enabled:!0};Lt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Lt.activations.map(f=>f.actor).lastIndexOf(u.from);Lt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await F0r(u,e,n),u.noteModel=o,s.forEach(d=>{a=d,a.from=Vt.getMin(a.from,o.startx),a.to=Vt.getMax(a.to,o.startx+o.width),a.width=Vt.getMax(a.width,Math.abs(a.from-a.to))-tt.labelBoxWidth})):(l=G0r(u,e,n),u.msgModel=l,l.startx&&l.stopx&&s.length>0&&s.forEach(d=>{if(a=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);a.from=Vt.getMin(f.x-l.width/2,f.x-f.width/2,a.from),a.to=Vt.getMax(p.x+l.width/2,p.x+f.width/2,a.to),a.width=Vt.getMax(a.width,Math.abs(a.to-a.from))-tt.labelBoxWidth}else a.from=Vt.getMin(l.startx,a.from),a.to=Vt.getMax(l.stopx,a.to),a.width=Vt.getMax(a.width,l.width)-tt.labelBoxWidth}))}return Lt.activations=[],de.debug("Loop type widths:",i),i},"calculateLoopBounds"),q0r={bounds:Lt,drawActors:dj,drawActorsPopup:YWe,setConf:jWe,draw:$0r},U0r={parser:Jfr,get db(){return new n0r},renderer:q0r,styles:s0r,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,$H({sequence:{wrap:t.wrap}}))},"init")};const Y0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:U0r},Symbol.toStringTag,{value:"Module"}));var fj=(function(){var t=w(function(pe,Ce,ne,j){for(ne=ne||{},j=pe.length;j--;ne[pe[j]]=Ce);return ne},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],s=[1,26],a=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],T=[1,30],C=[1,31],S=[1,44],k=[1,46],E=[1,43],A=[1,47],R=[1,9],_=[1,8,9],P=[1,58],N=[1,59],L=[1,60],I=[1,61],$=[1,62],O=[1,63],D=[1,64],F=[1,8,9,41],z=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],B=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],H=[13,60,86,100,102,103],G=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],K=[1,103],q=[1,121],oe=[1,117],Q=[1,113],Z=[1,119],re=[1,114],ie=[1,115],me=[1,116],te=[1,118],_e=[1,120],$e=[22,50,60,61,82,86,87,88,89,90],Fe=[1,128],ce=[12,39],he=[1,8,9,39,41,44,46],Te=[1,8,9,22],ge=[1,153],He=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Me={trace:w(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:w(function(Ce,ne,j,J,ue,X,fe){var ee=X.length-1;switch(ue){case 8:this.$=X[ee-1];break;case 9:case 10:case 13:case 15:this.$=X[ee];break;case 11:case 14:this.$=X[ee-2]+"."+X[ee];break;case 12:case 16:this.$=X[ee-1]+X[ee];break;case 17:case 18:this.$=X[ee-1]+"~"+X[ee]+"~";break;case 19:J.addRelation(X[ee]);break;case 20:X[ee-1].title=J.cleanupLabel(X[ee]),J.addRelation(X[ee-1]);break;case 31:this.$=X[ee].trim(),J.setAccTitle(this.$);break;case 32:case 33:this.$=X[ee].trim(),J.setAccDescription(this.$);break;case 34:J.addClassesToNamespace(X[ee-3],X[ee-1][0],X[ee-1][1]),J.popNamespace();break;case 35:J.addClassesToNamespace(X[ee-4],X[ee-1][0],X[ee-1][1]),J.popNamespace();break;case 36:this.$=J.addNamespace(X[ee]);break;case 37:this.$=J.addNamespace(X[ee-1],X[ee]);break;case 38:this.$=[[X[ee]],[]];break;case 39:this.$=[[X[ee-1]],[]];break;case 40:X[ee][0].unshift(X[ee-2]),this.$=X[ee];break;case 41:this.$=[[],[X[ee]]];break;case 42:this.$=[[],[X[ee-1]]];break;case 43:X[ee][1].unshift(X[ee-2]),this.$=X[ee];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=X[ee];break;case 48:J.setCssClass(X[ee-2],X[ee]);break;case 49:J.addMembers(X[ee-3],X[ee-1]);break;case 51:J.setCssClass(X[ee-5],X[ee-3]),J.addMembers(X[ee-5],X[ee-1]);break;case 52:J.addAnnotation(X[ee-3],X[ee-1]);break;case 53:J.addAnnotation(X[ee-6],X[ee-4]),J.addMembers(X[ee-6],X[ee-1]);break;case 54:J.addAnnotation(X[ee-5],X[ee-3]);break;case 55:this.$=X[ee],J.addClass(X[ee]);break;case 56:this.$=X[ee-1],J.addClass(X[ee-1]),J.setClassLabel(X[ee-1],X[ee]);break;case 60:J.addAnnotation(X[ee],X[ee-2]);break;case 61:case 74:this.$=[X[ee]];break;case 62:X[ee].push(X[ee-1]),this.$=X[ee];break;case 63:break;case 64:J.addMember(X[ee-1],J.cleanupLabel(X[ee]));break;case 65:break;case 66:break;case 67:this.$={id1:X[ee-2],id2:X[ee],relation:X[ee-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-1],relationTitle1:X[ee-2],relationTitle2:"none"};break;case 69:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-2],relationTitle1:"none",relationTitle2:X[ee-1]};break;case 70:this.$={id1:X[ee-4],id2:X[ee],relation:X[ee-2],relationTitle1:X[ee-3],relationTitle2:X[ee-1]};break;case 71:this.$=J.addNote(X[ee],X[ee-1]);break;case 72:this.$=J.addNote(X[ee]);break;case 73:this.$=X[ee-2],J.defineClass(X[ee-1],X[ee]);break;case 75:this.$=X[ee-2].concat([X[ee]]);break;case 76:J.setDirection("TB");break;case 77:J.setDirection("BT");break;case 78:J.setDirection("RL");break;case 79:J.setDirection("LR");break;case 80:this.$={type1:X[ee-2],type2:X[ee],lineType:X[ee-1]};break;case 81:this.$={type1:"none",type2:X[ee],lineType:X[ee-1]};break;case 82:this.$={type1:X[ee-1],type2:"none",lineType:X[ee]};break;case 83:this.$={type1:"none",type2:"none",lineType:X[ee]};break;case 84:this.$=J.relationType.AGGREGATION;break;case 85:this.$=J.relationType.EXTENSION;break;case 86:this.$=J.relationType.COMPOSITION;break;case 87:this.$=J.relationType.DEPENDENCY;break;case 88:this.$=J.relationType.LOLLIPOP;break;case 89:this.$=J.lineType.LINE;break;case 90:this.$=J.lineType.DOTTED_LINE;break;case 91:case 97:this.$=X[ee-2],J.setClickEvent(X[ee-1],X[ee]);break;case 92:case 98:this.$=X[ee-3],J.setClickEvent(X[ee-2],X[ee-1]),J.setTooltip(X[ee-2],X[ee]);break;case 93:this.$=X[ee-2],J.setLink(X[ee-1],X[ee]);break;case 94:this.$=X[ee-3],J.setLink(X[ee-2],X[ee-1],X[ee]);break;case 95:this.$=X[ee-3],J.setLink(X[ee-2],X[ee-1]),J.setTooltip(X[ee-2],X[ee]);break;case 96:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-2],X[ee]),J.setTooltip(X[ee-3],X[ee-1]);break;case 99:this.$=X[ee-3],J.setClickEvent(X[ee-2],X[ee-1],X[ee]);break;case 100:this.$=X[ee-4],J.setClickEvent(X[ee-3],X[ee-2],X[ee-1]),J.setTooltip(X[ee-3],X[ee]);break;case 101:this.$=X[ee-3],J.setLink(X[ee-2],X[ee]);break;case 102:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-1],X[ee]);break;case 103:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-1]),J.setTooltip(X[ee-3],X[ee]);break;case 104:this.$=X[ee-5],J.setLink(X[ee-4],X[ee-2],X[ee]),J.setTooltip(X[ee-4],X[ee-1]);break;case 105:this.$=X[ee-2],J.setCssStyle(X[ee-1],X[ee]);break;case 106:J.setCssClass(X[ee-1],X[ee]);break;case 107:this.$=[X[ee]];break;case 108:X[ee-2].push(X[ee]),this.$=X[ee-2];break;case 110:this.$=X[ee-1]+X[ee];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:T,83:C,86:S,100:k,102:E,103:A},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(R,[2,5],{8:[1,48]}),{8:[1,49]},t(_,[2,19],{22:[1,50]}),t(_,[2,21]),t(_,[2,22]),t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,27]),t(_,[2,28]),t(_,[2,29]),t(_,[2,30]),{34:[1,51]},{36:[1,52]},t(_,[2,33]),t(_,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:N,70:L,71:I,72:$,73:O,74:D}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(_,[2,65]),t(_,[2,66]),{16:69,60:f,86:S,100:k,102:E},{16:39,17:40,19:70,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:71,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:72,60:f,86:S,100:k,102:E,103:A},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:k,102:E,103:A},{13:z,55:76},{58:78,60:[1,79]},t(_,[2,76]),t(_,[2,77]),t(_,[2,78]),t(_,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:k,102:E,103:A}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:87,60:f,86:S,100:k,102:E,103:A},t(B,[2,133]),t(B,[2,134]),t(B,[2,135]),t(B,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(R,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:T,83:C,86:S,100:k,102:E,103:A}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:T,83:C,86:S,100:k,102:E,103:A},t(_,[2,20]),t(_,[2,31]),t(_,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:k,102:E,103:A},{53:92,66:56,67:57,68:P,69:N,70:L,71:I,72:$,73:O,74:D},t(_,[2,64]),{67:93,73:O,74:D},t(H,[2,83],{66:94,68:P,69:N,70:L,71:I,72:$}),t(G,[2,84]),t(G,[2,85]),t(G,[2,86]),t(G,[2,87]),t(G,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:a,54:u,56:h},{16:100,60:f,86:S,100:k,102:E},{41:[1,102],45:101,51:K},{16:104,60:f,86:S,100:k,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:q,50:oe,59:110,60:Q,82:Z,84:111,85:112,86:re,87:ie,88:me,89:te,90:_e},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:q,50:oe,59:124,60:Q,61:[1,125],82:Z,84:111,85:112,86:re,87:ie,88:me,89:te,90:_e},t($e,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:k,102:E,103:A},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Fe,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:k,102:E,103:A}),t(ce,[2,10]),t(he,[2,55],{11:131,12:Fe}),t(R,[2,7]),{9:[1,132]},t(Te,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:k,102:E,103:A},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:k,102:E,103:A},t(H,[2,82],{66:136,68:P,69:N,70:L,71:I,72:$}),t(H,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:a,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:K},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:k,102:E,103:A},t(_,[2,91],{13:[1,147]}),t(_,[2,93],{13:[1,149],77:[1,148]}),t(_,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(_,[2,105],{61:ge}),t(He,[2,107],{85:154,22:q,50:oe,60:Q,82:Z,86:re,87:ie,88:me,89:te,90:_e}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[2,119]),t(_,[2,106]),t(F,[2,71]),t(_,[2,73],{61:ge}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:k,102:E,103:A},t(ce,[2,12]),t(he,[2,56]),{1:[2,4]},t(Te,[2,69]),t(Te,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:k,102:E,103:A},t(H,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:a,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:a,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:a,54:u,56:h},{45:163,51:K},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(_,[2,60]),t(_,[2,92]),t(_,[2,94]),t(_,[2,95],{77:[1,165]}),t(_,[2,98]),t(_,[2,99],{13:[1,166]}),t(_,[2,101],{13:[1,168],77:[1,167]}),{22:q,50:oe,60:Q,82:Z,84:169,85:112,86:re,87:ie,88:me,89:te,90:_e},t(we,[2,110]),t($e,[2,75]),{14:[1,170]},t(ce,[2,11]),t(Te,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:K},t(_,[2,96]),t(_,[2,100]),t(_,[2,102]),t(_,[2,103],{77:[1,174]}),t(He,[2,108],{85:154,22:q,50:oe,60:Q,82:Z,86:re,87:ie,88:me,89:te,90:_e}),t(he,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(_,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:w(function(Ce,ne){if(ne.recoverable)this.trace(Ce);else{var j=new Error(Ce);throw j.hash=ne,j}},"parseError"),parse:w(function(Ce){var ne=this,j=[0],J=[],ue=[null],X=[],fe=this.table,ee="",Ae=0,Re=0,Xe=2,Ne=1,qe=X.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ze)&&(Ke.yy[ze]=this.yy[ze]);De.setInput(Ce,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var st=De.yylloc;X.push(st);var Oe=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function mt(Rt){j.length=j.length-2*Rt,ue.length=ue.length-Rt,X.length=X.length-Rt}w(mt,"popStack");function Le(){var Rt;return Rt=J.pop()||De.lex()||Ne,typeof Rt!="number"&&(Rt instanceof Array&&(J=Rt,Rt=J.pop()),Rt=ne.symbols_[Rt]||Rt),Rt}w(Le,"lex");for(var St,At,lt,zt,It={},ft,xe,Nt,Tt;;){if(At=j[j.length-1],this.defaultActions[At]?lt=this.defaultActions[At]:((St===null||typeof St>"u")&&(St=Le()),lt=fe[At]&&fe[At][St]),typeof lt>"u"||!lt.length||!lt[0]){var yt="";Tt=[];for(ft in fe[At])this.terminals_[ft]&&ft>Xe&&Tt.push("'"+this.terminals_[ft]+"'");De.showPosition?yt="Parse error on line "+(Ae+1)+`: +`;S.append("path").attr("d",k),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;rp.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${x}, ${C})`),e.rectData=y,np(r,Ks(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${RP}`},r);const A=S.select("path:last-child");if(A.node()){const _=A.node().getBBox();e.height=_.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),R0r=w(function(t,e,r,n,i){const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Pn++,u.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn);const y=t.append("g");let v=zy;n?v+=` ${mm}`:v+=` ${gm}`,y.attr("class",v),y.attr("name",e.name);const x=Zc();x.x=e.x,x.y=s,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Pn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",s+12).attr("x2",e.x+e.width/2-15).attr("y2",s+12),y.append("line").attr("id","actor-man-arms"+Pn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",s+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",s+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",s+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;rp.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const T=y.node().getBBox();return e.height=T.height+(r.sequence.labelBoxHeight??0),np(r,Ks(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${zy}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),_0r=w(function(t,e,r,n,i){const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Pn++,g.append("line").attr("id","actor"+Pn).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Pn);const m=t.append("g");let y=zy;n?y+=` ${mm}`:y+=` ${gm}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,x=l==="neo"?s+(1-v)*30:s;m.append("line").attr("id","actor-man-torso"+Pn).attr("x1",a).attr("y1",x+25*v).attr("x2",a).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Pn).attr("x1",a-q1/2*v).attr("y1",x+33*v).attr("x2",a+q1/2*v).attr("y2",x+33*v),m.append("line").attr("x1",a-q1/2*v).attr("y1",x+60*v).attr("x2",a).attr("y2",x+45*v),m.append("line").attr("x1",a).attr("y1",x+45*v).attr("x2",a+(q1/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const T=m.node().getBBox();e.height=T.height;const C=Zc();C.x=e.x,C.y=x,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const S=i.get(e.name)??0;return rp.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),np(r,Ks(e.description))(e.description,m,C.x,x+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${zy}`},r),e.height},"drawActorTypeActor"),L0r=w(async function(t,e,r,n,i,s,a){const o=a??new Map([...s.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await _0r(t,e,r,n,o);case"participant":return await C0r(t,e,r,n,o);case"boundary":return await R0r(t,e,r,n,o);case"control":return await E0r(t,e,r,n,i,o);case"entity":return await A0r(t,e,r,n,o);case"database":return await M0r(t,e,r,n,o);case"collections":return await k0r(t,e,r,n,o);case"queue":return await S0r(t,e,r,n,o)}},"drawActor"),I0r=w(function(t,e,r){const i=t.append("g");KWe(i,e),e.name&&np(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),N0r=w(function(t){return t.append("g")},"anchorElement"),D0r=w(function(t,e,r,n,i,s,a){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Zc(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=bE(p,f),v=(a??new Map([...s.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;rp.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),O0r=w(async function(t,e,r,n,i){const{boxMargin:s,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=w(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=dee();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=a,g.class="labelText",jWe(f,g),g=ZWe(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+s+a,g.anchor="middle",g.valign="middle",g.textMargin=a,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=Ks(g.text)?await HI(f,g,e):W5(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+s+a,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,Ks(g.text)?(e.starty=e.sections[y].y,await HI(f,g,e)):W5(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,T)=>b+T));e.sections[y].height+=x-(s+a)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),KWe=w(function(t,e){hIe(t,e)},"drawBackgroundRect"),P0r=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),$0r=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),B0r=w(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),F0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),z0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),V0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),H0r=w(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),G0r=w(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),ZWe=w(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),W0r=w(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),np=(function(){function t(s,a,o,l,u,h,d){const f=a.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(s);i(f,d)}w(t,"byText");function e(s,a,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=H0(p),x=s.split(Vt.lineBreakRegex);for(let b=0;bt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:w(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:w(function(t){this.boxes.push(t)},"addBox"),addActor:w(function(t){this.actors.push(t)},"addActor"),addLoop:w(function(t){this.loops.push(t)},"addLoop"),addMessage:w(function(t){this.messages.push(t)},"addMessage"),addNote:w(function(t){this.notes.push(t)},"addNote"),lastActor:w(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:w(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:w(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:w(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:w(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,eqe(Ve())},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=this;let s=0;function a(o){return w(function(u){s++;const h=i.sequenceItems.length-s+1;i.updateVal(u,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*tt.boxMargin,Math.max),i.updateVal(Lt.data,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(Lt.data,"stopx",r+h*tt.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*tt.boxMargin,Math.max),i.updateVal(Lt.data,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(Lt.data,"stopy",n+h*tt.boxMargin,Math.max))},"updateItemBounds")}w(a,"updateFn"),this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},"updateBounds"),insert:w(function(t,e,r,n){const i=Vt.getMin(t,r),s=Vt.getMax(t,r),a=Vt.getMin(e,n),o=Vt.getMax(e,n);this.updateVal(Lt.data,"startx",i,Math.min),this.updateVal(Lt.data,"starty",a,Math.min),this.updateVal(Lt.data,"stopx",s,Math.max),this.updateVal(Lt.data,"stopy",o,Math.max),this.updateBounds(i,a,s,o)},"insert"),newActivation:w(function(t,e,r){const n=r.get(t.from),i=LP(t.from).length||0,s=n.x+n.width/2+(i-1)*tt.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+tt.activationWidth,stopy:void 0,actor:t.from,anchored:Di.anchorElement(e)})},"newActivation"),endActivation:w(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:w(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:w(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:w(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:w(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:w(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Lt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:w(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:w(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Vt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return{bounds:this.data,models:this.models}},"getBounds")},K0r=w(async function(t,e,r){Lt.bumpVerticalPos(tt.boxMargin),e.height=tt.boxMargin,e.starty=Lt.getVerticalPos();const n=Zc();n.x=e.startx,n.y=e.starty,n.width=e.width||tt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const s=Di.drawRect(i,n),a=dee();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=tt.noteFontFamily,a.fontSize=tt.noteFontSize,a.fontWeight=tt.noteFontWeight,a.anchor=tt.noteAlign,a.textMargin=tt.noteMargin,a.valign="center";const o=Ks(a.text)?await HI(i,a):W5(i,a),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));s.attr("height",l+2*tt.noteMargin),e.height+=l+2*tt.noteMargin,Lt.bumpVerticalPos(l+2*tt.noteMargin),e.stopy=e.starty+l+2*tt.noteMargin,e.stopx=e.startx+n.width,Lt.insert(e.startx,e.starty,e.stopx,e.stopy),Lt.models.addNote(e)},"drawNote"),W1e=w(function(t,e,r,n,i,s,a){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=iqe(e,n),m=t.append("g"),y=16.5,v=w((S,k)=>{const E=S?y:-y;return k?-E:E},"getCircleOffset"),x=w(S=>{m.append("circle").attr("cx",S).attr("cy",a).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:T,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case T:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case T:x(d);break;case C:x(d),x(f);break}},"drawCentralConnection"),Vy=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),G2=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),gj=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function QWe(t,e){Lt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,s=Vt.splitBreaks(i).length,a=Ks(i),o=a?await KE(i,Ve()):Kr.calculateTextDimensions(i,Vy(tt));if(!a){const d=o.height/s;e.height+=d,Lt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Lt.getVerticalPos()+u,tt.rightAngles||(u+=tt.boxMargin,l=Lt.getVerticalPos()+u),u+=30;const d=Vt.getMax(h/2,tt.width/2);Lt.insert(r-d,Lt.getVerticalPos()-10+u,n+d,Lt.getVerticalPos()+30+u)}else u+=tt.boxMargin,l=Lt.getVerticalPos()+u,Lt.insert(r,l-10,n,l);return Lt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Lt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}w(QWe,"boundMessage");var Z0r=w(async function(t,e,r,n,i,s){const{startx:a,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Kr.calculateTextDimensions(u,Vy(tt)),g=dee();g.x=Math.min(a,o),g.y=l+10,g.width=Math.abs(o-a),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=tt.messageFontFamily,g.fontSize=tt.messageFontSize,g.fontWeight=tt.messageFontWeight,g.anchor=tt.messageAlign,g.valign="center",g.textMargin=tt.wrapPadding,g.tspan=!1,Ks(g.text)?await HI(t,g,{startx:a,stopx:o,starty:r}):W5(t,g);const m=p.width;let y;if(a===o){const x=f||tt.showSequenceNumbers,b=iqe(i,n),T=ipr(i,n),C=a+(x&&(b||T)?10:0);tt.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${a+Vt.getMax(tt.width/2,m/2)} V ${r+25} H ${a}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(a+60)+","+(r+30)+" "+a+","+(r+20)),bV(i,n)&&W1e(t,i,e,n,a,o,r)}else y=t.append("line"),y.attr("x1",a),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),bV(i,n)&&W1e(t,i,e,n,a,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(tt.arrowMarkerAbsolute&&(v=zN(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+s+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+s+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+s+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+s+"-crosshead)"),f||tt.showSequenceNumbers){const x=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,T=6,C=bV(i,n);let S=a,k=o;x?(aa?k=o-2*T:(k=o-T,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),k+=C?15:0,y.attr("x2",k),y.attr("x1",S)):y.attr("x1",a+T);let E=0;const A=a===o,R=a<=o;A?E=e.fromBounds+1:b?E=R?e.toBounds-1:e.fromBounds+1:E=R?e.fromBounds+1:e.toBounds-1;let _="12px";const P=d.toString().length;P>5?_="7px":P>3&&(_="9px"),t.append("line").attr("x1",E).attr("y1",r).attr("x2",E).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+s+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",_).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),Q0r=w(function(t,e,r,n,i,s,a){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(a||Lt.models.addBox(u),l+=tt.boxMargin+u.margin),p&&p!=u&&(a||(p.x=o+l,p.y=i),l+=p.margin),f.width=Vt.getMax(f.width||tt.width,tt.width),f.height=Vt.getMax(f.height||tt.height,tt.height),f.margin=f.margin||tt.actorMargin,h=Vt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Lt.getVerticalPos(),Lt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Lt.models.addActor(f)}u&&!a&&Lt.models.addBox(u),Lt.bumpVerticalPos(h)},"addActorRenderingData"),mj=w(async function(t,e,r,n,i,s,a){if(n){let o=0;Lt.bumpVerticalPos(tt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Lt.getVerticalPos());const h=await Di.drawActor(t,u,tt,!0,i,s,a);o=Vt.getMax(o,h)}Lt.bumpVerticalPos(o+tt.boxMargin)}else for(const o of r){const l=e.get(o);await Di.drawActor(t,l,tt,!1,i,s,a)}},"drawActors"),JWe=w(function(t,e,r,n){let i=0,s=0;for(const a of r){const o=e.get(a),l=epr(o),u=Di.drawPopup(t,o,l,tt,tt.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>s&&(s=u.width+o.x)}return{maxHeight:i,maxWidth:s}},"drawActorsPopup"),eqe=w(function(t){sa(tt,t),t.fontFamily&&(tt.actorFontFamily=tt.noteFontFamily=tt.messageFontFamily=t.fontFamily),t.fontSize&&(tt.actorFontSize=tt.noteFontSize=tt.messageFontSize=t.fontSize),t.fontWeight&&(tt.actorFontWeight=tt.noteFontWeight=tt.messageFontWeight=t.fontWeight)},"setConf"),LP=w(function(t){return Lt.activations.filter(function(e){return e.actor===t})},"actorActivations"),q1e=w(function(t,e){const r=e.get(t),n=LP(t),i=n.reduce(function(a,o){return Vt.getMin(a,o.startx)},r.x+r.width/2-1),s=n.reduce(function(a,o){return Vt.getMax(a,o.stopx)},r.x+r.width/2+1);return[i,s]},"activationBounds");function Uu(t,e,r,n,i){Lt.bumpVerticalPos(r);let s=n;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,o=Vy(tt);e.message=Kr.wrapLabel(`[${e.message}]`,a-2*tt.wrapPadding,o),e.width=a,e.wrap=!0;const l=Kr.calculateTextDimensions(e.message,o),u=Vt.getMax(l.height,tt.labelBoxHeight);s=n+u,de.debug(`${u} - ${e.message}`)}i(e),Lt.bumpVerticalPos(s)}w(Uu,"adjustLoopHeightForWrap");function tqe(t,e,r,n,i,s,a){function o(h,d){h.x{B.add(H.from),B.add(H.to)}),y=y.filter(H=>B.has(H))}const S=new Map(y.map((B,H)=>{var G;return[((G=f.get(B))==null?void 0:G.name)??B,H]}));Q0r(d,f,p,y,0,v,!1);const k=await apr(v,f,C,n);Di.insertArrowHead(d,e),Di.insertArrowCrossHead(d,e),Di.insertArrowFilledHead(d,e),Di.insertSequenceNumber(d,e),Di.insertSolidTopArrowHead(d,e),Di.insertSolidBottomArrowHead(d,e),Di.insertStickTopArrowHead(d,e),Di.insertStickBottomArrowHead(d,e),a==="neo"&&Di.insertDropShadow(d,tt);function E(B,H){const G=Lt.endActivation(B);G.starty+18>H&&(G.starty=H-6,H+=12),Di.drawActivation(d,G,H,tt,LP(B.from).length,n,S),Lt.insert(G.startx,H-10,G.stopx,H)}w(E,"activeEnd");let A=1,R=1;const _=[],P=[];let N=0;for(const B of v){let H,G,W;switch(B.type){case n.db.LINETYPE.NOTE:Lt.resetVerticalPos(),G=B.noteModel,await K0r(d,G,B.id);break;case n.db.LINETYPE.ACTIVE_START:Lt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Lt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Lt.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,Lt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Uu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.LOOP_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"loop",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.RECT_START:Uu(k,B,tt.boxMargin,tt.boxMargin,K=>{let q=K.message;q||(q=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),Lt.newLoop(void 0,q)});break;case n.db.LINETYPE.RECT_END:H=Lt.endLoop(),P.push(H),Lt.models.addLoop(H),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Uu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.OPT_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"opt",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.ALT_START:Uu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.ALT_ELSE:Uu(k,B,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Lt.addSectionToLoop(K));break;case n.db.LINETYPE.ALT_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"alt",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Uu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K)),Lt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Uu(k,B,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Lt.addSectionToLoop(K));break;case n.db.LINETYPE.PAR_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"par",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.AUTONUMBER:A=B.message.start||A,R=B.message.step||R,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Uu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.CRITICAL_OPTION:Uu(k,B,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Lt.addSectionToLoop(K));break;case n.db.LINETYPE.CRITICAL_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"critical",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;case n.db.LINETYPE.BREAK_START:Uu(k,B,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Lt.newLoop(K));break;case n.db.LINETYPE.BREAK_END:H=Lt.endLoop(),await Di.drawLoop(d,H,"break",tt,B),Lt.bumpVerticalPos(H.stopy-Lt.getVerticalPos()),Lt.models.addLoop(H);break;default:try{W=B.msgModel,W.starty=Lt.getVerticalPos(),W.sequenceIndex=A,W.sequenceVisible=n.db.showSequenceNumbers(),W.id=B.id,W.from=B.from,W.to=B.to;const K=await QWe(d,W);tqe(B,W,K,N,f,p,g),_.push({messageModel:W,lineStartY:K,msg:B}),Lt.models.addMessage(W)}catch(K){de.error("error while drawing message",K)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(B.type)&&(A=Math.round((A+R)*100)/100),N++}de.debug("createdActors",p),de.debug("destroyedActors",g),await mj(d,f,y,!1,e,n,S);for(const B of _)await Z0r(d,B.messageModel,B.lineStartY,n,B.msg,e);tt.mirrorActors&&await mj(d,f,y,!0,e,n,S),P.forEach(B=>Di.drawBackgroundRect(d,B)),XWe(d,f,y,tt);for(const B of Lt.models.boxes){B.height=Lt.getVerticalPos()-B.y,Lt.insert(B.x,B.y,B.x+B.width,B.height);const H=tt.boxMargin*2;B.startx=B.x-H,B.starty=B.y-H*.25,B.stopx=B.startx+B.width+2*H,B.stopy=B.starty+B.height+H*.75,B.stroke="rgb(0,0,0, 0.5)",Di.drawBox(d,B,tt)}b&&Lt.bumpVerticalPos(tt.boxMargin);const L=JWe(d,f,y,h),{bounds:I}=Lt.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let $=I.stopy-I.starty;${const a=Vy(tt);let o=s.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=tt.boxMargin*8;o+=l,o-=2*tt.boxTextMargin,s.wrap&&(s.name=Kr.wrapLabel(s.name,o-2*tt.wrapPadding,a));const u=Kr.calculateTextDimensions(s.name,a);i=Vt.getMax(u.height,i);const h=Vt.getMax(o,u.width+2*tt.wrapPadding);if(s.margin=tt.boxTextMargin,os.textMaxHeight=i),Vt.getMax(n,tt.height)}w(nqe,"calculateActorMargins");var tpr=w(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),s=n.x,a=i.x,o=t.wrap&&t.message;let l=Ks(t.message)?await KE(t.message,Ve()):Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,tt.width,G2(tt)):t.message,G2(tt));const u={width:o?tt.width:Vt.getMax(tt.width,l.width+2*tt.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?Vt.getMax(tt.width,l.width):Vt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=s+(n.width+tt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Vt.getMax(tt.width,l.width+2*tt.noteMargin):Vt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=s-u.width+(n.width-tt.actorMargin)/2):t.to===t.from?(l=Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,Vt.getMax(tt.width,n.width),G2(tt)):t.message,G2(tt)),u.width=o?Vt.getMax(tt.width,n.width):Vt.getMax(n.width,tt.width,l.width+2*tt.noteMargin),u.startx=s+(n.width-u.width)/2):(u.width=Math.abs(s+n.width/2-(a+i.width/2))+tt.actorMargin,u.startx=s2,f=w(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(tt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,s,a,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Kr.wrapLabel(t.message,Vt.getMax(g+2*tt.wrapPadding,tt.width),Vy(tt)));const m=Kr.calculateTextDimensions(t.message,Vy(tt));return{width:Vt.getMax(t.wrap?0:m.width+2*tt.wrapPadding,g+2*tt.wrapPadding,tt.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),apr=w(async function(t,e,r,n){const i={},s=[];let a,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:s.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(a=s.pop(),i[a.id]=a,i[u.id]=a,s.push(a));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:a=s.pop(),i[a.id]=a;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=LP(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*tt.activationWidth/2,g={startx:p,stopx:p+tt.activationWidth,actor:u.from,enabled:!0};Lt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Lt.activations.map(f=>f.actor).lastIndexOf(u.from);Lt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await tpr(u,e,n),u.noteModel=o,s.forEach(d=>{a=d,a.from=Vt.getMin(a.from,o.startx),a.to=Vt.getMax(a.to,o.startx+o.width),a.width=Vt.getMax(a.width,Math.abs(a.from-a.to))-tt.labelBoxWidth})):(l=spr(u,e,n),u.msgModel=l,l.startx&&l.stopx&&s.length>0&&s.forEach(d=>{if(a=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);a.from=Vt.getMin(f.x-l.width/2,f.x-f.width/2,a.from),a.to=Vt.getMax(p.x+l.width/2,p.x+f.width/2,a.to),a.width=Vt.getMax(a.width,Math.abs(a.to-a.from))-tt.labelBoxWidth}else a.from=Vt.getMin(l.startx,a.from),a.to=Vt.getMax(l.stopx,a.to),a.width=Vt.getMax(a.width,l.width)-tt.labelBoxWidth}))}return Lt.activations=[],de.debug("Loop type widths:",i),i},"calculateLoopBounds"),opr={bounds:Lt,drawActors:mj,drawActorsPopup:JWe,setConf:eqe,draw:J0r},lpr={parser:g0r,get db(){return new b0r},renderer:opr,styles:w0r,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,VH({sequence:{wrap:t.wrap}}))},"init")};const cpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:lpr},Symbol.toStringTag,{value:"Module"}));var yj=(function(){var t=w(function(pe,Ce,ne,j){for(ne=ne||{},j=pe.length;j--;ne[pe[j]]=Ce);return ne},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],s=[1,26],a=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],x=[1,28],b=[1,29],T=[1,30],C=[1,31],S=[1,44],k=[1,46],E=[1,43],A=[1,47],R=[1,9],_=[1,8,9],P=[1,58],N=[1,59],L=[1,60],I=[1,61],$=[1,62],O=[1,63],D=[1,64],F=[1,8,9,41],z=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],B=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],H=[13,60,86,100,102,103],G=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],K=[1,103],q=[1,121],oe=[1,117],Q=[1,113],Z=[1,119],re=[1,114],ie=[1,115],me=[1,116],te=[1,118],_e=[1,120],$e=[22,50,60,61,82,86,87,88,89,90],Fe=[1,128],ce=[12,39],he=[1,8,9,39,41,44,46],Te=[1,8,9,22],ge=[1,153],He=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Me={trace:w(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:w(function(Ce,ne,j,J,ue,X,fe){var ee=X.length-1;switch(ue){case 8:this.$=X[ee-1];break;case 9:case 10:case 13:case 15:this.$=X[ee];break;case 11:case 14:this.$=X[ee-2]+"."+X[ee];break;case 12:case 16:this.$=X[ee-1]+X[ee];break;case 17:case 18:this.$=X[ee-1]+"~"+X[ee]+"~";break;case 19:J.addRelation(X[ee]);break;case 20:X[ee-1].title=J.cleanupLabel(X[ee]),J.addRelation(X[ee-1]);break;case 31:this.$=X[ee].trim(),J.setAccTitle(this.$);break;case 32:case 33:this.$=X[ee].trim(),J.setAccDescription(this.$);break;case 34:J.addClassesToNamespace(X[ee-3],X[ee-1][0],X[ee-1][1]),J.popNamespace();break;case 35:J.addClassesToNamespace(X[ee-4],X[ee-1][0],X[ee-1][1]),J.popNamespace();break;case 36:this.$=J.addNamespace(X[ee]);break;case 37:this.$=J.addNamespace(X[ee-1],X[ee]);break;case 38:this.$=[[X[ee]],[]];break;case 39:this.$=[[X[ee-1]],[]];break;case 40:X[ee][0].unshift(X[ee-2]),this.$=X[ee];break;case 41:this.$=[[],[X[ee]]];break;case 42:this.$=[[],[X[ee-1]]];break;case 43:X[ee][1].unshift(X[ee-2]),this.$=X[ee];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=X[ee];break;case 48:J.setCssClass(X[ee-2],X[ee]);break;case 49:J.addMembers(X[ee-3],X[ee-1]);break;case 51:J.setCssClass(X[ee-5],X[ee-3]),J.addMembers(X[ee-5],X[ee-1]);break;case 52:J.addAnnotation(X[ee-3],X[ee-1]);break;case 53:J.addAnnotation(X[ee-6],X[ee-4]),J.addMembers(X[ee-6],X[ee-1]);break;case 54:J.addAnnotation(X[ee-5],X[ee-3]);break;case 55:this.$=X[ee],J.addClass(X[ee]);break;case 56:this.$=X[ee-1],J.addClass(X[ee-1]),J.setClassLabel(X[ee-1],X[ee]);break;case 60:J.addAnnotation(X[ee],X[ee-2]);break;case 61:case 74:this.$=[X[ee]];break;case 62:X[ee].push(X[ee-1]),this.$=X[ee];break;case 63:break;case 64:J.addMember(X[ee-1],J.cleanupLabel(X[ee]));break;case 65:break;case 66:break;case 67:this.$={id1:X[ee-2],id2:X[ee],relation:X[ee-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-1],relationTitle1:X[ee-2],relationTitle2:"none"};break;case 69:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-2],relationTitle1:"none",relationTitle2:X[ee-1]};break;case 70:this.$={id1:X[ee-4],id2:X[ee],relation:X[ee-2],relationTitle1:X[ee-3],relationTitle2:X[ee-1]};break;case 71:this.$=J.addNote(X[ee],X[ee-1]);break;case 72:this.$=J.addNote(X[ee]);break;case 73:this.$=X[ee-2],J.defineClass(X[ee-1],X[ee]);break;case 75:this.$=X[ee-2].concat([X[ee]]);break;case 76:J.setDirection("TB");break;case 77:J.setDirection("BT");break;case 78:J.setDirection("RL");break;case 79:J.setDirection("LR");break;case 80:this.$={type1:X[ee-2],type2:X[ee],lineType:X[ee-1]};break;case 81:this.$={type1:"none",type2:X[ee],lineType:X[ee-1]};break;case 82:this.$={type1:X[ee-1],type2:"none",lineType:X[ee]};break;case 83:this.$={type1:"none",type2:"none",lineType:X[ee]};break;case 84:this.$=J.relationType.AGGREGATION;break;case 85:this.$=J.relationType.EXTENSION;break;case 86:this.$=J.relationType.COMPOSITION;break;case 87:this.$=J.relationType.DEPENDENCY;break;case 88:this.$=J.relationType.LOLLIPOP;break;case 89:this.$=J.lineType.LINE;break;case 90:this.$=J.lineType.DOTTED_LINE;break;case 91:case 97:this.$=X[ee-2],J.setClickEvent(X[ee-1],X[ee]);break;case 92:case 98:this.$=X[ee-3],J.setClickEvent(X[ee-2],X[ee-1]),J.setTooltip(X[ee-2],X[ee]);break;case 93:this.$=X[ee-2],J.setLink(X[ee-1],X[ee]);break;case 94:this.$=X[ee-3],J.setLink(X[ee-2],X[ee-1],X[ee]);break;case 95:this.$=X[ee-3],J.setLink(X[ee-2],X[ee-1]),J.setTooltip(X[ee-2],X[ee]);break;case 96:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-2],X[ee]),J.setTooltip(X[ee-3],X[ee-1]);break;case 99:this.$=X[ee-3],J.setClickEvent(X[ee-2],X[ee-1],X[ee]);break;case 100:this.$=X[ee-4],J.setClickEvent(X[ee-3],X[ee-2],X[ee-1]),J.setTooltip(X[ee-3],X[ee]);break;case 101:this.$=X[ee-3],J.setLink(X[ee-2],X[ee]);break;case 102:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-1],X[ee]);break;case 103:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-1]),J.setTooltip(X[ee-3],X[ee]);break;case 104:this.$=X[ee-5],J.setLink(X[ee-4],X[ee-2],X[ee]),J.setTooltip(X[ee-4],X[ee-1]);break;case 105:this.$=X[ee-2],J.setCssStyle(X[ee-1],X[ee]);break;case 106:J.setCssClass(X[ee-1],X[ee]);break;case 107:this.$=[X[ee]];break;case 108:X[ee-2].push(X[ee]),this.$=X[ee-2];break;case 110:this.$=X[ee-1]+X[ee];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:T,83:C,86:S,100:k,102:E,103:A},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(R,[2,5],{8:[1,48]}),{8:[1,49]},t(_,[2,19],{22:[1,50]}),t(_,[2,21]),t(_,[2,22]),t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,27]),t(_,[2,28]),t(_,[2,29]),t(_,[2,30]),{34:[1,51]},{36:[1,52]},t(_,[2,33]),t(_,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:N,70:L,71:I,72:$,73:O,74:D}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(_,[2,65]),t(_,[2,66]),{16:69,60:f,86:S,100:k,102:E},{16:39,17:40,19:70,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:71,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:72,60:f,86:S,100:k,102:E,103:A},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:k,102:E,103:A},{13:z,55:76},{58:78,60:[1,79]},t(_,[2,76]),t(_,[2,77]),t(_,[2,78]),t(_,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:k,102:E,103:A}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:87,60:f,86:S,100:k,102:E,103:A},t(B,[2,133]),t(B,[2,134]),t(B,[2,135]),t(B,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(R,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:T,83:C,86:S,100:k,102:E,103:A}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:x,78:b,82:T,83:C,86:S,100:k,102:E,103:A},t(_,[2,20]),t(_,[2,31]),t(_,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:k,102:E,103:A},{53:92,66:56,67:57,68:P,69:N,70:L,71:I,72:$,73:O,74:D},t(_,[2,64]),{67:93,73:O,74:D},t(H,[2,83],{66:94,68:P,69:N,70:L,71:I,72:$}),t(G,[2,84]),t(G,[2,85]),t(G,[2,86]),t(G,[2,87]),t(G,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:a,54:u,56:h},{16:100,60:f,86:S,100:k,102:E},{41:[1,102],45:101,51:K},{16:104,60:f,86:S,100:k,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:q,50:oe,59:110,60:Q,82:Z,84:111,85:112,86:re,87:ie,88:me,89:te,90:_e},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:q,50:oe,59:124,60:Q,61:[1,125],82:Z,84:111,85:112,86:re,87:ie,88:me,89:te,90:_e},t($e,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:k,102:E,103:A},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Fe,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:k,102:E,103:A}),t(ce,[2,10]),t(he,[2,55],{11:131,12:Fe}),t(R,[2,7]),{9:[1,132]},t(Te,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:k,102:E,103:A},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:k,102:E,103:A},t(H,[2,82],{66:136,68:P,69:N,70:L,71:I,72:$}),t(H,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:a,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:K},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:k,102:E,103:A},t(_,[2,91],{13:[1,147]}),t(_,[2,93],{13:[1,149],77:[1,148]}),t(_,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(_,[2,105],{61:ge}),t(He,[2,107],{85:154,22:q,50:oe,60:Q,82:Z,86:re,87:ie,88:me,89:te,90:_e}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[2,119]),t(_,[2,106]),t(F,[2,71]),t(_,[2,73],{61:ge}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:k,102:E,103:A},t(ce,[2,12]),t(he,[2,56]),{1:[2,4]},t(Te,[2,69]),t(Te,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:k,102:E,103:A},t(H,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:a,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:a,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:a,54:u,56:h},{45:163,51:K},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(_,[2,60]),t(_,[2,92]),t(_,[2,94]),t(_,[2,95],{77:[1,165]}),t(_,[2,98]),t(_,[2,99],{13:[1,166]}),t(_,[2,101],{13:[1,168],77:[1,167]}),{22:q,50:oe,60:Q,82:Z,84:169,85:112,86:re,87:ie,88:me,89:te,90:_e},t(we,[2,110]),t($e,[2,75]),{14:[1,170]},t(ce,[2,11]),t(Te,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:K},t(_,[2,96]),t(_,[2,100]),t(_,[2,102]),t(_,[2,103],{77:[1,174]}),t(He,[2,108],{85:154,22:q,50:oe,60:Q,82:Z,86:re,87:ie,88:me,89:te,90:_e}),t(he,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(_,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:w(function(Ce,ne){if(ne.recoverable)this.trace(Ce);else{var j=new Error(Ce);throw j.hash=ne,j}},"parseError"),parse:w(function(Ce){var ne=this,j=[0],J=[],ue=[null],X=[],fe=this.table,ee="",Ae=0,Re=0,Xe=2,Ne=1,qe=X.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ze)&&(Ke.yy[ze]=this.yy[ze]);De.setInput(Ce,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var st=De.yylloc;X.push(st);var Oe=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function mt(Rt){j.length=j.length-2*Rt,ue.length=ue.length-Rt,X.length=X.length-Rt}w(mt,"popStack");function Le(){var Rt;return Rt=J.pop()||De.lex()||Ne,typeof Rt!="number"&&(Rt instanceof Array&&(J=Rt,Rt=J.pop()),Rt=ne.symbols_[Rt]||Rt),Rt}w(Le,"lex");for(var St,At,lt,zt,It={},ft,xe,Nt,Tt;;){if(At=j[j.length-1],this.defaultActions[At]?lt=this.defaultActions[At]:((St===null||typeof St>"u")&&(St=Le()),lt=fe[At]&&fe[At][St]),typeof lt>"u"||!lt.length||!lt[0]){var yt="";Tt=[];for(ft in fe[At])this.terminals_[ft]&&ft>Xe&&Tt.push("'"+this.terminals_[ft]+"'");De.showPosition?yt="Parse error on line "+(Ae+1)+`: `+De.showPosition()+` Expecting `+Tt.join(", ")+", got '"+(this.terminals_[St]||St)+"'":yt="Parse error on line "+(Ae+1)+": Unexpected "+(St==Ne?"end of input":"'"+(this.terminals_[St]||St)+"'"),this.parseError(yt,{text:De.match,token:this.terminals_[St]||St,line:De.yylineno,loc:st,expected:Tt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+St);switch(lt[0]){case 1:j.push(St),ue.push(De.yytext),X.push(De.yylloc),j.push(lt[1]),St=null,Re=De.yyleng,ee=De.yytext,Ae=De.yylineno,st=De.yylloc;break;case 2:if(xe=this.productions_[lt[1]][1],It.$=ue[ue.length-xe],It._$={first_line:X[X.length-(xe||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(xe||1)].first_column,last_column:X[X.length-1].last_column},Oe&&(It._$.range=[X[X.length-(xe||1)].range[0],X[X.length-1].range[1]]),zt=this.performAction.apply(It,[ee,Re,Ae,Ke.yy,lt[1],ue,X].concat(qe)),typeof zt<"u")return zt;xe&&(j=j.slice(0,-1*xe*2),ue=ue.slice(0,-1*xe),X=X.slice(0,-1*xe)),j.push(this.productions_[lt[1]][0]),ue.push(It.$),X.push(It._$),Nt=fe[j[j.length-2]][j[j.length-1]],j.push(Nt);break;case 3:return!0}}return!0},"parse")},je=(function(){var pe={EOF:1,parseError:w(function(ne,j){if(this.yy.parser)this.yy.parser.parseError(ne,j);else throw new Error(ne)},"parseError"),setInput:w(function(Ce,ne){return this.yy=ne||this.yy||{},this._input=Ce,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var Ce=this._input[0];this.yytext+=Ce,this.yyleng++,this.offset++,this.match+=Ce,this.matched+=Ce;var ne=Ce.match(/(?:\r\n?|\n).*/g);return ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ce},"input"),unput:w(function(Ce){var ne=Ce.length,j=Ce.split(/(?:\r\n?|\n)/g);this._input=Ce+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ne),this.offset-=ne;var J=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),j.length-1&&(this.yylineno-=j.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:j?(j.length===J.length?this.yylloc.first_column:0)+J[J.length-j.length].length-j[0].length:this.yylloc.first_column-ne},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-ne]),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(Ce){this.unput(this.match.slice(Ce))},"less"),pastInput:w(function(){var Ce=this.matched.substr(0,this.matched.length-this.match.length);return(Ce.length>20?"...":"")+Ce.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Ce=this.match;return Ce.length<20&&(Ce+=this._input.substr(0,20-Ce.length)),(Ce.substr(0,20)+(Ce.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Ce=this.pastInput(),ne=new Array(Ce.length+1).join("-");return Ce+this.upcomingInput()+` `+ne+"^"},"showPosition"),test_match:w(function(Ce,ne){var j,J,ue;if(this.options.backtrack_lexer&&(ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),J=Ce[0].match(/(?:\r\n?|\n).*/g),J&&(this.yylineno+=J.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:J?J[J.length-1].length-J[J.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ce[0].length},this.yytext+=Ce[0],this.match+=Ce[0],this.matches=Ce,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ce[0].length),this.matched+=Ce[0],j=this.performAction.call(this,this.yy,this,ne,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),j)return j;if(this._backtrack){for(var X in ue)this[X]=ue[X];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ce,ne,j,J;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),X=0;Xne[0].length)){if(ne=j,J=X,this.options.backtrack_lexer){if(Ce=this.test_match(j,ue[X]),Ce!==!1)return Ce;if(this._backtrack){ne=!1;continue}else return!1}else if(!this.options.flex)break}return ne?(Ce=this.test_match(ne,ue[J]),Ce!==!1?Ce:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var ne=this.next();return ne||this.lex()},"lex"),begin:w(function(ne){this.conditionStack.push(ne)},"begin"),popState:w(function(){var ne=this.conditionStack.length-1;return ne>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(ne){return ne=this.conditionStack.length-1-Math.abs(ne||0),ne>=0?this.conditionStack[ne]:"INITIAL"},"topState"),pushState:w(function(ne){this.begin(ne)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(ne,j,J,ue){switch(J){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return pe})();Me.lexer=je;function le(){this.yy={}}return w(le,"Parser"),le.prototype=Me,Me.Parser=le,new le})();fj.parser=fj;var JWe=fj,z1e=["#","+","~","-",""],xT,V1e=(xT=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Ln(e,Ve());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+xp(this.id);this.memberType==="method"&&(e+=`(${xp(this.parameters.trim())})`,this.returnType&&(e+=" : "+xp(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const s=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(s){const a=s[1]?s[1].trim():"";if(z1e.includes(a)&&(this.visibility=a),this.id=s[2],this.parameters=s[3]?s[3].trim():"",r=s[4]?s[4].trim():"",this.returnType=s[5]?s[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,s=e.substring(0,1),a=e.substring(i-1);z1e.includes(s)&&(this.visibility=s),/[$*]/.exec(a)&&(r=a),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${xp(this.id)}${this.memberType==="method"?`(${xp(this.parameters)})${this.returnType?" : "+xp(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},w(xT,"ClassMember"),xT),nM="classId-",H1e=0,Fm=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),sg,eqe=(sg=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=w(e=>{const r=cee();wt(e).select("svg").selectAll("g").filter(function(){return wt(this).attr("title")!==null}).on("mouseover",s=>{const a=wt(s.currentTarget),o=a.attr("title");if(!o)return;const l=s.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(o0.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),wt(s.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Hi,this.getAccTitle=ts,this.setAccDescription=rs,this.getAccDescription=ns,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getConfig=w(()=>Ve().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Vt.sanitizeText(e,Ve());let n="",i=r;if(r.indexOf("~")>0){const s=r.split("~");i=Fm(s[0]),n=Fm(s[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Vt.sanitizeText(e,Ve());r&&(r=Fm(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Vt.sanitizeText(e,Ve()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const s=Vt.sanitizeText(n,Ve());this.classes.set(s,{id:s,type:i,label:s,text:`${s}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:nM+s+"-"+H1e}),H1e++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Vt.sanitizeText(e,Ve());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",Ri()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){de.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Vt.sanitizeText(e.relationTitle1.trim(),Ve()),e.relationTitle2=Vt.sanitizeText(e.relationTitle2.trim(),Ve()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const s=r.trim();s.startsWith("<<")&&s.endsWith(">>")?i.annotations.push(Fm(s.substring(2,s.length-2))):s.indexOf(")")>0?i.methods.push(new V1e(s,"method")):s&&i.members.push(new V1e(s,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),Fm(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=nM+i),i=this.splitClassNameAndType(i).className;const s=this.classes.get(i);s&&(s.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(s=>{if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)}),this.classes.forEach(s=>{s.cssClasses.includes(n)&&s.styles.push(...r.flatMap(a=>a.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,s=this.classes.get(i);s&&(s.tooltip=Fm(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Ve();e.split(",").forEach(s=>{let a=s;/\d/.exec(s[0])&&(a=nM+a),a=this.splitClassNameAndType(a).className;const o=this.classes.get(a);o&&(o.link=Kr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=Fm(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const s=this.splitClassNameAndType(i).className,a=this.classes.get(s);a&&(a.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Vt.sanitizeText(e,Ve());if(Ve().securityLevel!=="loose"||r===void 0)return;const a=this.splitClassNameAndType(i).className;if(this.classes.has(a)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(a),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Kr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?s[a-1]:void 0,u=a===s.length-1,h=u&&r?r:i[a];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:s}=this.splitClassNameAndType(i),a=this.getClass(s);a.parent=e,this.namespaces.get(e).classes.set(s,a)}for(const i of n){const s=this.getNote(i);s.parent=e,this.namespaces.get(e).notes.set(i,s)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var a,o;const e=[],r=[],n=Ve(),i=((a=n.class)==null?void 0:a.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let s=0;for(const l of this.relations){s++;const u={id:Mb(l.id1,l.id2,{prefix:"id",counter:s}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},w(sg,"ClassDB"),sg),j0r=w(t=>`g.classGroup text { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var ne=this.next();return ne||this.lex()},"lex"),begin:w(function(ne){this.conditionStack.push(ne)},"begin"),popState:w(function(){var ne=this.conditionStack.length-1;return ne>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(ne){return ne=this.conditionStack.length-1-Math.abs(ne||0),ne>=0?this.conditionStack[ne]:"INITIAL"},"topState"),pushState:w(function(ne){this.begin(ne)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(ne,j,J,ue){switch(J){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return pe})();Me.lexer=je;function le(){this.yy={}}return w(le,"Parser"),le.prototype=Me,Me.Parser=le,new le})();yj.parser=yj;var sqe=yj,U1e=["#","+","~","-",""],TT,Y1e=(TT=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Ln(e,Ve());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+kp(this.id);this.memberType==="method"&&(e+=`(${kp(this.parameters.trim())})`,this.returnType&&(e+=" : "+kp(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const s=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(s){const a=s[1]?s[1].trim():"";if(U1e.includes(a)&&(this.visibility=a),this.id=s[2],this.parameters=s[3]?s[3].trim():"",r=s[4]?s[4].trim():"",this.returnType=s[5]?s[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,s=e.substring(0,1),a=e.substring(i-1);U1e.includes(s)&&(this.visibility=s),/[$*]/.exec(a)&&(r=a),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${kp(this.id)}${this.memberType==="method"?`(${kp(this.parameters)})${this.returnType?" : "+kp(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},w(TT,"ClassMember"),TT),oM="classId-",j1e=0,Hm=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),lg,aqe=(lg=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=w(e=>{const r=fee();wt(e).select("svg").selectAll("g").filter(function(){return wt(this).attr("title")!==null}).on("mouseover",s=>{const a=wt(s.currentTarget),o=a.attr("title");if(!o)return;const l=s.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(h0.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),wt(s.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Hi,this.getAccTitle=ts,this.setAccDescription=rs,this.getAccDescription=ns,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getConfig=w(()=>Ve().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Vt.sanitizeText(e,Ve());let n="",i=r;if(r.indexOf("~")>0){const s=r.split("~");i=Hm(s[0]),n=Hm(s[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Vt.sanitizeText(e,Ve());r&&(r=Hm(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Vt.sanitizeText(e,Ve()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const s=Vt.sanitizeText(n,Ve());this.classes.set(s,{id:s,type:i,label:s,text:`${s}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:oM+s+"-"+j1e}),j1e++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Vt.sanitizeText(e,Ve());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",Ri()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){de.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Vt.sanitizeText(e.relationTitle1.trim(),Ve()),e.relationTitle2=Vt.sanitizeText(e.relationTitle2.trim(),Ve()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const s=r.trim();s.startsWith("<<")&&s.endsWith(">>")?i.annotations.push(Hm(s.substring(2,s.length-2))):s.indexOf(")")>0?i.methods.push(new Y1e(s,"method")):s&&i.members.push(new Y1e(s,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),Hm(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=oM+i),i=this.splitClassNameAndType(i).className;const s=this.classes.get(i);s&&(s.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(s=>{if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)}),this.classes.forEach(s=>{s.cssClasses.includes(n)&&s.styles.push(...r.flatMap(a=>a.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,s=this.classes.get(i);s&&(s.tooltip=Hm(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Ve();e.split(",").forEach(s=>{let a=s;/\d/.exec(s[0])&&(a=oM+a),a=this.splitClassNameAndType(a).className;const o=this.classes.get(a);o&&(o.link=Kr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=Hm(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const s=this.splitClassNameAndType(i).className,a=this.classes.get(s);a&&(a.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Vt.sanitizeText(e,Ve());if(Ve().securityLevel!=="loose"||r===void 0)return;const a=this.splitClassNameAndType(i).className;if(this.classes.has(a)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(a),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Kr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?s[a-1]:void 0,u=a===s.length-1,h=u&&r?r:i[a];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:s}=this.splitClassNameAndType(i),a=this.getClass(s);a.parent=e,this.namespaces.get(e).classes.set(s,a)}for(const i of n){const s=this.getNote(i);s.parent=e,this.namespaces.get(e).notes.set(i,s)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var a,o;const e=[],r=[],n=Ve(),i=((a=n.class)==null?void 0:a.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let s=0;for(const l of this.relations){s++;const u={id:_b(l.id1,l.id2,{prefix:"id",counter:s}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},w(lg,"ClassDB"),lg),upr=w(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -4477,13 +4484,13 @@ g.classGroup line { } text-align: center; } - ${S7()} -`,"getStyles"),tqe=j0r,X0r=w((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),K0r=w(function(t,e){return e.db.getClasses()},"getClasses"),Z0r=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:s,layout:a}=Ve();n.db.setDiagramId(e);const o=n.db.getData(),l=S3(e,i);o.type=n.type,o.layoutAlgorithm=n7(a),o.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,o.rankSpacing=(s==null?void 0:s.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await o3(o,l);const u=8;Kr.insertTitle(l,"classDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),sv(l,u,"classDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),rqe={getClasses:K0r,draw:Z0r,getDir:X0r},Q0r={parser:JWe,get db(){return new eqe},renderer:rqe,styles:tqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const J0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:Q0r},Symbol.toStringTag,{value:"Module"}));var epr={parser:JWe,get db(){return new eqe},renderer:rqe,styles:tqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const tpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:epr},Symbol.toStringTag,{value:"Module"}));var pj=(function(){var t=w(function(F,z,V,B){for(V=V||{},B=F.length;B--;V[F[B]]=z);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],s=[1,9],a=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],T=[1,29],C=[1,30],S=[1,31],k=[1,32],E=[1,35],A=[1,36],R=[1,37],_=[1,38],P=[1,34],N=[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],L=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$={trace:w(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:w(function(z,V,B,H,G,W,K){var q=W.length-1;switch(G){case 3:return H.setRootDoc(W[q]),W[q];case 4:this.$=[];break;case 5:W[q]!="nl"&&(W[q-1].push(W[q]),this.$=W[q-1]);break;case 6:case 7:this.$=W[q];break;case 8:this.$="nl";break;case 12:this.$=W[q];break;case 13:const re=W[q-1];re.description=H.trimColon(W[q]),this.$=re;break;case 14:this.$={stmt:"relation",state1:W[q-2],state2:W[q]};break;case 15:const ie=H.trimColon(W[q]);this.$={stmt:"relation",state1:W[q-3],state2:W[q-1],description:ie};break;case 19:this.$={stmt:"state",id:W[q-3],type:"default",description:"",doc:W[q-1]};break;case 20:var oe=W[q],Q=W[q-2].trim();if(W[q].match(":")){var Z=W[q].split(":");oe=Z[0],Q=[Q,Z[1]]}this.$={stmt:"state",id:oe,type:"default",description:Q};break;case 21:this.$={stmt:"state",id:W[q-3],type:"default",description:W[q-5],doc:W[q-1]};break;case 22:this.$={stmt:"state",id:W[q],type:"fork"};break;case 23:this.$={stmt:"state",id:W[q],type:"join"};break;case 24:this.$={stmt:"state",id:W[q],type:"choice"};break;case 25:this.$={stmt:"state",id:H.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[q-1].trim(),note:{position:W[q-2].trim(),text:W[q].trim()}};break;case 29:this.$=W[q].trim(),H.setAccTitle(this.$);break;case 30:case 31:this.$=W[q].trim(),H.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[q-3],url:W[q-2],tooltip:W[q-1]};break;case 33:this.$={stmt:"click",id:W[q-3],url:W[q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[q-1].trim(),classes:W[q].trim()};break;case 36:this.$={stmt:"style",id:W[q-1].trim(),styleClass:W[q].trim()};break;case 37:this.$={stmt:"applyClass",id:W[q-1].trim(),styleClass:W[q].trim()};break;case 38:H.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:H.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:H.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:H.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[q-2].trim(),classes:[W[q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[q-2].trim(),classes:[W[q].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,7]),t(N,[2,8]),t(N,[2,9]),t(N,[2,10]),t(N,[2,11]),t(N,[2,12],{14:[1,40],15:[1,41]}),t(N,[2,16]),{18:[1,42]},t(N,[2,18],{20:[1,43]}),{23:[1,44]},t(N,[2,22]),t(N,[2,23]),t(N,[2,24]),t(N,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(N,[2,28]),{34:[1,49]},{36:[1,50]},t(N,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(L,[2,44],{58:[1,56]}),t(L,[2,45],{58:[1,57]}),t(N,[2,38]),t(N,[2,39]),t(N,[2,40]),t(N,[2,41]),t(N,[2,6]),t(N,[2,13]),{13:58,24:d,57:P},t(N,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(N,[2,29]),t(N,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(N,[2,14],{14:[1,71]}),{4:s,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(N,[2,34]),t(N,[2,35]),t(N,[2,36]),t(N,[2,37]),t(L,[2,46]),t(L,[2,47]),t(N,[2,15]),t(N,[2,19]),t(I,i,{7:78}),t(N,[2,26]),t(N,[2,27]),{5:[1,79]},{5:[1,80]},{4:s,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,32]),t(N,[2,33]),t(N,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:w(function(z,V){if(V.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=V,B}},"parseError"),parse:w(function(z){var V=this,B=[0],H=[],G=[null],W=[],K=this.table,q="",oe=0,Q=0,Z=2,re=1,ie=W.slice.call(arguments,1),me=Object.create(this.lexer),te={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(te.yy[_e]=this.yy[_e]);me.setInput(z,te.yy),te.yy.lexer=me,te.yy.parser=this,typeof me.yylloc>"u"&&(me.yylloc={});var $e=me.yylloc;W.push($e);var Fe=me.options&&me.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(j){B.length=B.length-2*j,G.length=G.length-j,W.length=W.length-j}w(ce,"popStack");function he(){var j;return j=H.pop()||me.lex()||re,typeof j!="number"&&(j instanceof Array&&(H=j,j=H.pop()),j=V.symbols_[j]||j),j}w(he,"lex");for(var Te,ge,He,we,Me={},je,le,pe,Ce;;){if(ge=B[B.length-1],this.defaultActions[ge]?He=this.defaultActions[ge]:((Te===null||typeof Te>"u")&&(Te=he()),He=K[ge]&&K[ge][Te]),typeof He>"u"||!He.length||!He[0]){var ne="";Ce=[];for(je in K[ge])this.terminals_[je]&&je>Z&&Ce.push("'"+this.terminals_[je]+"'");me.showPosition?ne="Parse error on line "+(oe+1)+`: + ${M7()} +`,"getStyles"),oqe=upr,hpr=w((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),dpr=w(function(t,e){return e.db.getClasses()},"getClasses"),fpr=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:s,layout:a}=Ve();n.db.setDiagramId(e);const o=n.db.getData(),l=M3(e,i);o.type=n.type,o.layoutAlgorithm=a7(a),o.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,o.rankSpacing=(s==null?void 0:s.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await u3(o,l);const u=8;Kr.insertTitle(l,"classDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),ov(l,u,"classDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),lqe={getClasses:dpr,draw:fpr,getDir:hpr},ppr={parser:sqe,get db(){return new aqe},renderer:lqe,styles:oqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const gpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ppr},Symbol.toStringTag,{value:"Module"}));var mpr={parser:sqe,get db(){return new aqe},renderer:lqe,styles:oqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const ypr=Object.freeze(Object.defineProperty({__proto__:null,diagram:mpr},Symbol.toStringTag,{value:"Module"}));var vj=(function(){var t=w(function(F,z,V,B){for(V=V||{},B=F.length;B--;V[F[B]]=z);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],s=[1,9],a=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],x=[1,27],b=[1,28],T=[1,29],C=[1,30],S=[1,31],k=[1,32],E=[1,35],A=[1,36],R=[1,37],_=[1,38],P=[1,34],N=[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],L=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$={trace:w(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:w(function(z,V,B,H,G,W,K){var q=W.length-1;switch(G){case 3:return H.setRootDoc(W[q]),W[q];case 4:this.$=[];break;case 5:W[q]!="nl"&&(W[q-1].push(W[q]),this.$=W[q-1]);break;case 6:case 7:this.$=W[q];break;case 8:this.$="nl";break;case 12:this.$=W[q];break;case 13:const re=W[q-1];re.description=H.trimColon(W[q]),this.$=re;break;case 14:this.$={stmt:"relation",state1:W[q-2],state2:W[q]};break;case 15:const ie=H.trimColon(W[q]);this.$={stmt:"relation",state1:W[q-3],state2:W[q-1],description:ie};break;case 19:this.$={stmt:"state",id:W[q-3],type:"default",description:"",doc:W[q-1]};break;case 20:var oe=W[q],Q=W[q-2].trim();if(W[q].match(":")){var Z=W[q].split(":");oe=Z[0],Q=[Q,Z[1]]}this.$={stmt:"state",id:oe,type:"default",description:Q};break;case 21:this.$={stmt:"state",id:W[q-3],type:"default",description:W[q-5],doc:W[q-1]};break;case 22:this.$={stmt:"state",id:W[q],type:"fork"};break;case 23:this.$={stmt:"state",id:W[q],type:"join"};break;case 24:this.$={stmt:"state",id:W[q],type:"choice"};break;case 25:this.$={stmt:"state",id:H.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[q-1].trim(),note:{position:W[q-2].trim(),text:W[q].trim()}};break;case 29:this.$=W[q].trim(),H.setAccTitle(this.$);break;case 30:case 31:this.$=W[q].trim(),H.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[q-3],url:W[q-2],tooltip:W[q-1]};break;case 33:this.$={stmt:"click",id:W[q-3],url:W[q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[q-1].trim(),classes:W[q].trim()};break;case 36:this.$={stmt:"style",id:W[q-1].trim(),styleClass:W[q].trim()};break;case 37:this.$={stmt:"applyClass",id:W[q-1].trim(),styleClass:W[q].trim()};break;case 38:H.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:H.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:H.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:H.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[q-2].trim(),classes:[W[q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[q-2].trim(),classes:[W[q].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,7]),t(N,[2,8]),t(N,[2,9]),t(N,[2,10]),t(N,[2,11]),t(N,[2,12],{14:[1,40],15:[1,41]}),t(N,[2,16]),{18:[1,42]},t(N,[2,18],{20:[1,43]}),{23:[1,44]},t(N,[2,22]),t(N,[2,23]),t(N,[2,24]),t(N,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(N,[2,28]),{34:[1,49]},{36:[1,50]},t(N,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(L,[2,44],{58:[1,56]}),t(L,[2,45],{58:[1,57]}),t(N,[2,38]),t(N,[2,39]),t(N,[2,40]),t(N,[2,41]),t(N,[2,6]),t(N,[2,13]),{13:58,24:d,57:P},t(N,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(N,[2,29]),t(N,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(N,[2,14],{14:[1,71]}),{4:s,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(N,[2,34]),t(N,[2,35]),t(N,[2,36]),t(N,[2,37]),t(L,[2,46]),t(L,[2,47]),t(N,[2,15]),t(N,[2,19]),t(I,i,{7:78}),t(N,[2,26]),t(N,[2,27]),{5:[1,79]},{5:[1,80]},{4:s,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:x,37:b,38:T,41:C,45:S,48:k,51:E,52:A,53:R,54:_,57:P},t(N,[2,32]),t(N,[2,33]),t(N,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:w(function(z,V){if(V.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=V,B}},"parseError"),parse:w(function(z){var V=this,B=[0],H=[],G=[null],W=[],K=this.table,q="",oe=0,Q=0,Z=2,re=1,ie=W.slice.call(arguments,1),me=Object.create(this.lexer),te={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(te.yy[_e]=this.yy[_e]);me.setInput(z,te.yy),te.yy.lexer=me,te.yy.parser=this,typeof me.yylloc>"u"&&(me.yylloc={});var $e=me.yylloc;W.push($e);var Fe=me.options&&me.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(j){B.length=B.length-2*j,G.length=G.length-j,W.length=W.length-j}w(ce,"popStack");function he(){var j;return j=H.pop()||me.lex()||re,typeof j!="number"&&(j instanceof Array&&(H=j,j=H.pop()),j=V.symbols_[j]||j),j}w(he,"lex");for(var Te,ge,He,we,Me={},je,le,pe,Ce;;){if(ge=B[B.length-1],this.defaultActions[ge]?He=this.defaultActions[ge]:((Te===null||typeof Te>"u")&&(Te=he()),He=K[ge]&&K[ge][Te]),typeof He>"u"||!He.length||!He[0]){var ne="";Ce=[];for(je in K[ge])this.terminals_[je]&&je>Z&&Ce.push("'"+this.terminals_[je]+"'");me.showPosition?ne="Parse error on line "+(oe+1)+`: `+me.showPosition()+` Expecting `+Ce.join(", ")+", got '"+(this.terminals_[Te]||Te)+"'":ne="Parse error on line "+(oe+1)+": Unexpected "+(Te==re?"end of input":"'"+(this.terminals_[Te]||Te)+"'"),this.parseError(ne,{text:me.match,token:this.terminals_[Te]||Te,line:me.yylineno,loc:$e,expected:Ce})}if(He[0]instanceof Array&&He.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+Te);switch(He[0]){case 1:B.push(Te),G.push(me.yytext),W.push(me.yylloc),B.push(He[1]),Te=null,Q=me.yyleng,q=me.yytext,oe=me.yylineno,$e=me.yylloc;break;case 2:if(le=this.productions_[He[1]][1],Me.$=G[G.length-le],Me._$={first_line:W[W.length-(le||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(le||1)].first_column,last_column:W[W.length-1].last_column},Fe&&(Me._$.range=[W[W.length-(le||1)].range[0],W[W.length-1].range[1]]),we=this.performAction.apply(Me,[q,Q,oe,te.yy,He[1],G,W].concat(ie)),typeof we<"u")return we;le&&(B=B.slice(0,-1*le*2),G=G.slice(0,-1*le),W=W.slice(0,-1*le)),B.push(this.productions_[He[1]][0]),G.push(Me.$),W.push(Me._$),pe=K[B[B.length-2]][B[B.length-1]],B.push(pe);break;case 3:return!0}}return!0},"parse")},O=(function(){var F={EOF:1,parseError:w(function(V,B){if(this.yy.parser)this.yy.parser.parseError(V,B);else throw new Error(V)},"parseError"),setInput:w(function(z,V){return this.yy=V||this.yy||{},this._input=z,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var z=this._input[0];this.yytext+=z,this.yyleng++,this.offset++,this.match+=z,this.matched+=z;var V=z.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),z},"input"),unput:w(function(z){var V=z.length,B=z.split(/(?:\r\n?|\n)/g);this._input=z+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var H=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 G=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===H.length?this.yylloc.first_column:0)+H[H.length-B.length].length-B[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-V]),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(z){this.unput(this.match.slice(z))},"less"),pastInput:w(function(){var z=this.matched.substr(0,this.matched.length-this.match.length);return(z.length>20?"...":"")+z.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var z=this.match;return z.length<20&&(z+=this._input.substr(0,20-z.length)),(z.substr(0,20)+(z.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var z=this.pastInput(),V=new Array(z.length+1).join("-");return z+this.upcomingInput()+` `+V+"^"},"showPosition"),test_match:w(function(z,V){var B,H,G;if(this.options.backtrack_lexer&&(G={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&&(G.yylloc.range=this.yylloc.range.slice(0))),H=z[0].match(/(?:\r\n?|\n).*/g),H&&(this.yylineno+=H.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:H?H[H.length-1].length-H[H.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+z[0].length},this.yytext+=z[0],this.match+=z[0],this.matches=z,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(z[0].length),this.matched+=z[0],B=this.performAction.call(this,this.yy,this,V,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var W in G)this[W]=G[W];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var z,V,B,H;this._more||(this.yytext="",this.match="");for(var G=this._currentRules(),W=0;WV[0].length)){if(V=B,H=W,this.options.backtrack_lexer){if(z=this.test_match(B,G[W]),z!==!1)return z;if(this._backtrack){V=!1;continue}else return!1}else if(!this.options.flex)break}return V?(z=this.test_match(V,G[H]),z!==!1?z:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var V=this.next();return V||this.lex()},"lex"),begin:w(function(V){this.conditionStack.push(V)},"begin"),popState:w(function(){var V=this.conditionStack.length-1;return V>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(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:w(function(V){this.begin(V)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(V,B,H,G){function W(){const K=B.yytext.indexOf("%%");if(K===0)return!1;if(K>0){const q=B.yytext.slice(0,K),oe=B.yytext.slice(K);oe&&V.lexer.unput(oe),B.yytext=q}return!0}switch(w(W,"processId"),H){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+B.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return W()?(this.popState(),"ID"):void 0;case 66:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),B.yytext=B.yytext.substr(2).trim(),31;case 68:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return W()?24:void 0;case 74:return B.yytext=B.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F})();$.lexer=O;function D(){this.yy={}}return w(D,"Parser"),D.prototype=$,$.Parser=D,new D})();pj.parser=pj;var nqe=pj,rpr="TB",iqe="TB",G1e="dir",H2="state",o2="root",gj="relation",npr="classDef",ipr="style",spr="applyClass",kS="default",sqe="divider",aqe="fill:none",oqe="fill: #333",lqe="c",cqe="markdown",uqe="normal",mV="rect",yV="rectWithTitle",apr="stateStart",opr="stateEnd",W1e="divider",q1e="roundedWithTitle",lpr="note",cpr="noteGroup",Z7="statediagram",upr="state",hpr=`${Z7}-${upr}`,hqe="transition",dpr="note",fpr="note-edge",ppr=`${hqe} ${fpr}`,gpr=`${Z7}-${dpr}`,mpr="cluster",ypr=`${Z7}-${mpr}`,vpr="cluster-alt",bpr=`${Z7}-${vpr}`,dqe="parent",fqe="note",xpr="state",Mne="----",wpr=`${Mne}${fqe}`,U1e=`${Mne}${dqe}`,pqe=w((t,e=iqe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Tpr=w(function(t,e){return e.db.getClasses()},"getClasses"),Cpr=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:s,layout:a}=Ve();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=S3(e,i);o.type=n.type,o.layoutAlgorithm=a,o.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,o.rankSpacing=(s==null?void 0:s.rankSpacing)||50,Ve().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await o3(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){de.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const k=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||k===g)&&(v=S)}),!v){de.warn("⚠️ Could not find node matching text:",g);return}const x=v.parentNode;if(!x){de.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),T=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",T),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}x.replaceChild(b,v),b.appendChild(v),de.info("🔗 Wrapped node in
    tag for:",g,f.url)})}catch(d){de.error("❌ Error injecting clickable links:",d)}Kr.insertTitle(l,"statediagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),sv(l,h,Z7,(s==null?void 0:s.useMaxWidth)??!0)},"draw"),kpr={getClasses:Tpr,draw:Cpr,getDir:pqe},FR=new Map,Np=0;function zR(t="",e=0,r="",n=Mne){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${xpr}-${t}${i}-${e}`}w(zR,"stateDomId");var Spr=w((t,e,r,n,i,s,a,o)=>{de.trace("items",e),e.forEach(l=>{switch(l.stmt){case H2:Ak(t,l,r,n,i,s,a,o);break;case kS:Ak(t,l,r,n,i,s,a,o);break;case gj:{Ak(t,l.state1,r,n,i,s,a,o),Ak(t,l.state2,r,n,i,s,a,o);const u=a==="neo",h={id:"edge"+Np,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:aqe,labelStyle:"",label:Vt.sanitizeText(l.description??"",Ve()),arrowheadStyle:oqe,labelpos:lqe,labelType:cqe,thickness:uqe,classes:hqe,look:a};i.push(h),Np++}break}})},"setupDoc"),Y1e=w((t,e=iqe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function Ek(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const s=r.get(i);s&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...s.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}w(Ek,"insertOrUpdateNode");function gqe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(gqe,"getClassesFromDbInfo");function mqe(t){return(t==null?void 0:t.styles)??[]}w(mqe,"getStylesFromDbInfo");var Ak=w((t,e,r,n,i,s,a,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=gqe(u),d=mqe(u),f=Ve();if(de.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=mV;e.start===!0?y=apr:e.start===!1&&(y=opr),e.type!==kS&&(y=e.type),FR.get(l)||FR.set(l,{id:l,shape:y,description:Vt.sanitizeText(l,f),cssClasses:`${h} ${hpr}`,cssStyles:d});const v=FR.get(l);e.description&&(Array.isArray(v.description)?(v.shape=yV,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=yV,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=mV,v.description=e.description),v.description=Vt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===yV&&(v.type==="group"?v.shape=q1e:v.shape=mV),!v.type&&e.doc&&(de.info("Setting cluster for XCX",l,Y1e(e)),v.type="group",v.isGroup=!0,v.dir=Y1e(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===sqe?W1e:q1e,v.cssClasses=`${v.cssClasses} ${ypr} ${s?bpr:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:zR(l,Np),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:a,labelType:"markdown"};if(x.shape===W1e&&(x.label=""),t&&t.id!=="root"&&(de.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:lpr,label:e.note.text,labelType:"markdown",cssClasses:gpr,cssStyles:[],cssCompiledStyles:[],id:l+wpr+"-"+Np,domId:zR(l,Np,fqe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:a,position:e.note.position},T=l+U1e,C={labelStyle:"",shape:cpr,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+U1e,domId:zR(l,Np,dqe),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position};Np++,C.id=T,b.parentId=T,Ek(n,C,o),Ek(n,b,o),Ek(n,x,o);let S=l,k=b.id;e.note.position==="left of"&&(S=b.id,k=l),i.push({id:S+"-"+k,start:S,end:k,arrowhead:"none",arrowTypeEnd:"",style:aqe,labelStyle:"",classes:ppr,arrowheadStyle:oqe,labelpos:lqe,labelType:cqe,thickness:uqe,look:a})}else Ek(n,x,o)}e.doc&&(de.trace("Adding nodes children "),Spr(e,e.doc,r,n,i,!s,a,o))},"dataFetcher"),Epr=w(()=>{FR.clear(),Np=0},"reset"),il={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},j1e=w(()=>new Map,"newClassesList"),X1e=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),iM=w(t=>JSON.parse(JSON.stringify(t)),"clone"),ay,S1=(ay=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=j1e(),this.documents={root:X1e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ts,this.setAccTitle=Hi,this.getAccDescription=ns,this.setAccDescription=rs,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case H2:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case gj:this.addRelation(i.state1,i.state2,i.description);break;case npr:this.addStyleClass(i.id.trim(),i.classes);break;case ipr:this.handleStyleDef(i);break;case spr:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Ve();Epr(),Ak(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let s=this.getState(i);if(!s){const a=i.trim();this.addState(a),s=this.getState(a)}s&&(s.styles=n.map(a=>{var o;return(o=a.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){de.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===gj){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===H2&&(r.id===il.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==o2&&r.stmt!==H2||!r.doc)return;const i=[];let s=[];for(const a of r.doc)if(a.type===sqe){const o=iM(a);o.doc=iM(s),i.push(o),s=[]}else s.push(a);if(i.length>0&&s.length>0){const a={stmt:H2,id:$Ce(),type:"divider",doc:iM(s)};i.push(iM(a)),r.doc=i}r.doc.forEach(a=>this.docTranslator(r,a,!0))}getRootDocV2(){return this.docTranslator({id:o2,stmt:o2},{id:o2,stmt:o2,doc:this.rootDoc},!0),{id:o2,doc:this.rootDoc}}addState(e,r=kS,n=void 0,i=void 0,s=void 0,a=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))de.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:H2,id:u,descriptions:[],type:r,doc:n,note:s,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(de.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),s){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=s,h.note.text=Vt.sanitizeText(h.note.text,Ve())}a&&(de.info("Setting state classes",u,a),(Array.isArray(a)?a:[a]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(de.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(de.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:X1e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=j1e(),e||(this.links=new Map,Ri())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){de.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),de.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===il.START_NODE?(this.startEndCount++,`${il.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=kS){return e===il.START_NODE?il.START_TYPE:r}endIdIfNeeded(e=""){return e===il.END_NODE?(this.startEndCount++,`${il.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=kS){return e===il.END_NODE?il.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),s=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:Vt.sanitizeText(n,Ve())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),s=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,s),this.addState(a,o),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:n?Vt.sanitizeText(n,Ve()):void 0})}}addDescription(e,r){var s;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(s=n==null?void 0:n.descriptions)==null||s.push(Vt.sanitizeText(i,Ve()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(il.STYLECLASS_SEP).forEach(i=>{const s=i.replace(/([^;]*);/,"$1").trim();if(RegExp(il.COLOR_KEYWORD).exec(i)){const o=s.replace(il.FILL_KEYWORD,il.BG_FILL).replace(il.COLOR_KEYWORD,il.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(s)})}getClasses(){return this.classes}setupToolTips(e){const r=cee();wt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",s=>{var u;const a=wt(s.currentTarget),o=a.attr("title");if(o===null)return;const l=(u=s.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(o0.sanitize(o)),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),wt(s.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var s;let i=this.getState(n);if(!i){const a=n.trim();this.addState(a),i=this.getState(a)}(s=i==null?void 0:i.classes)==null||s.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===G1e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??rpr}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:G1e,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Ve();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:pqe(this.getRootDocV2())}}getConfig(){return Ve().state}},w(ay,"StateDB"),ay.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},ay),Apr=w(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var V=this.next();return V||this.lex()},"lex"),begin:w(function(V){this.conditionStack.push(V)},"begin"),popState:w(function(){var V=this.conditionStack.length-1;return V>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(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:w(function(V){this.begin(V)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(V,B,H,G){function W(){const K=B.yytext.indexOf("%%");if(K===0)return!1;if(K>0){const q=B.yytext.slice(0,K),oe=B.yytext.slice(K);oe&&V.lexer.unput(oe),B.yytext=q}return!0}switch(w(W,"processId"),H){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return W()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+B.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return W()?(this.popState(),"ID"):void 0;case 66:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),B.yytext=B.yytext.substr(2).trim(),31;case 68:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return W()?24:void 0;case 74:return B.yytext=B.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F})();$.lexer=O;function D(){this.yy={}}return w(D,"Parser"),D.prototype=$,$.Parser=D,new D})();vj.parser=vj;var cqe=vj,vpr="TB",uqe="TB",X1e="dir",W2="state",c2="root",bj="relation",bpr="classDef",xpr="style",wpr="applyClass",AS="default",hqe="divider",dqe="fill:none",fqe="fill: #333",pqe="c",gqe="markdown",mqe="normal",xV="rect",wV="rectWithTitle",Tpr="stateStart",Cpr="stateEnd",K1e="divider",Z1e="roundedWithTitle",kpr="note",Spr="noteGroup",eA="statediagram",Epr="state",Apr=`${eA}-${Epr}`,yqe="transition",Mpr="note",Rpr="note-edge",_pr=`${yqe} ${Rpr}`,Lpr=`${eA}-${Mpr}`,Ipr="cluster",Npr=`${eA}-${Ipr}`,Dpr="cluster-alt",Opr=`${eA}-${Dpr}`,vqe="parent",bqe="note",Ppr="state",Ine="----",$pr=`${Ine}${bqe}`,Q1e=`${Ine}${vqe}`,xqe=w((t,e=uqe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Bpr=w(function(t,e){return e.db.getClasses()},"getClasses"),Fpr=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:s,layout:a}=Ve();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=M3(e,i);o.type=n.type,o.layoutAlgorithm=a,o.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,o.rankSpacing=(s==null?void 0:s.rankSpacing)||50,Ve().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await u3(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){de.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const k=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||k===g)&&(v=S)}),!v){de.warn("⚠️ Could not find node matching text:",g);return}const x=v.parentNode;if(!x){de.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),T=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",T),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}x.replaceChild(b,v),b.appendChild(v),de.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){de.error("❌ Error injecting clickable links:",d)}Kr.insertTitle(l,"statediagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),ov(l,h,eA,(s==null?void 0:s.useMaxWidth)??!0)},"draw"),zpr={getClasses:Bpr,draw:Fpr,getDir:xqe},GR=new Map,$p=0;function WR(t="",e=0,r="",n=Ine){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Ppr}-${t}${i}-${e}`}w(WR,"stateDomId");var Vpr=w((t,e,r,n,i,s,a,o)=>{de.trace("items",e),e.forEach(l=>{switch(l.stmt){case W2:_k(t,l,r,n,i,s,a,o);break;case AS:_k(t,l,r,n,i,s,a,o);break;case bj:{_k(t,l.state1,r,n,i,s,a,o),_k(t,l.state2,r,n,i,s,a,o);const u=a==="neo",h={id:"edge"+$p,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:dqe,labelStyle:"",label:Vt.sanitizeText(l.description??"",Ve()),arrowheadStyle:fqe,labelpos:pqe,labelType:gqe,thickness:mqe,classes:yqe,look:a};i.push(h),$p++}break}})},"setupDoc"),J1e=w((t,e=uqe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function Rk(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const s=r.get(i);s&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...s.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}w(Rk,"insertOrUpdateNode");function wqe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(wqe,"getClassesFromDbInfo");function Tqe(t){return(t==null?void 0:t.styles)??[]}w(Tqe,"getStylesFromDbInfo");var _k=w((t,e,r,n,i,s,a,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=wqe(u),d=Tqe(u),f=Ve();if(de.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=xV;e.start===!0?y=Tpr:e.start===!1&&(y=Cpr),e.type!==AS&&(y=e.type),GR.get(l)||GR.set(l,{id:l,shape:y,description:Vt.sanitizeText(l,f),cssClasses:`${h} ${Apr}`,cssStyles:d});const v=GR.get(l);e.description&&(Array.isArray(v.description)?(v.shape=wV,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=wV,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=xV,v.description=e.description),v.description=Vt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===wV&&(v.type==="group"?v.shape=Z1e:v.shape=xV),!v.type&&e.doc&&(de.info("Setting cluster for XCX",l,J1e(e)),v.type="group",v.isGroup=!0,v.dir=J1e(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===hqe?K1e:Z1e,v.cssClasses=`${v.cssClasses} ${Npr} ${s?Opr:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:WR(l,$p),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:a,labelType:"markdown"};if(x.shape===K1e&&(x.label=""),t&&t.id!=="root"&&(de.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:kpr,label:e.note.text,labelType:"markdown",cssClasses:Lpr,cssStyles:[],cssCompiledStyles:[],id:l+$pr+"-"+$p,domId:WR(l,$p,bqe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:a,position:e.note.position},T=l+Q1e,C={labelStyle:"",shape:Spr,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+Q1e,domId:WR(l,$p,vqe),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position};$p++,C.id=T,b.parentId=T,Rk(n,C,o),Rk(n,b,o),Rk(n,x,o);let S=l,k=b.id;e.note.position==="left of"&&(S=b.id,k=l),i.push({id:S+"-"+k,start:S,end:k,arrowhead:"none",arrowTypeEnd:"",style:dqe,labelStyle:"",classes:_pr,arrowheadStyle:fqe,labelpos:pqe,labelType:gqe,thickness:mqe,look:a})}else Rk(n,x,o)}e.doc&&(de.trace("Adding nodes children "),Vpr(e,e.doc,r,n,i,!s,a,o))},"dataFetcher"),Hpr=w(()=>{GR.clear(),$p=0},"reset"),il={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},eye=w(()=>new Map,"newClassesList"),tye=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),lM=w(t=>JSON.parse(JSON.stringify(t)),"clone"),ly,M1=(ly=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=eye(),this.documents={root:tye()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ts,this.setAccTitle=Hi,this.getAccDescription=ns,this.setAccDescription=rs,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case W2:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case bj:this.addRelation(i.state1,i.state2,i.description);break;case bpr:this.addStyleClass(i.id.trim(),i.classes);break;case xpr:this.handleStyleDef(i);break;case wpr:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Ve();Hpr(),_k(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let s=this.getState(i);if(!s){const a=i.trim();this.addState(a),s=this.getState(a)}s&&(s.styles=n.map(a=>{var o;return(o=a.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){de.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===bj){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===W2&&(r.id===il.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==c2&&r.stmt!==W2||!r.doc)return;const i=[];let s=[];for(const a of r.doc)if(a.type===hqe){const o=lM(a);o.doc=lM(s),i.push(o),s=[]}else s.push(a);if(i.length>0&&s.length>0){const a={stmt:W2,id:GCe(),type:"divider",doc:lM(s)};i.push(lM(a)),r.doc=i}r.doc.forEach(a=>this.docTranslator(r,a,!0))}getRootDocV2(){return this.docTranslator({id:c2,stmt:c2},{id:c2,stmt:c2,doc:this.rootDoc},!0),{id:c2,doc:this.rootDoc}}addState(e,r=AS,n=void 0,i=void 0,s=void 0,a=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))de.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:W2,id:u,descriptions:[],type:r,doc:n,note:s,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(de.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),s){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=s,h.note.text=Vt.sanitizeText(h.note.text,Ve())}a&&(de.info("Setting state classes",u,a),(Array.isArray(a)?a:[a]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(de.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(de.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:tye()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=eye(),e||(this.links=new Map,Ri())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){de.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),de.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===il.START_NODE?(this.startEndCount++,`${il.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=AS){return e===il.START_NODE?il.START_TYPE:r}endIdIfNeeded(e=""){return e===il.END_NODE?(this.startEndCount++,`${il.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=AS){return e===il.END_NODE?il.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),s=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:Vt.sanitizeText(n,Ve())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),s=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,s),this.addState(a,o),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:n?Vt.sanitizeText(n,Ve()):void 0})}}addDescription(e,r){var s;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(s=n==null?void 0:n.descriptions)==null||s.push(Vt.sanitizeText(i,Ve()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(il.STYLECLASS_SEP).forEach(i=>{const s=i.replace(/([^;]*);/,"$1").trim();if(RegExp(il.COLOR_KEYWORD).exec(i)){const o=s.replace(il.FILL_KEYWORD,il.BG_FILL).replace(il.COLOR_KEYWORD,il.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(s)})}getClasses(){return this.classes}setupToolTips(e){const r=fee();wt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",s=>{var u;const a=wt(s.currentTarget),o=a.attr("title");if(o===null)return;const l=(u=s.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(h0.sanitize(o)),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),wt(s.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var s;let i=this.getState(n);if(!i){const a=n.trim();this.addState(a),i=this.getState(a)}(s=i==null?void 0:i.classes)==null||s.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===X1e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??vpr}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:X1e,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Ve();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:xqe(this.getRootDocV2())}}getConfig(){return Ve().state}},w(ly,"StateDB"),ly.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},ly),Gpr=w(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -4708,12 +4715,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),yqe=Apr,Mpr=w(t=>t.append("circle").attr("class","start-state").attr("r",Ve().state.sizeUnit).attr("cx",Ve().state.padding+Ve().state.sizeUnit).attr("cy",Ve().state.padding+Ve().state.sizeUnit),"drawStartState"),Rpr=w(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Ve().state.textHeight).attr("class","divider").attr("x2",Ve().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),_pr=w((t,e)=>{const r=t.append("text").attr("x",2*Ve().state.padding).attr("y",Ve().state.textHeight+2*Ve().state.padding).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Ve().state.padding).attr("y",Ve().state.padding).attr("width",n.width+2*Ve().state.padding).attr("height",n.height+2*Ve().state.padding).attr("rx",Ve().state.radius),r},"drawSimpleState"),Lpr=w((t,e)=>{const r=w(function(f,p,g){const m=f.append("tspan").attr("x",2*Ve().state.padding).text(p);g||m.attr("dy",Ve().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Ve().state.padding).attr("y",Ve().state.textHeight+1.3*Ve().state.padding).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=i.height,a=t.append("text").attr("x",Ve().state.padding).attr("y",s+Ve().state.padding*.4+Ve().state.dividerMargin+Ve().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(a,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Ve().state.padding).attr("y1",Ve().state.padding+s+Ve().state.dividerMargin/2).attr("y2",Ve().state.padding+s+Ve().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Ve().state.padding),t.insert("rect",":first-child").attr("x",Ve().state.padding).attr("y",Ve().state.padding).attr("width",d+2*Ve().state.padding).attr("height",h.height+s+2*Ve().state.padding).attr("rx",Ve().state.radius),t},"drawDescrState"),Ipr=w((t,e,r)=>{const n=Ve().state.padding,i=2*Ve().state.padding,s=t.node().getBBox(),a=s.width,o=s.x,l=t.append("text").attr("x",0).attr("y",Ve().state.titleShift).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,a);d===a&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>a&&(f=(a-d)/2+n),Math.abs(o-p.x)a&&(f=o-(h-a)/2);const g=1-Ve().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Ve().state.textHeight+Ve().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=a&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Ve().state.titleShift-Ve().state.textHeight-Ve().state.padding).attr("width",d).attr("height",Ve().state.textHeight*3).attr("rx",Ve().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Ve().state.titleShift-Ve().state.textHeight-Ve().state.padding).attr("width",d).attr("height",p.height+3+2*Ve().state.textHeight).attr("rx",Ve().state.radius),t},"addTitleAndBox"),Npr=w(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Ve().state.sizeUnit+Ve().state.miniPadding).attr("cx",Ve().state.padding+Ve().state.sizeUnit+Ve().state.miniPadding).attr("cy",Ve().state.padding+Ve().state.sizeUnit+Ve().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Ve().state.sizeUnit).attr("cx",Ve().state.padding+Ve().state.sizeUnit+2).attr("cy",Ve().state.padding+Ve().state.sizeUnit+2)),"drawEndState"),Dpr=w((t,e)=>{let r=Ve().state.forkWidth,n=Ve().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Ve().state.padding).attr("y",Ve().state.padding)},"drawForkJoinState"),Opr=w((t,e,r,n)=>{let i=0;const s=n.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let a=t.replace(/\r\n/g,"
    ");a=a.replace(/\n/g,"
    ");const o=a.split(Vt.lineBreakRegex);let l=1.25*Ve().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=s.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Ve().state.noteMargin),d.attr("y",r+i+1.25*Ve().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},"_drawLongText"),Ppr=w((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Ve().state.padding),n=e.append("g"),{textWidth:i,textHeight:s}=Opr(t,0,0,n);return r.attr("height",s+2*Ve().state.noteMargin),r.attr("width",i+Ve().state.noteMargin*2),r},"drawNote"),K1e=w(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&Mpr(i),e.type==="end"&&Npr(i),(e.type==="fork"||e.type==="join")&&Dpr(i,e),e.type==="note"&&Ppr(e.note.text,i),e.type==="divider"&&Rpr(i),e.type==="default"&&e.descriptions.length===0&&_pr(i,e),e.type==="default"&&e.descriptions.length>0&&Lpr(i,e);const s=i.node().getBBox();return n.width=s.width+2*Ve().state.padding,n.height=s.height+2*Ve().state.padding,n},"drawState"),Z1e=0,$pr=w(function(t,e,r){const n=w(function(l){switch(l){case S1.relationType.AGGREGATION:return"aggregation";case S1.relationType.EXTENSION:return"extension";case S1.relationType.COMPOSITION:return"composition";case S1.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,s=g6().x(function(l){return l.x}).y(function(l){return l.y}).curve(m6),a=t.append("path").attr("d",s(i)).attr("id","edge"+Z1e).attr("class","transition");let o="";if(Ve().state.arrowMarkerAbsolute&&(o=$N(!0)),a.attr("marker-end","url("+o+"#"+n(S1.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Kr.calcLabelPosition(e.points),d=Vt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),T=b.node().getBBox();g=Math.max(g,T.width),m=Math.min(m,T.x),de.info(T.x,u,h+f),f===0&&(f=b.node().getBBox().height,de.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,T)=>b.attr("y",h+T*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Ve().state.padding/2).attr("y",h-y/2-Ve().state.padding/2-3.5).attr("width",g+Ve().state.padding).attr("height",y+Ve().state.padding),de.info(v)}Z1e++},"drawEdge"),Ec,vV={},Bpr=w(function(){},"setConf"),Fpr=w(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),zpr=w(function(t,e,r,n){Ec=Ve().state;const i=Ve().securityLevel;let s;i==="sandbox"&&(s=wt("#i"+e));const a=wt(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?s.nodes()[0].contentDocument:document;de.debug("Rendering diagram "+t);const l=a.select(`[id='${e}']`);Fpr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");vqe(u,h,void 0,!1,a,o,n);const d=Ec.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Fs(l,g,m,Ec.useMaxWidth),l.attr("viewBox",`${f.x-Ec.padding} ${f.y-Ec.padding} `+p+" "+g)},"draw"),Vpr=w(t=>t?t.length*Ec.fontSizeFactor:1,"getLabelWidth"),vqe=w((t,e,r,n,i,s,a)=>{const o=new qo({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const T=b.parentElement;let C=0,S=0;T&&(T.parentElement&&(C=T.parentElement.getBBox().width),S=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",C-S-8)})):de.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(de.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),$pr(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Ec.padding,y.height=m.height+2*Ec.padding,de.debug("Doc rendered",y,o),y},"renderDoc"),Hpr={setConf:Bpr,draw:zpr},Gpr={parser:nqe,get db(){return new S1(1)},renderer:Hpr,styles:yqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Wpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gpr},Symbol.toStringTag,{value:"Module"}));var qpr={parser:nqe,get db(){return new S1(2)},renderer:kpr,styles:yqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Upr=Object.freeze(Object.defineProperty({__proto__:null,diagram:qpr},Symbol.toStringTag,{value:"Module"}));var mj=(function(){var t=w(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],s=[1,12],a=[1,13],o=[1,14],l={trace:w(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:w(function(f,p,g,m,y,v,x){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:s,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:s,17:a,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:w(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:w(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",T=0,C=0,S=2,k=1,E=v.slice.call(arguments,1),A=Object.create(this.lexer),R={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(R.yy[_]=this.yy[_]);A.setInput(f,R.yy),R.yy.lexer=A,R.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var P=A.yylloc;v.push(P);var N=A.options&&A.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(K){g.length=g.length-2*K,y.length=y.length-K,v.length=v.length-K}w(L,"popStack");function I(){var K;return K=m.pop()||A.lex()||k,typeof K!="number"&&(K instanceof Array&&(m=K,K=m.pop()),K=p.symbols_[K]||K),K}w(I,"lex");for(var $,O,D,F,z={},V,B,H,G;;){if(O=g[g.length-1],this.defaultActions[O]?D=this.defaultActions[O]:(($===null||typeof $>"u")&&($=I()),D=x[O]&&x[O][$]),typeof D>"u"||!D.length||!D[0]){var W="";G=[];for(V in x[O])this.terminals_[V]&&V>S&&G.push("'"+this.terminals_[V]+"'");A.showPosition?W="Parse error on line "+(T+1)+`: +`,"getStyles"),Cqe=Gpr,Wpr=w(t=>t.append("circle").attr("class","start-state").attr("r",Ve().state.sizeUnit).attr("cx",Ve().state.padding+Ve().state.sizeUnit).attr("cy",Ve().state.padding+Ve().state.sizeUnit),"drawStartState"),qpr=w(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Ve().state.textHeight).attr("class","divider").attr("x2",Ve().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Upr=w((t,e)=>{const r=t.append("text").attr("x",2*Ve().state.padding).attr("y",Ve().state.textHeight+2*Ve().state.padding).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Ve().state.padding).attr("y",Ve().state.padding).attr("width",n.width+2*Ve().state.padding).attr("height",n.height+2*Ve().state.padding).attr("rx",Ve().state.radius),r},"drawSimpleState"),Ypr=w((t,e)=>{const r=w(function(f,p,g){const m=f.append("tspan").attr("x",2*Ve().state.padding).text(p);g||m.attr("dy",Ve().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Ve().state.padding).attr("y",Ve().state.textHeight+1.3*Ve().state.padding).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=i.height,a=t.append("text").attr("x",Ve().state.padding).attr("y",s+Ve().state.padding*.4+Ve().state.dividerMargin+Ve().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(a,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Ve().state.padding).attr("y1",Ve().state.padding+s+Ve().state.dividerMargin/2).attr("y2",Ve().state.padding+s+Ve().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Ve().state.padding),t.insert("rect",":first-child").attr("x",Ve().state.padding).attr("y",Ve().state.padding).attr("width",d+2*Ve().state.padding).attr("height",h.height+s+2*Ve().state.padding).attr("rx",Ve().state.radius),t},"drawDescrState"),jpr=w((t,e,r)=>{const n=Ve().state.padding,i=2*Ve().state.padding,s=t.node().getBBox(),a=s.width,o=s.x,l=t.append("text").attr("x",0).attr("y",Ve().state.titleShift).attr("font-size",Ve().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,a);d===a&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>a&&(f=(a-d)/2+n),Math.abs(o-p.x)a&&(f=o-(h-a)/2);const g=1-Ve().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Ve().state.textHeight+Ve().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=a&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Ve().state.titleShift-Ve().state.textHeight-Ve().state.padding).attr("width",d).attr("height",Ve().state.textHeight*3).attr("rx",Ve().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Ve().state.titleShift-Ve().state.textHeight-Ve().state.padding).attr("width",d).attr("height",p.height+3+2*Ve().state.textHeight).attr("rx",Ve().state.radius),t},"addTitleAndBox"),Xpr=w(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Ve().state.sizeUnit+Ve().state.miniPadding).attr("cx",Ve().state.padding+Ve().state.sizeUnit+Ve().state.miniPadding).attr("cy",Ve().state.padding+Ve().state.sizeUnit+Ve().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Ve().state.sizeUnit).attr("cx",Ve().state.padding+Ve().state.sizeUnit+2).attr("cy",Ve().state.padding+Ve().state.sizeUnit+2)),"drawEndState"),Kpr=w((t,e)=>{let r=Ve().state.forkWidth,n=Ve().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Ve().state.padding).attr("y",Ve().state.padding)},"drawForkJoinState"),Zpr=w((t,e,r,n)=>{let i=0;const s=n.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let a=t.replace(/\r\n/g,"
    ");a=a.replace(/\n/g,"
    ");const o=a.split(Vt.lineBreakRegex);let l=1.25*Ve().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=s.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Ve().state.noteMargin),d.attr("y",r+i+1.25*Ve().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},"_drawLongText"),Qpr=w((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Ve().state.padding),n=e.append("g"),{textWidth:i,textHeight:s}=Zpr(t,0,0,n);return r.attr("height",s+2*Ve().state.noteMargin),r.attr("width",i+Ve().state.noteMargin*2),r},"drawNote"),rye=w(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&Wpr(i),e.type==="end"&&Xpr(i),(e.type==="fork"||e.type==="join")&&Kpr(i,e),e.type==="note"&&Qpr(e.note.text,i),e.type==="divider"&&qpr(i),e.type==="default"&&e.descriptions.length===0&&Upr(i,e),e.type==="default"&&e.descriptions.length>0&&Ypr(i,e);const s=i.node().getBBox();return n.width=s.width+2*Ve().state.padding,n.height=s.height+2*Ve().state.padding,n},"drawState"),nye=0,Jpr=w(function(t,e,r){const n=w(function(l){switch(l){case M1.relationType.AGGREGATION:return"aggregation";case M1.relationType.EXTENSION:return"extension";case M1.relationType.COMPOSITION:return"composition";case M1.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,s=v6().x(function(l){return l.x}).y(function(l){return l.y}).curve(b6),a=t.append("path").attr("d",s(i)).attr("id","edge"+nye).attr("class","transition");let o="";if(Ve().state.arrowMarkerAbsolute&&(o=zN(!0)),a.attr("marker-end","url("+o+"#"+n(M1.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Kr.calcLabelPosition(e.points),d=Vt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),T=b.node().getBBox();g=Math.max(g,T.width),m=Math.min(m,T.x),de.info(T.x,u,h+f),f===0&&(f=b.node().getBBox().height,de.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,T)=>b.attr("y",h+T*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Ve().state.padding/2).attr("y",h-y/2-Ve().state.padding/2-3.5).attr("width",g+Ve().state.padding).attr("height",y+Ve().state.padding),de.info(v)}nye++},"drawEdge"),Rc,TV={},egr=w(function(){},"setConf"),tgr=w(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),rgr=w(function(t,e,r,n){Rc=Ve().state;const i=Ve().securityLevel;let s;i==="sandbox"&&(s=wt("#i"+e));const a=wt(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?s.nodes()[0].contentDocument:document;de.debug("Rendering diagram "+t);const l=a.select(`[id='${e}']`);tgr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");kqe(u,h,void 0,!1,a,o,n);const d=Rc.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Fs(l,g,m,Rc.useMaxWidth),l.attr("viewBox",`${f.x-Rc.padding} ${f.y-Rc.padding} `+p+" "+g)},"draw"),ngr=w(t=>t?t.length*Rc.fontSizeFactor:1,"getLabelWidth"),kqe=w((t,e,r,n,i,s,a)=>{const o=new qo({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const T=b.parentElement;let C=0,S=0;T&&(T.parentElement&&(C=T.parentElement.getBBox().width),S=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",C-S-8)})):de.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(de.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Jpr(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Rc.padding,y.height=m.height+2*Rc.padding,de.debug("Doc rendered",y,o),y},"renderDoc"),igr={setConf:egr,draw:rgr},sgr={parser:cqe,get db(){return new M1(1)},renderer:igr,styles:Cqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const agr=Object.freeze(Object.defineProperty({__proto__:null,diagram:sgr},Symbol.toStringTag,{value:"Module"}));var ogr={parser:cqe,get db(){return new M1(2)},renderer:zpr,styles:Cqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const lgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ogr},Symbol.toStringTag,{value:"Module"}));var xj=(function(){var t=w(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],s=[1,12],a=[1,13],o=[1,14],l={trace:w(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:w(function(f,p,g,m,y,v,x){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:s,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:s,17:a,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:w(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:w(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",T=0,C=0,S=2,k=1,E=v.slice.call(arguments,1),A=Object.create(this.lexer),R={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(R.yy[_]=this.yy[_]);A.setInput(f,R.yy),R.yy.lexer=A,R.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var P=A.yylloc;v.push(P);var N=A.options&&A.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(K){g.length=g.length-2*K,y.length=y.length-K,v.length=v.length-K}w(L,"popStack");function I(){var K;return K=m.pop()||A.lex()||k,typeof K!="number"&&(K instanceof Array&&(m=K,K=m.pop()),K=p.symbols_[K]||K),K}w(I,"lex");for(var $,O,D,F,z={},V,B,H,G;;){if(O=g[g.length-1],this.defaultActions[O]?D=this.defaultActions[O]:(($===null||typeof $>"u")&&($=I()),D=x[O]&&x[O][$]),typeof D>"u"||!D.length||!D[0]){var W="";G=[];for(V in x[O])this.terminals_[V]&&V>S&&G.push("'"+this.terminals_[V]+"'");A.showPosition?W="Parse error on line "+(T+1)+`: `+A.showPosition()+` Expecting `+G.join(", ")+", got '"+(this.terminals_[$]||$)+"'":W="Parse error on line "+(T+1)+": Unexpected "+($==k?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(W,{text:A.match,token:this.terminals_[$]||$,line:A.yylineno,loc:P,expected:G})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+$);switch(D[0]){case 1:g.push($),y.push(A.yytext),v.push(A.yylloc),g.push(D[1]),$=null,C=A.yyleng,b=A.yytext,T=A.yylineno,P=A.yylloc;break;case 2:if(B=this.productions_[D[1]][1],z.$=y[y.length-B],z._$={first_line:v[v.length-(B||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(B||1)].first_column,last_column:v[v.length-1].last_column},N&&(z._$.range=[v[v.length-(B||1)].range[0],v[v.length-1].range[1]]),F=this.performAction.apply(z,[b,C,T,R.yy,D[1],y,v].concat(E)),typeof F<"u")return F;B&&(g=g.slice(0,-1*B*2),y=y.slice(0,-1*B),v=v.slice(0,-1*B)),g.push(this.productions_[D[1]][0]),y.push(z.$),v.push(z._$),H=x[g[g.length-2]][g[g.length-1]],g.push(H);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:w(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:w(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:w(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more: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(f){this.unput(this.match.slice(f))},"less"),pastInput:w(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+p+"^"},"showPosition"),test_match:w(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var p=this.next();return p||this.lex()},"lex"),begin:w(function(p){this.conditionStack.push(p)},"begin"),popState:w(function(){var p=this.conditionStack.length-1;return p>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(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:w(function(p){this.begin(p)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return w(h,"Parser"),h.prototype=l,l.Parser=h,new h})();mj.parser=mj;var Ypr=mj,H5="",Rne=[],yE=[],vE=[],jpr=w(function(){Rne.length=0,yE.length=0,H5="",vE.length=0,Ri()},"clear"),Xpr=w(function(t){H5=t,Rne.push(t)},"addSection"),Kpr=w(function(){return Rne},"getSections"),Zpr=w(function(){let t=Q1e();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Jpr=w(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const s=i.map(o=>o.trim()),a={section:H5,type:H5,people:s,task:t,score:n};vE.push(a)},"addTask"),egr=w(function(t){const e={section:H5,type:H5,description:t,task:t,classes:[]};yE.push(e)},"addTaskOrg"),Q1e=w(function(){const t=w(function(r){return vE[r].processed},"compileTask");let e=!0;for(const[r,n]of vE.entries())t(r),e=e&&n.processed;return e},"compileTasks"),tgr=w(function(){return Qpr()},"getActors"),J1e={getConfig:w(()=>Ve().journey,"getConfig"),clear:jpr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:Xpr,getSections:Kpr,getTasks:Zpr,addTask:Jpr,addTaskOrg:egr,getActors:tgr},rgr=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var p=this.next();return p||this.lex()},"lex"),begin:w(function(p){this.conditionStack.push(p)},"begin"),popState:w(function(){var p=this.conditionStack.length-1;return p>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(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:w(function(p){this.begin(p)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return w(h,"Parser"),h.prototype=l,l.Parser=h,new h})();xj.parser=xj;var cgr=xj,q5="",Nne=[],xE=[],wE=[],ugr=w(function(){Nne.length=0,xE.length=0,q5="",wE.length=0,Ri()},"clear"),hgr=w(function(t){q5=t,Nne.push(t)},"addSection"),dgr=w(function(){return Nne},"getSections"),fgr=w(function(){let t=iye();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),ggr=w(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const s=i.map(o=>o.trim()),a={section:q5,type:q5,people:s,task:t,score:n};wE.push(a)},"addTask"),mgr=w(function(t){const e={section:q5,type:q5,description:t,task:t,classes:[]};xE.push(e)},"addTaskOrg"),iye=w(function(){const t=w(function(r){return wE[r].processed},"compileTask");let e=!0;for(const[r,n]of wE.entries())t(r),e=e&&n.processed;return e},"compileTasks"),ygr=w(function(){return pgr()},"getActors"),sye={getConfig:w(()=>Ve().journey,"getConfig"),clear:ugr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:hgr,getSections:dgr,getTasks:fgr,addTask:ggr,addTaskOrg:mgr,getActors:ygr},vgr=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -4845,13 +4852,13 @@ Expecting `+G.join(", ")+", got '"+(this.terminals_[$]||$)+"'":W="Parse error on .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } - ${S7()} -`,"getStyles"),ngr=rgr,_ne=w(function(t,e){return hO(t,e)},"drawRect"),igr=w(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function s(l){const u=a5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}w(s,"smile");function a(l){const u=a5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}w(a,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return w(o,"ambivalent"),e.score>3?s(i):e.score<3?a(i):o(i),n},"drawFace"),bqe=w(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),xqe=w(function(t,e){return xXt(t,e)},"drawText"),sgr=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+o)}w(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,xqe(t,e)},"drawLabel"),agr=w(function(t,e,r){const n=t.append("g"),i=jc();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,_ne(n,i),wqe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),yj=-1,ogr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");yj++,s.append("line").attr("id",n+"-task"+yj).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"),igr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=jc();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,_ne(s,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};bqe(s,d),l+=10}),wqe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),lgr=w(function(t,e){sIe(t,e)},"drawBackgroundRect"),wqe=(function(){function t(i,s,a,o,l,u,h,d){const f=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const s=Wf[i].color,a={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:Wf[i].position};bE.drawCircle(t,a);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=bE.drawText(t,f).node().getBoundingClientRect().width;g>VR&&g>e.leftMargin-g&&(VR=g)}),n+=Math.max(20,u.length*20)})}w(Tqe,"drawActorLegend");var Uu=Ve().journey,Mp=0,hgr=w(function(t,e,r,n){const i=Ve(),s=i.journey.titleColor,a=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=wt("#i"+e));const h=wt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");au.init();const d=h.select("#"+e);bE.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const T in Wf)delete Wf[T];let m=0;g.forEach(T=>{Wf[T]={color:Uu.actorColours[m%Uu.actorColours.length],position:m},m++}),Tqe(d),Mp=Uu.leftMargin+VR,au.insert(0,0,Mp,Object.keys(Wf).length*50),dgr(d,f,0,e);const y=au.getBounds();p&&d.append("text").text(p).attr("x",Mp).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",s).attr("font-family",o);const v=y.stopy-y.starty+2*Uu.diagramMarginY,x=Mp+y.stopx+2*Uu.diagramMarginX;Fs(d,v,x,Uu.useMaxWidth),d.append("line").attr("x1",Mp).attr("y1",Uu.height*4).attr("x2",x-Mp-4).attr("y2",Uu.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),au={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:w(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=Ve().journey,s=this;let a=0;function o(l){return w(function(h){a++;const d=s.sequenceItems.length-a+1;s.updateVal(h,"starty",e-d*i.boxMargin,Math.min),s.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),s.updateVal(au.data,"startx",t-d*i.boxMargin,Math.min),s.updateVal(au.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(s.updateVal(h,"startx",t-d*i.boxMargin,Math.min),s.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),s.updateVal(au.data,"starty",e-d*i.boxMargin,Math.min),s.updateVal(au.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}w(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:w(function(t,e,r,n){const i=Math.min(t,r),s=Math.max(t,r),a=Math.min(e,n),o=Math.max(e,n);this.updateVal(au.data,"startx",i,Math.min),this.updateVal(au.data,"starty",a,Math.min),this.updateVal(au.data,"stopx",s,Math.max),this.updateVal(au.data,"stopy",o,Math.max),this.updateBounds(i,a,s,o)},"insert"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return this.data},"getBounds")},bV=Uu.sectionFills,eye=Uu.sectionColours,dgr=w(function(t,e,r,n){const i=Ve().journey;let s="";const a=i.height*2+i.diagramMarginY,o=r+a;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(s!==p.section){u=bV[l%bV.length],d=l%bV.length,h=eye[l%eye.length];let m=0;const y=p.section;for(let x=f;x(Wf[y]&&(m[y]=Wf[y]),m),{});p.x=f*i.taskMargin+f*i.width+Mp,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,bE.drawTask(t,p,i,n),au.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),tye={setConf:ugr,draw:hgr},fgr={parser:Ypr,db:J1e,renderer:tye,styles:ngr,init:w(t=>{tye.setConf(t.journey),J1e.clear()},"init")};const pgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:fgr},Symbol.toStringTag,{value:"Module"}));var vj=(function(){var t=w(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],s=[1,15],a=[1,16],o=[1,19],l=[1,20],u={trace:w(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:w(function(p,g,m,y,v,x,b){var T=x.length-1;switch(v){case 1:return x[T-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[T-1].push(x[T]),this.$=x[T-1];break;case 7:case 8:this.$=x[T];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[T].substr(6)),this.$=x[T].substr(6);break;case 12:this.$=x[T].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[T].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[T].substr(8)),this.$=x[T].substr(8);break;case 18:y.addTask(x[T],0,""),this.$=x[T];break;case 19:y.addEvent(x[T].substr(2)),this.$=x[T];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:s,20:a,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:s,20:a,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:w(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:w(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,T="",C=0,S=0,k=2,E=1,A=x.slice.call(arguments,1),R=Object.create(this.lexer),_={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(_.yy[P]=this.yy[P]);R.setInput(p,_.yy),_.yy.lexer=R,_.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var N=R.yylloc;x.push(N);var L=R.options&&R.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(q){m.length=m.length-2*q,v.length=v.length-q,x.length=x.length-q}w(I,"popStack");function $(){var q;return q=y.pop()||R.lex()||E,typeof q!="number"&&(q instanceof Array&&(y=q,q=y.pop()),q=g.symbols_[q]||q),q}w($,"lex");for(var O,D,F,z,V={},B,H,G,W;;){if(D=m[m.length-1],this.defaultActions[D]?F=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=$()),F=b[D]&&b[D][O]),typeof F>"u"||!F.length||!F[0]){var K="";W=[];for(B in b[D])this.terminals_[B]&&B>k&&W.push("'"+this.terminals_[B]+"'");R.showPosition?K="Parse error on line "+(C+1)+`: + ${M7()} +`,"getStyles"),bgr=vgr,Dne=w(function(t,e){return pO(t,e)},"drawRect"),xgr=w(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function s(l){const u=l5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}w(s,"smile");function a(l){const u=l5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}w(a,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return w(o,"ambivalent"),e.score>3?s(i):e.score<3?a(i):o(i),n},"drawFace"),Sqe=w(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Eqe=w(function(t,e){return PXt(t,e)},"drawText"),wgr=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+o)}w(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Eqe(t,e)},"drawLabel"),Tgr=w(function(t,e,r){const n=t.append("g"),i=Zc();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Dne(n,i),Aqe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),wj=-1,Cgr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");wj++,s.append("line").attr("id",n+"-task"+wj).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"),xgr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Zc();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,Dne(s,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};Sqe(s,d),l+=10}),Aqe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),kgr=w(function(t,e){hIe(t,e)},"drawBackgroundRect"),Aqe=(function(){function t(i,s,a,o,l,u,h,d){const f=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const s=jf[i].color,a={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:jf[i].position};TE.drawCircle(t,a);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=TE.drawText(t,f).node().getBoundingClientRect().width;g>qR&&g>e.leftMargin-g&&(qR=g)}),n+=Math.max(20,u.length*20)})}w(Mqe,"drawActorLegend");var Xu=Ve().journey,Ip=0,Agr=w(function(t,e,r,n){const i=Ve(),s=i.journey.titleColor,a=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=wt("#i"+e));const h=wt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");cu.init();const d=h.select("#"+e);TE.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const T in jf)delete jf[T];let m=0;g.forEach(T=>{jf[T]={color:Xu.actorColours[m%Xu.actorColours.length],position:m},m++}),Mqe(d),Ip=Xu.leftMargin+qR,cu.insert(0,0,Ip,Object.keys(jf).length*50),Mgr(d,f,0,e);const y=cu.getBounds();p&&d.append("text").text(p).attr("x",Ip).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",s).attr("font-family",o);const v=y.stopy-y.starty+2*Xu.diagramMarginY,x=Ip+y.stopx+2*Xu.diagramMarginX;Fs(d,v,x,Xu.useMaxWidth),d.append("line").attr("x1",Ip).attr("y1",Xu.height*4).attr("x2",x-Ip-4).attr("y2",Xu.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),cu={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:w(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=Ve().journey,s=this;let a=0;function o(l){return w(function(h){a++;const d=s.sequenceItems.length-a+1;s.updateVal(h,"starty",e-d*i.boxMargin,Math.min),s.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),s.updateVal(cu.data,"startx",t-d*i.boxMargin,Math.min),s.updateVal(cu.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(s.updateVal(h,"startx",t-d*i.boxMargin,Math.min),s.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),s.updateVal(cu.data,"starty",e-d*i.boxMargin,Math.min),s.updateVal(cu.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}w(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:w(function(t,e,r,n){const i=Math.min(t,r),s=Math.max(t,r),a=Math.min(e,n),o=Math.max(e,n);this.updateVal(cu.data,"startx",i,Math.min),this.updateVal(cu.data,"starty",a,Math.min),this.updateVal(cu.data,"stopx",s,Math.max),this.updateVal(cu.data,"stopy",o,Math.max),this.updateBounds(i,a,s,o)},"insert"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return this.data},"getBounds")},CV=Xu.sectionFills,aye=Xu.sectionColours,Mgr=w(function(t,e,r,n){const i=Ve().journey;let s="";const a=i.height*2+i.diagramMarginY,o=r+a;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(s!==p.section){u=CV[l%CV.length],d=l%CV.length,h=aye[l%aye.length];let m=0;const y=p.section;for(let x=f;x(jf[y]&&(m[y]=jf[y]),m),{});p.x=f*i.taskMargin+f*i.width+Ip,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,TE.drawTask(t,p,i,n),cu.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),oye={setConf:Egr,draw:Agr},Rgr={parser:cgr,db:sye,renderer:oye,styles:bgr,init:w(t=>{oye.setConf(t.journey),sye.clear()},"init")};const _gr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Rgr},Symbol.toStringTag,{value:"Module"}));var Tj=(function(){var t=w(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],s=[1,15],a=[1,16],o=[1,19],l=[1,20],u={trace:w(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:w(function(p,g,m,y,v,x,b){var T=x.length-1;switch(v){case 1:return x[T-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[T-1].push(x[T]),this.$=x[T-1];break;case 7:case 8:this.$=x[T];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[T].substr(6)),this.$=x[T].substr(6);break;case 12:this.$=x[T].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[T].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[T].substr(8)),this.$=x[T].substr(8);break;case 18:y.addTask(x[T],0,""),this.$=x[T];break;case 19:y.addEvent(x[T].substr(2)),this.$=x[T];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:s,20:a,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:s,20:a,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:w(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:w(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,T="",C=0,S=0,k=2,E=1,A=x.slice.call(arguments,1),R=Object.create(this.lexer),_={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(_.yy[P]=this.yy[P]);R.setInput(p,_.yy),_.yy.lexer=R,_.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var N=R.yylloc;x.push(N);var L=R.options&&R.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(q){m.length=m.length-2*q,v.length=v.length-q,x.length=x.length-q}w(I,"popStack");function $(){var q;return q=y.pop()||R.lex()||E,typeof q!="number"&&(q instanceof Array&&(y=q,q=y.pop()),q=g.symbols_[q]||q),q}w($,"lex");for(var O,D,F,z,V={},B,H,G,W;;){if(D=m[m.length-1],this.defaultActions[D]?F=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=$()),F=b[D]&&b[D][O]),typeof F>"u"||!F.length||!F[0]){var K="";W=[];for(B in b[D])this.terminals_[B]&&B>k&&W.push("'"+this.terminals_[B]+"'");R.showPosition?K="Parse error on line "+(C+1)+`: `+R.showPosition()+` Expecting `+W.join(", ")+", got '"+(this.terminals_[O]||O)+"'":K="Parse error on line "+(C+1)+": Unexpected "+(O==E?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(K,{text:R.match,token:this.terminals_[O]||O,line:R.yylineno,loc:N,expected:W})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+O);switch(F[0]){case 1:m.push(O),v.push(R.yytext),x.push(R.yylloc),m.push(F[1]),O=null,S=R.yyleng,T=R.yytext,C=R.yylineno,N=R.yylloc;break;case 2:if(H=this.productions_[F[1]][1],V.$=v[v.length-H],V._$={first_line:x[x.length-(H||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(H||1)].first_column,last_column:x[x.length-1].last_column},L&&(V._$.range=[x[x.length-(H||1)].range[0],x[x.length-1].range[1]]),z=this.performAction.apply(V,[T,S,C,_.yy,F[1],v,x].concat(A)),typeof z<"u")return z;H&&(m=m.slice(0,-1*H*2),v=v.slice(0,-1*H),x=x.slice(0,-1*H)),m.push(this.productions_[F[1]][0]),v.push(V.$),x.push(V._$),G=b[m[m.length-2]][m[m.length-1]],m.push(G);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:w(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:w(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:w(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more: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(p){this.unput(this.match.slice(p))},"less"),pastInput:w(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:w(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),x=0;xg[0].length)){if(g=m,y=x,this.options.backtrack_lexer){if(p=this.test_match(m,v[x]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var g=this.next();return g||this.lex()},"lex"),begin:w(function(g){this.conditionStack.push(g)},"begin"),popState:w(function(){var g=this.conditionStack.length-1;return g>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(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:w(function(g){this.begin(g)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return w(d,"Parser"),d.prototype=u,u.Parser=d,new d})();vj.parser=vj;var ggr=vj,Cqe={};ON(Cqe,{addEvent:()=>Nqe,addSection:()=>Rqe,addTask:()=>Iqe,addTaskOrg:()=>Dqe,clear:()=>Eqe,default:()=>mgr,getCommonDb:()=>Sqe,getDirection:()=>Mqe,getSections:()=>_qe,getTasks:()=>Lqe,setDirection:()=>Aqe});var G5="",kqe=0,Lne="LR",Ine=[],zI=[],W5=[],Sqe=w(()=>xK,"getCommonDb"),Eqe=w(function(){Ine.length=0,zI.length=0,G5="",W5.length=0,Lne="LR",Ri()},"clear"),Aqe=w(function(t){Lne=t},"setDirection"),Mqe=w(function(){return Lne},"getDirection"),Rqe=w(function(t){G5=t,Ine.push(t)},"addSection"),_qe=w(function(){return Ine},"getSections"),Lqe=w(function(){let t=rye();const e=100;let r=0;for(;!t&&rr.id===kqe-1).events.push(t)},"addEvent"),Dqe=w(function(t){const e={section:G5,type:G5,description:t,task:t,classes:[]};zI.push(e)},"addTaskOrg"),rye=w(function(){const t=w(function(r){return W5[r].processed},"compileTask");let e=!0;for(const[r,n]of W5.entries())t(r),e=e&&n.processed;return e},"compileTasks"),mgr={clear:Eqe,getCommonDb:Sqe,getDirection:Mqe,setDirection:Aqe,addSection:Rqe,getSections:_qe,getTasks:Lqe,addTask:Iqe,addTaskOrg:Dqe,addEvent:Nqe},Oqe=0,RP=w(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),ygr=w(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function s(l){const u=a5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}w(s,"smile");function a(l){const u=a5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}w(a,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return w(o,"ambivalent"),e.score>3?s(i):e.score<3?a(i):o(i),n},"drawFace"),vgr=w(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Pqe=w(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),bgr=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+o)}w(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Pqe(t,e)},"drawLabel"),xgr=w(function(t,e,r){const n=t.append("g"),i=Nne();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,RP(n,i),$qe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),bj=-1,wgr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");bj++,s.append("line").attr("id",n+"-task"+bj).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"),ygr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Nne();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,RP(s,o),$qe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Tgr=w(function(t,e){RP(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Cgr=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Nne=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),$qe=(function(){function t(i,s,a,o,l,u,h,d){const f=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,s=[],a=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(s.pop(),u.text(s.join(" ").trim()),i==="
    "?s=[""]:s=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",a+"em").text(i))})}w(Dne,"wrap");var Sgr=w(function(t,e,r,n,i,s=!1){var v,x,b;const{theme:a,look:o}=n,l=a==null?void 0:a.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Dne,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${s?e.padding/2+3:e.padding})`),Agr(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const T=a.includes("dark"),C=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=wt(C),k=S.attr("id")??"",E=k?`${k}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const A=S.select("defs");(A.empty()?S.append("defs"):A).append("filter").attr("id",E).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",T?"0.2":"0.06").attr("flood-color",T?"#FFFFFF":"#000000")}}return e},"drawNode"),Egr=w(function(t,e,r){var o;const n=t.append("g"),s=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Dne,e.width).node().getBBox(),a=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),s.height+a*1.1*.5+e.padding},"getVirtualNodeHeight"),Agr=w(function(t,e,r,n,i){const{theme:s}=i,a=s!=null&&s.includes("redux")?0:5,o=5,l=a>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${a},${a},-${a} h${e.width-2*o} q${a},0,${a},${a} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+Oqe++).attr("class","node-bkg node-"+e.type).attr("d",l),s!=null&&s.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),ac={drawRect:RP,drawCircle:vgr,drawSection:xgr,drawText:Pqe,drawLabel:bgr,drawTask:wgr,drawBackgroundRect:Tgr,getTextObj:Cgr,getNoteRect:Nne,initGraphics:kgr,drawNode:Sgr,getVirtualNodeHeight:Egr},Mgr=w(function(t,e,r,n){var I,$,O;const i=Ve(),{look:s,theme:a,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=wt("#i"+e));const m=wt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();de.debug("task",y),ac.initGraphics(m,e);const x=n.db.getSections();de.debug("sections",x);let b=0,T=0,C=0,S=0,k=50+d,E=50;S=50;let A=0,R=!0;x.forEach(function(D){const F={number:A,descr:D,section:A,width:150,padding:20,maxHeight:b},z=ac.getVirtualNodeHeight(m,F,i);de.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let _=0,P=0;de.debug("tasks.length",y.length);for(const[D,F]of y.entries()){const z={number:D,descr:F,section:F.section,width:150,padding:20,maxHeight:T},V=ac.getVirtualNodeHeight(m,z,i);de.debug("taskHeight before draw",V),T=Math.max(T,V+20),_=Math.max(_,F.events.length);let B=0;for(const H of F.events){const G={descr:H,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=ac.getVirtualNodeHeight(m,G,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}de.debug("maxSectionHeight before draw",b),de.debug("maxTaskHeight before draw",T),x&&x.length>0?x.forEach(D=>{const F=y.filter(H=>H.section===D),z={number:A,descr:D,section:A,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};de.debug("sectionNode",z);const V=m.append("g"),B=ac.drawNode(V,z,A,i,e);de.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&nye(m,F,A,k,E,T,i,_,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,A++}):(R=!1,nye(m,y,A,k,E,T,i,_,P,b,!0,e));const N=m.node().getBBox();if(de.debug("bounds",N),v&&m.append("text").text(v).attr("x",s==="neo"?N.x*2+d:N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=R?b+T+150:T+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",N.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),s==="neo"&&l&&a!=="neutral"){const D=m.select("defs"),z=(D.empty()?m.append("defs"):D).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");z.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),z.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}n3(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),nye=w(function(t,e,r,n,i,s,a,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:s};de.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=ac.drawNode(m,g,r,a,d).height;if(de.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),s=Math.max(s,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=s;i+=100,b=b+Rgr(t,p.events,r,n,i,a,d),i-=100,x.append("line").attr("x1",n+190/2).attr("y1",i+s).attr("x2",n+190/2).attr("y2",i+s+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=a.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Rgr=w(function(t,e,r,n,i,s,a){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};de.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=ac.drawNode(d,h,r,s,a,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),_gr={setConf:w(()=>{},"setConf"),draw:Mgr},_P=200,Lf=5,Lgr=_P+Lf*2,One=_P+100,Igr=One+Lf*2,Bqe=10,Ngr=0,iye=20,Fqe=20,sye=30,zqe=50,Dgr=w(function(t,e,r,n){var I,$,O,D,F;const i=Ve(),s=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const a=Xo(e);a.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();de.debug("task",o),ac.initGraphics(a);const u=n.db.getSections();de.debug("sections",u);let h=0,d=0;const f=50+s;let p=50;const g=p,m=f,y=Lgr+Fqe,v=Igr+zqe,x=m+y;let b=0;const T=u&&u.length>0,C=T?x:f+y,S=Math.max(50,y+v-Lf*2);u.forEach(function(z){const V={number:b,descr:z,section:b,width:S,padding:Lf,maxHeight:h},B=ac.getVirtualNodeHeight(a,V,i);de.debug("sectionHeight before draw",B),h=Math.max(h,B)});let k=0;de.debug("tasks.length",o.length);for(const[z,V]of o.entries()){const B={number:z,descr:V,section:V.section,width:_P,padding:Lf,maxHeight:d},H=ac.getVirtualNodeHeight(a,B,i);de.debug("taskHeight before draw",H),d=Math.max(d,H);let G=0;for(const W of V.events){const K={descr:W,section:V.section,number:V.section,width:One,padding:Lf,maxHeight:50};G+=ac.getVirtualNodeHeight(a,K,i)}V.events.length>0&&(G+=(V.events.length-1)*Bqe),k=Math.max(k,G)+Ngr}de.debug("maxSectionHeight before draw",h),de.debug("maxTaskHeight before draw",d);const A=Math.max(d,k)+sye;T?u.forEach(z=>{const V=o.filter(Q=>Q.section===z),B={number:b,descr:z,section:b,width:S,padding:Lf,maxHeight:h};de.debug("sectionNode",B);const H=a.append("g"),G=ac.drawNode(H,B,b,i);de.debug("sectionNode output",G);const W=C-y;H.attr("transform",`translate(${W}, ${p})`);const K=p+G.height+iye;V.length>0&&aye(a,V,b,C,K,d,i,A,!1);const q=V.length,oe=G.height+iye+A*Math.max(q,1)-(q>0?sye*2:0);p+=oe,b++}):aye(a,o,b,C,p,d,i,A,!0);let R=($=a.node())==null?void 0:$.getBBox();if(!R)throw new Error("bbox not found");if(de.debug("bounds",R),l){if(a.append("text").text(l).attr("x",R.width/2-s).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),R=(O=a.node())==null?void 0:O.getBBox(),!R)throw new Error("bbox not found");de.debug("bounds after title",R)}const[_]=B0(i.fontSize),P=(_??16)*2,N=(_??16)*.5+20,L=a.append("g").attr("class","lineWrapper");L.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",R.y+R.height+N).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),L.lower(),n3(void 0,a,((D=i.timeline)==null?void 0:D.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),aye=w(function(t,e,r,n,i,s,a,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:_P,padding:Lf,maxHeight:s};de.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=ac.drawNode(f,d,r,a),g=p.height;de.debug("taskHeight after draw",g);const m=n-Fqe-p.width;if(f.attr("transform",`translate(${m}, ${i})`),s=Math.max(s,g),h.events&&h.events.length>0){const y=i,v=n+zqe;Ogr(t,h.events,r,n,v,y,a)}i=i+o,l&&!((u=a.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Ogr=w(function(t,e,r,n,i,s,a){let o=s;for(const l of e){const u={descr:l,section:r,number:r,width:One,padding:Lf,maxHeight:0};de.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=ac.drawNode(h,u,r,a).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+Bqe}return o-s},"drawEvents"),Pgr={setConf:w(()=>{},"setConf"),draw:Dgr},$gr=w(t=>{var o;const{theme:e}=vr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",s=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let a="";for(let l=0;l0?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(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:w(function(g){this.begin(g)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return w(d,"Parser"),d.prototype=u,u.Parser=d,new d})();Tj.parser=Tj;var Lgr=Tj,Rqe={};BN(Rqe,{addEvent:()=>Fqe,addSection:()=>Oqe,addTask:()=>Bqe,addTaskOrg:()=>zqe,clear:()=>Iqe,default:()=>Igr,getCommonDb:()=>Lqe,getDirection:()=>Dqe,getSections:()=>Pqe,getTasks:()=>$qe,setDirection:()=>Nqe});var U5="",_qe=0,One="LR",Pne=[],GI=[],Y5=[],Lqe=w(()=>kK,"getCommonDb"),Iqe=w(function(){Pne.length=0,GI.length=0,U5="",Y5.length=0,One="LR",Ri()},"clear"),Nqe=w(function(t){One=t},"setDirection"),Dqe=w(function(){return One},"getDirection"),Oqe=w(function(t){U5=t,Pne.push(t)},"addSection"),Pqe=w(function(){return Pne},"getSections"),$qe=w(function(){let t=lye();const e=100;let r=0;for(;!t&&rr.id===_qe-1).events.push(t)},"addEvent"),zqe=w(function(t){const e={section:U5,type:U5,description:t,task:t,classes:[]};GI.push(e)},"addTaskOrg"),lye=w(function(){const t=w(function(r){return Y5[r].processed},"compileTask");let e=!0;for(const[r,n]of Y5.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Igr={clear:Iqe,getCommonDb:Lqe,getDirection:Dqe,setDirection:Nqe,addSection:Oqe,getSections:Pqe,getTasks:$qe,addTask:Bqe,addTaskOrg:zqe,addEvent:Fqe},Vqe=0,IP=w(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),Ngr=w(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function s(l){const u=l5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}w(s,"smile");function a(l){const u=l5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}w(a,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return w(o,"ambivalent"),e.score>3?s(i):e.score<3?a(i):o(i),n},"drawFace"),Dgr=w(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Hqe=w(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),Ogr=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+o)}w(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Hqe(t,e)},"drawLabel"),Pgr=w(function(t,e,r){const n=t.append("g"),i=$ne();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,IP(n,i),Gqe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Cj=-1,$gr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");Cj++,s.append("line").attr("id",n+"-task"+Cj).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"),Ngr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=$ne();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,IP(s,o),Gqe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Bgr=w(function(t,e){IP(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Fgr=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),$ne=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Gqe=(function(){function t(i,s,a,o,l,u,h,d){const f=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,s=[],a=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(s.pop(),u.text(s.join(" ").trim()),i==="
    "?s=[""]:s=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",a+"em").text(i))})}w(Bne,"wrap");var Vgr=w(function(t,e,r,n,i,s=!1){var v,x,b;const{theme:a,look:o}=n,l=a==null?void 0:a.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Bne,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${s?e.padding/2+3:e.padding})`),Ggr(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const T=a.includes("dark"),C=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=wt(C),k=S.attr("id")??"",E=k?`${k}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const A=S.select("defs");(A.empty()?S.append("defs"):A).append("filter").attr("id",E).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",T?"0.2":"0.06").attr("flood-color",T?"#FFFFFF":"#000000")}}return e},"drawNode"),Hgr=w(function(t,e,r){var o;const n=t.append("g"),s=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Bne,e.width).node().getBBox(),a=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),s.height+a*1.1*.5+e.padding},"getVirtualNodeHeight"),Ggr=w(function(t,e,r,n,i){const{theme:s}=i,a=s!=null&&s.includes("redux")?0:5,o=5,l=a>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${a},${a},-${a} h${e.width-2*o} q${a},0,${a},${a} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+Vqe++).attr("class","node-bkg node-"+e.type).attr("d",l),s!=null&&s.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),cc={drawRect:IP,drawCircle:Dgr,drawSection:Pgr,drawText:Hqe,drawLabel:Ogr,drawTask:$gr,drawBackgroundRect:Bgr,getTextObj:Fgr,getNoteRect:$ne,initGraphics:zgr,drawNode:Vgr,getVirtualNodeHeight:Hgr},Wgr=w(function(t,e,r,n){var I,$,O;const i=Ve(),{look:s,theme:a,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=wt("#i"+e));const m=wt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();de.debug("task",y),cc.initGraphics(m,e);const x=n.db.getSections();de.debug("sections",x);let b=0,T=0,C=0,S=0,k=50+d,E=50;S=50;let A=0,R=!0;x.forEach(function(D){const F={number:A,descr:D,section:A,width:150,padding:20,maxHeight:b},z=cc.getVirtualNodeHeight(m,F,i);de.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let _=0,P=0;de.debug("tasks.length",y.length);for(const[D,F]of y.entries()){const z={number:D,descr:F,section:F.section,width:150,padding:20,maxHeight:T},V=cc.getVirtualNodeHeight(m,z,i);de.debug("taskHeight before draw",V),T=Math.max(T,V+20),_=Math.max(_,F.events.length);let B=0;for(const H of F.events){const G={descr:H,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=cc.getVirtualNodeHeight(m,G,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}de.debug("maxSectionHeight before draw",b),de.debug("maxTaskHeight before draw",T),x&&x.length>0?x.forEach(D=>{const F=y.filter(H=>H.section===D),z={number:A,descr:D,section:A,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};de.debug("sectionNode",z);const V=m.append("g"),B=cc.drawNode(V,z,A,i,e);de.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&cye(m,F,A,k,E,T,i,_,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,A++}):(R=!1,cye(m,y,A,k,E,T,i,_,P,b,!0,e));const N=m.node().getBBox();if(de.debug("bounds",N),v&&m.append("text").text(v).attr("x",s==="neo"?N.x*2+d:N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=R?b+T+150:T+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",N.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),s==="neo"&&l&&a!=="neutral"){const D=m.select("defs"),z=(D.empty()?m.append("defs"):D).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");z.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),z.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}a3(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),cye=w(function(t,e,r,n,i,s,a,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:s};de.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=cc.drawNode(m,g,r,a,d).height;if(de.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),s=Math.max(s,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=s;i+=100,b=b+qgr(t,p.events,r,n,i,a,d),i-=100,x.append("line").attr("x1",n+190/2).attr("y1",i+s).attr("x2",n+190/2).attr("y2",i+s+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=a.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),qgr=w(function(t,e,r,n,i,s,a){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};de.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=cc.drawNode(d,h,r,s,a,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),Ugr={setConf:w(()=>{},"setConf"),draw:Wgr},NP=200,Df=5,Ygr=NP+Df*2,Fne=NP+100,jgr=Fne+Df*2,Wqe=10,Xgr=0,uye=20,qqe=20,hye=30,Uqe=50,Kgr=w(function(t,e,r,n){var I,$,O,D,F;const i=Ve(),s=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const a=Xo(e);a.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();de.debug("task",o),cc.initGraphics(a);const u=n.db.getSections();de.debug("sections",u);let h=0,d=0;const f=50+s;let p=50;const g=p,m=f,y=Ygr+qqe,v=jgr+Uqe,x=m+y;let b=0;const T=u&&u.length>0,C=T?x:f+y,S=Math.max(50,y+v-Df*2);u.forEach(function(z){const V={number:b,descr:z,section:b,width:S,padding:Df,maxHeight:h},B=cc.getVirtualNodeHeight(a,V,i);de.debug("sectionHeight before draw",B),h=Math.max(h,B)});let k=0;de.debug("tasks.length",o.length);for(const[z,V]of o.entries()){const B={number:z,descr:V,section:V.section,width:NP,padding:Df,maxHeight:d},H=cc.getVirtualNodeHeight(a,B,i);de.debug("taskHeight before draw",H),d=Math.max(d,H);let G=0;for(const W of V.events){const K={descr:W,section:V.section,number:V.section,width:Fne,padding:Df,maxHeight:50};G+=cc.getVirtualNodeHeight(a,K,i)}V.events.length>0&&(G+=(V.events.length-1)*Wqe),k=Math.max(k,G)+Xgr}de.debug("maxSectionHeight before draw",h),de.debug("maxTaskHeight before draw",d);const A=Math.max(d,k)+hye;T?u.forEach(z=>{const V=o.filter(Q=>Q.section===z),B={number:b,descr:z,section:b,width:S,padding:Df,maxHeight:h};de.debug("sectionNode",B);const H=a.append("g"),G=cc.drawNode(H,B,b,i);de.debug("sectionNode output",G);const W=C-y;H.attr("transform",`translate(${W}, ${p})`);const K=p+G.height+uye;V.length>0&&dye(a,V,b,C,K,d,i,A,!1);const q=V.length,oe=G.height+uye+A*Math.max(q,1)-(q>0?hye*2:0);p+=oe,b++}):dye(a,o,b,C,p,d,i,A,!0);let R=($=a.node())==null?void 0:$.getBBox();if(!R)throw new Error("bbox not found");if(de.debug("bounds",R),l){if(a.append("text").text(l).attr("x",R.width/2-s).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),R=(O=a.node())==null?void 0:O.getBBox(),!R)throw new Error("bbox not found");de.debug("bounds after title",R)}const[_]=H0(i.fontSize),P=(_??16)*2,N=(_??16)*.5+20,L=a.append("g").attr("class","lineWrapper");L.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",R.y+R.height+N).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),L.lower(),a3(void 0,a,((D=i.timeline)==null?void 0:D.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),dye=w(function(t,e,r,n,i,s,a,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:NP,padding:Df,maxHeight:s};de.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=cc.drawNode(f,d,r,a),g=p.height;de.debug("taskHeight after draw",g);const m=n-qqe-p.width;if(f.attr("transform",`translate(${m}, ${i})`),s=Math.max(s,g),h.events&&h.events.length>0){const y=i,v=n+Uqe;Zgr(t,h.events,r,n,v,y,a)}i=i+o,l&&!((u=a.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Zgr=w(function(t,e,r,n,i,s,a){let o=s;for(const l of e){const u={descr:l,section:r,number:r,width:Fne,padding:Df,maxHeight:0};de.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=cc.drawNode(h,u,r,a).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+Wqe}return o-s},"drawEvents"),Qgr={setConf:w(()=>{},"setConf"),draw:Kgr},Jgr=w(t=>{var o;const{theme:e}=br(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",s=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let a="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{var a;const{theme:e}=vr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((a=t.svgId)==null?void 0:a.replace(/^#/,""))??"";let s="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{var a;const{theme:e}=br(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((a=t.svgId)==null?void 0:a.replace(/^#/,""))??"";let s="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:w((t,e,r,n)=>{var s,a;return(((a=(s=n==null?void 0:n.db)==null?void 0:s.getDirection)==null?void 0:a.call(s))??"LR")==="TD"?Pgr.draw(t,e,r,n):_gr.draw(t,e,r,n)},"draw")},Hgr={db:Cqe,renderer:Vgr,parser:ggr,styles:zgr};const Ggr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hgr},Symbol.toStringTag,{value:"Module"})),fo=[];for(let t=0;t<256;++t)fo.push((t+256).toString(16).slice(1));function Wgr(t,e=0){return(fo[t[e+0]]+fo[t[e+1]]+fo[t[e+2]]+fo[t[e+3]]+"-"+fo[t[e+4]]+fo[t[e+5]]+"-"+fo[t[e+6]]+fo[t[e+7]]+"-"+fo[t[e+8]]+fo[t[e+9]]+"-"+fo[t[e+10]]+fo[t[e+11]]+fo[t[e+12]]+fo[t[e+13]]+fo[t[e+14]]+fo[t[e+15]]).toLowerCase()}const qgr=new Uint8Array(16);function Ugr(){return crypto.getRandomValues(qgr)}function Ygr(t,e,r){return crypto.randomUUID?crypto.randomUUID():jgr(t)}function jgr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Ugr();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Wgr(n)}var xj=(function(){var t=w(function(T,C,S,k){for(S=S||{},k=T.length;k--;S[T[k]]=C);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],s=[1,16],a=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:w(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:w(function(C,S,k,E,A,R,_){var P=R.length-1;switch(A){case 6:case 7:return E;case 8:E.getLogger().trace("Stop NL ");break;case 9:E.getLogger().trace("Stop EOF ");break;case 11:E.getLogger().trace("Stop NL2 ");break;case 12:E.getLogger().trace("Stop EOF2 ");break;case 15:E.getLogger().info("Node: ",R[P].id),E.addNode(R[P-1].length,R[P].id,R[P].descr,R[P].type);break;case 16:E.getLogger().trace("Icon: ",R[P]),E.decorateNode({icon:R[P]});break;case 17:case 21:E.decorateNode({class:R[P]});break;case 18:E.getLogger().trace("SPACELIST");break;case 19:E.getLogger().trace("Node: ",R[P].id),E.addNode(0,R[P].id,R[P].descr,R[P].type);break;case 20:E.decorateNode({icon:R[P]});break;case 25:E.getLogger().trace("node found ..",R[P-2]),this.$={id:R[P-1],descr:R[P-1],type:E.getType(R[P-2],R[P])};break;case 26:this.$={id:R[P],descr:R[P],type:E.nodeType.DEFAULT};break;case 27:E.getLogger().trace("node found ..",R[P-3]),this.$={id:R[P-3],descr:R[P-1],type:E.getType(R[P-2],R[P])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:a,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:w(function(C,S){if(S.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=S,k}},"parseError"),parse:w(function(C){var S=this,k=[0],E=[],A=[null],R=[],_=this.table,P="",N=0,L=0,I=2,$=1,O=R.slice.call(arguments,1),D=Object.create(this.lexer),F={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(F.yy[z]=this.yy[z]);D.setInput(C,F.yy),F.yy.lexer=D,F.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var V=D.yylloc;R.push(V);var B=D.options&&D.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(_e){k.length=k.length-2*_e,A.length=A.length-_e,R.length=R.length-_e}w(H,"popStack");function G(){var _e;return _e=E.pop()||D.lex()||$,typeof _e!="number"&&(_e instanceof Array&&(E=_e,_e=E.pop()),_e=S.symbols_[_e]||_e),_e}w(G,"lex");for(var W,K,q,oe,Q={},Z,re,ie,me;;){if(K=k[k.length-1],this.defaultActions[K]?q=this.defaultActions[K]:((W===null||typeof W>"u")&&(W=G()),q=_[K]&&_[K][W]),typeof q>"u"||!q.length||!q[0]){var te="";me=[];for(Z in _[K])this.terminals_[Z]&&Z>I&&me.push("'"+this.terminals_[Z]+"'");D.showPosition?te="Parse error on line "+(N+1)+`: +`},"getStyles"),rmr=tmr,nmr={setConf:w(()=>{},"setConf"),draw:w((t,e,r,n)=>{var s,a;return(((a=(s=n==null?void 0:n.db)==null?void 0:s.getDirection)==null?void 0:a.call(s))??"LR")==="TD"?Qgr.draw(t,e,r,n):Ugr.draw(t,e,r,n)},"draw")},imr={db:Rqe,renderer:nmr,parser:Lgr,styles:rmr};const smr=Object.freeze(Object.defineProperty({__proto__:null,diagram:imr},Symbol.toStringTag,{value:"Module"})),fo=[];for(let t=0;t<256;++t)fo.push((t+256).toString(16).slice(1));function amr(t,e=0){return(fo[t[e+0]]+fo[t[e+1]]+fo[t[e+2]]+fo[t[e+3]]+"-"+fo[t[e+4]]+fo[t[e+5]]+"-"+fo[t[e+6]]+fo[t[e+7]]+"-"+fo[t[e+8]]+fo[t[e+9]]+"-"+fo[t[e+10]]+fo[t[e+11]]+fo[t[e+12]]+fo[t[e+13]]+fo[t[e+14]]+fo[t[e+15]]).toLowerCase()}const omr=new Uint8Array(16);function lmr(){return crypto.getRandomValues(omr)}function cmr(t,e,r){return crypto.randomUUID?crypto.randomUUID():umr(t)}function umr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??lmr();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,amr(n)}var kj=(function(){var t=w(function(T,C,S,k){for(S=S||{},k=T.length;k--;S[T[k]]=C);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],s=[1,16],a=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:w(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:w(function(C,S,k,E,A,R,_){var P=R.length-1;switch(A){case 6:case 7:return E;case 8:E.getLogger().trace("Stop NL ");break;case 9:E.getLogger().trace("Stop EOF ");break;case 11:E.getLogger().trace("Stop NL2 ");break;case 12:E.getLogger().trace("Stop EOF2 ");break;case 15:E.getLogger().info("Node: ",R[P].id),E.addNode(R[P-1].length,R[P].id,R[P].descr,R[P].type);break;case 16:E.getLogger().trace("Icon: ",R[P]),E.decorateNode({icon:R[P]});break;case 17:case 21:E.decorateNode({class:R[P]});break;case 18:E.getLogger().trace("SPACELIST");break;case 19:E.getLogger().trace("Node: ",R[P].id),E.addNode(0,R[P].id,R[P].descr,R[P].type);break;case 20:E.decorateNode({icon:R[P]});break;case 25:E.getLogger().trace("node found ..",R[P-2]),this.$={id:R[P-1],descr:R[P-1],type:E.getType(R[P-2],R[P])};break;case 26:this.$={id:R[P],descr:R[P],type:E.nodeType.DEFAULT};break;case 27:E.getLogger().trace("node found ..",R[P-3]),this.$={id:R[P-3],descr:R[P-1],type:E.getType(R[P-2],R[P])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:a,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:s,17:17,18:18,19:a,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:w(function(C,S){if(S.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=S,k}},"parseError"),parse:w(function(C){var S=this,k=[0],E=[],A=[null],R=[],_=this.table,P="",N=0,L=0,I=2,$=1,O=R.slice.call(arguments,1),D=Object.create(this.lexer),F={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(F.yy[z]=this.yy[z]);D.setInput(C,F.yy),F.yy.lexer=D,F.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var V=D.yylloc;R.push(V);var B=D.options&&D.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(_e){k.length=k.length-2*_e,A.length=A.length-_e,R.length=R.length-_e}w(H,"popStack");function G(){var _e;return _e=E.pop()||D.lex()||$,typeof _e!="number"&&(_e instanceof Array&&(E=_e,_e=E.pop()),_e=S.symbols_[_e]||_e),_e}w(G,"lex");for(var W,K,q,oe,Q={},Z,re,ie,me;;){if(K=k[k.length-1],this.defaultActions[K]?q=this.defaultActions[K]:((W===null||typeof W>"u")&&(W=G()),q=_[K]&&_[K][W]),typeof q>"u"||!q.length||!q[0]){var te="";me=[];for(Z in _[K])this.terminals_[Z]&&Z>I&&me.push("'"+this.terminals_[Z]+"'");D.showPosition?te="Parse error on line "+(N+1)+`: `+D.showPosition()+` Expecting `+me.join(", ")+", got '"+(this.terminals_[W]||W)+"'":te="Parse error on line "+(N+1)+": Unexpected "+(W==$?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[W]||W,line:D.yylineno,loc:V,expected:me})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+W);switch(q[0]){case 1:k.push(W),A.push(D.yytext),R.push(D.yylloc),k.push(q[1]),W=null,L=D.yyleng,P=D.yytext,N=D.yylineno,V=D.yylloc;break;case 2:if(re=this.productions_[q[1]][1],Q.$=A[A.length-re],Q._$={first_line:R[R.length-(re||1)].first_line,last_line:R[R.length-1].last_line,first_column:R[R.length-(re||1)].first_column,last_column:R[R.length-1].last_column},B&&(Q._$.range=[R[R.length-(re||1)].range[0],R[R.length-1].range[1]]),oe=this.performAction.apply(Q,[P,L,N,F.yy,q[1],A,R].concat(O)),typeof oe<"u")return oe;re&&(k=k.slice(0,-1*re*2),A=A.slice(0,-1*re),R=R.slice(0,-1*re)),k.push(this.productions_[q[1]][0]),A.push(Q.$),R.push(Q._$),ie=_[k[k.length-2]][k[k.length-1]],k.push(ie);break;case 3:return!0}}return!0},"parse")},x=(function(){var T={EOF:1,parseError:w(function(S,k){if(this.yy.parser)this.yy.parser.parseError(S,k);else throw new Error(S)},"parseError"),setInput:w(function(C,S){return this.yy=S||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var S=C.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:w(function(C){var S=C.length,k=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===E.length?this.yylloc.first_column:0)+E[E.length-k.length].length-k[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-S]),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(C){this.unput(this.match.slice(C))},"less"),pastInput:w(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:w(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:w(function(){var C=this.pastInput(),S=new Array(C.length+1).join("-");return C+this.upcomingInput()+` `+S+"^"},"showPosition"),test_match:w(function(C,S){var k,E,A;if(this.options.backtrack_lexer&&(A={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&&(A.yylloc.range=this.yylloc.range.slice(0))),E=C[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],k=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var R in A)this[R]=A[R];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,S,k,E;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),R=0;RS[0].length)){if(S=k,E=R,this.options.backtrack_lexer){if(C=this.test_match(k,A[R]),C!==!1)return C;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(C=this.test_match(S,A[E]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var S=this.next();return S||this.lex()},"lex"),begin:w(function(S){this.conditionStack.push(S)},"begin"),popState:w(function(){var S=this.conditionStack.length-1;return S>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(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:w(function(S){this.begin(S)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(S,k,E,A){switch(E){case 0:return S.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",k.yytext),20;case 36:return S.getLogger().trace("Long description:",k.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return T})();v.lexer=x;function b(){this.yy={}}return w(b,"Parser"),b.prototype=v,v.Parser=b,new b})();xj.parser=xj;var Xgr=xj,Kgr=12,mf={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},wT,Zgr=(wT=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=mf,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;de.info("addNode",e,r,n,i);let s=!1;this.nodes.length===0?(this.baseLevel=e,e=0,s=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,s=!1);const a=Ve();let o=((h=a.mindmap)==null?void 0:h.padding)??Sn.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Ln(r,a),level:e,descr:Ln(n,a),type:i,children:[],width:((d=a.mindmap)==null?void 0:d.maxNodeWidth)??Sn.mindmap.maxNodeWidth,padding:o,isRoot:s},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(s)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(de.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Ve(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Ln(e.icon,r)),e.class&&(n.class=Ln(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const s=e.level===0?n%(Kgr-1):r;this.assignSections(i,s)}}flattenNodes(e,r){const n=Ve(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const s=i.join(" "),a=w(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case mf.CIRCLE:return"mindmapCircle";case mf.RECT:return"rect";case mf.ROUNDED_RECT:return"rounded";case mf.CLOUD:return"cloud";case mf.BANG:return"bang";case mf.HEXAGON:return"hexagon";case mf.DEFAULT:return h?"rounded":"defaultMindmapNode";case mf.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:a(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:s,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Ve();for(const i of e.children){let s="edge";i.section!==void 0&&(s+=` section-edge-${i.section}`);const a=e.level+1;s+=` edge-depth-${a}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:s,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Ve(),i=iTe().layout!==void 0,s=r;if(i||(s.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:s};de.debug("getData: mindmapRoot",e,r),this.assignSections(e);const a=[],o=[];this.flattenNodes(e,a),this.generateEdges(e,o),de.debug(`getData: processed ${a.length} nodes and ${o.length} edges`);const l=new Map;for(const u of a)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:a,edges:o,config:s,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Ygr()}}getLogger(){return de}},w(wT,"MindmapDB"),wT),Qgr=w(async(t,e,r,n)=>{var f,p;de.debug(`Rendering mindmap diagram -`+t);const i=n.db,s=i.getData(),a=S3(e,s.config.securityLevel);if(s.type=n.type,s.layoutAlgorithm=n7(s.config.layout,{fallback:"cose-bilkent"}),s.diagramId=e,!i.getMindmap())return;s.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 o3(s,a);const{themeVariables:l}=vr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=a.attr("id"),m=a.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}sv(a,((f=s.config.mindmap)==null?void 0:f.padding)??Sn.mindmap.padding,"mindmapDiagram",((p=s.config.mindmap)==null?void 0:p.useMaxWidth)??Sn.mindmap.useMaxWidth)},"draw"),Jgr={draw:Qgr},emr=w(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i0?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(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:w(function(S){this.begin(S)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(S,k,E,A){switch(E){case 0:return S.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",k.yytext),20;case 36:return S.getLogger().trace("Long description:",k.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return T})();v.lexer=x;function b(){this.yy={}}return w(b,"Parser"),b.prototype=v,v.Parser=b,new b})();kj.parser=kj;var hmr=kj,dmr=12,bf={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},CT,fmr=(CT=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=bf,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;de.info("addNode",e,r,n,i);let s=!1;this.nodes.length===0?(this.baseLevel=e,e=0,s=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,s=!1);const a=Ve();let o=((h=a.mindmap)==null?void 0:h.padding)??Sn.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Ln(r,a),level:e,descr:Ln(n,a),type:i,children:[],width:((d=a.mindmap)==null?void 0:d.maxNodeWidth)??Sn.mindmap.maxNodeWidth,padding:o,isRoot:s},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(s)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(de.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Ve(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Ln(e.icon,r)),e.class&&(n.class=Ln(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const s=e.level===0?n%(dmr-1):r;this.assignSections(i,s)}}flattenNodes(e,r){const n=Ve(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const s=i.join(" "),a=w(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case bf.CIRCLE:return"mindmapCircle";case bf.RECT:return"rect";case bf.ROUNDED_RECT:return"rounded";case bf.CLOUD:return"cloud";case bf.BANG:return"bang";case bf.HEXAGON:return"hexagon";case bf.DEFAULT:return h?"rounded":"defaultMindmapNode";case bf.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:a(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:s,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Ve();for(const i of e.children){let s="edge";i.section!==void 0&&(s+=` section-edge-${i.section}`);const a=e.level+1;s+=` edge-depth-${a}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:s,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Ve(),i=uTe().layout!==void 0,s=r;if(i||(s.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:s};de.debug("getData: mindmapRoot",e,r),this.assignSections(e);const a=[],o=[];this.flattenNodes(e,a),this.generateEdges(e,o),de.debug(`getData: processed ${a.length} nodes and ${o.length} edges`);const l=new Map;for(const u of a)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:a,edges:o,config:s,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+cmr()}}getLogger(){return de}},w(CT,"MindmapDB"),CT),pmr=w(async(t,e,r,n)=>{var f,p;de.debug(`Rendering mindmap diagram +`+t);const i=n.db,s=i.getData(),a=M3(e,s.config.securityLevel);if(s.type=n.type,s.layoutAlgorithm=a7(s.config.layout,{fallback:"cose-bilkent"}),s.diagramId=e,!i.getMindmap())return;s.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 u3(s,a);const{themeVariables:l}=br(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=a.attr("id"),m=a.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}ov(a,((f=s.config.mindmap)==null?void 0:f.padding)??Sn.mindmap.padding,"mindmapDiagram",((p=s.config.mindmap)==null?void 0:p.useMaxWidth)??Sn.mindmap.useMaxWidth)},"draw"),gmr={draw:pmr},mmr=w(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),vmr=w(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${emr(t)} + ${mmr(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -5059,18 +5066,18 @@ Expecting `+me.join(", ")+", got '"+(this.terminals_[W]||W)+"'":te="Parse error [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } - ${t.useGradient&&r&&t.mainBkg?tmr(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),nmr=rmr,imr={get db(){return new Zgr},renderer:Jgr,parser:Xgr,styles:nmr};const smr=Object.freeze(Object.defineProperty({__proto__:null,diagram:imr},Symbol.toStringTag,{value:"Module"}));var wj=(function(){var t=w(function(k,E,A,R){for(A=A||{},R=k.length;R--;A[k[R]]=E);return A},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],s=[1,16],a=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],T={trace:w(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:w(function(E,A,R,_,P,N,L){var I=N.length-1;switch(P){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",N[I-1].id),_.addNode(N[I-2].length,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 16:_.getLogger().info("Node: ",N[I].id),_.addNode(N[I-1].length,N[I].id,N[I].descr,N[I].type);break;case 17:_.getLogger().trace("Icon: ",N[I]),_.decorateNode({icon:N[I]});break;case 18:case 23:_.decorateNode({class:N[I]});break;case 19:_.getLogger().trace("SPACELIST");break;case 20:_.getLogger().trace("Node: ",N[I-1].id),_.addNode(0,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 21:_.getLogger().trace("Node: ",N[I].id),_.addNode(0,N[I].id,N[I].descr,N[I].type);break;case 22:_.decorateNode({icon:N[I]});break;case 27:_.getLogger().trace("node found ..",N[I-2]),this.$={id:N[I-1],descr:N[I-1],type:_.getType(N[I-2],N[I])};break;case 28:this.$={id:N[I],descr:N[I],type:0};break;case 29:_.getLogger().trace("node found ..",N[I-3]),this.$={id:N[I-3],descr:N[I-1],type:_.getType(N[I-2],N[I])};break;case 30:this.$=N[I-1]+N[I];break;case 31:this.$=N[I];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:w(function(E,A){if(A.recoverable)this.trace(E);else{var R=new Error(E);throw R.hash=A,R}},"parseError"),parse:w(function(E){var A=this,R=[0],_=[],P=[null],N=[],L=this.table,I="",$=0,O=0,D=2,F=1,z=N.slice.call(arguments,1),V=Object.create(this.lexer),B={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(B.yy[H]=this.yy[H]);V.setInput(E,B.yy),B.yy.lexer=V,B.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var G=V.yylloc;N.push(G);var W=V.options&&V.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(ce){R.length=R.length-2*ce,P.length=P.length-ce,N.length=N.length-ce}w(K,"popStack");function q(){var ce;return ce=_.pop()||V.lex()||F,typeof ce!="number"&&(ce instanceof Array&&(_=ce,ce=_.pop()),ce=A.symbols_[ce]||ce),ce}w(q,"lex");for(var oe,Q,Z,re,ie={},me,te,_e,$e;;){if(Q=R[R.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((oe===null||typeof oe>"u")&&(oe=q()),Z=L[Q]&&L[Q][oe]),typeof Z>"u"||!Z.length||!Z[0]){var Fe="";$e=[];for(me in L[Q])this.terminals_[me]&&me>D&&$e.push("'"+this.terminals_[me]+"'");V.showPosition?Fe="Parse error on line "+($+1)+`: + ${t.useGradient&&r&&t.mainBkg?ymr(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),bmr=vmr,xmr={get db(){return new fmr},renderer:gmr,parser:hmr,styles:bmr};const wmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xmr},Symbol.toStringTag,{value:"Module"}));var Sj=(function(){var t=w(function(k,E,A,R){for(A=A||{},R=k.length;R--;A[k[R]]=E);return A},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],s=[1,16],a=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],x=[1,6,7,11,13,16,17,20,23],b=[1,38],T={trace:w(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:w(function(E,A,R,_,P,N,L){var I=N.length-1;switch(P){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",N[I-1].id),_.addNode(N[I-2].length,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 16:_.getLogger().info("Node: ",N[I].id),_.addNode(N[I-1].length,N[I].id,N[I].descr,N[I].type);break;case 17:_.getLogger().trace("Icon: ",N[I]),_.decorateNode({icon:N[I]});break;case 18:case 23:_.decorateNode({class:N[I]});break;case 19:_.getLogger().trace("SPACELIST");break;case 20:_.getLogger().trace("Node: ",N[I-1].id),_.addNode(0,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 21:_.getLogger().trace("Node: ",N[I].id),_.addNode(0,N[I].id,N[I].descr,N[I].type);break;case 22:_.decorateNode({icon:N[I]});break;case 27:_.getLogger().trace("node found ..",N[I-2]),this.$={id:N[I-1],descr:N[I-1],type:_.getType(N[I-2],N[I])};break;case 28:this.$={id:N[I],descr:N[I],type:0};break;case 29:_.getLogger().trace("node found ..",N[I-3]),this.$={id:N[I-3],descr:N[I-1],type:_.getType(N[I-2],N[I])};break;case 30:this.$=N[I-1]+N[I];break;case 31:this.$=N[I];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:s,18:17,19:18,20:a,23:o},t(m,[2,14],{7:y,11:v}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(x,[2,11]),t(x,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:w(function(E,A){if(A.recoverable)this.trace(E);else{var R=new Error(E);throw R.hash=A,R}},"parseError"),parse:w(function(E){var A=this,R=[0],_=[],P=[null],N=[],L=this.table,I="",$=0,O=0,D=2,F=1,z=N.slice.call(arguments,1),V=Object.create(this.lexer),B={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(B.yy[H]=this.yy[H]);V.setInput(E,B.yy),B.yy.lexer=V,B.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var G=V.yylloc;N.push(G);var W=V.options&&V.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(ce){R.length=R.length-2*ce,P.length=P.length-ce,N.length=N.length-ce}w(K,"popStack");function q(){var ce;return ce=_.pop()||V.lex()||F,typeof ce!="number"&&(ce instanceof Array&&(_=ce,ce=_.pop()),ce=A.symbols_[ce]||ce),ce}w(q,"lex");for(var oe,Q,Z,re,ie={},me,te,_e,$e;;){if(Q=R[R.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((oe===null||typeof oe>"u")&&(oe=q()),Z=L[Q]&&L[Q][oe]),typeof Z>"u"||!Z.length||!Z[0]){var Fe="";$e=[];for(me in L[Q])this.terminals_[me]&&me>D&&$e.push("'"+this.terminals_[me]+"'");V.showPosition?Fe="Parse error on line "+($+1)+`: `+V.showPosition()+` Expecting `+$e.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Fe="Parse error on line "+($+1)+": Unexpected "+(oe==F?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(Fe,{text:V.match,token:this.terminals_[oe]||oe,line:V.yylineno,loc:G,expected:$e})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+oe);switch(Z[0]){case 1:R.push(oe),P.push(V.yytext),N.push(V.yylloc),R.push(Z[1]),oe=null,O=V.yyleng,I=V.yytext,$=V.yylineno,G=V.yylloc;break;case 2:if(te=this.productions_[Z[1]][1],ie.$=P[P.length-te],ie._$={first_line:N[N.length-(te||1)].first_line,last_line:N[N.length-1].last_line,first_column:N[N.length-(te||1)].first_column,last_column:N[N.length-1].last_column},W&&(ie._$.range=[N[N.length-(te||1)].range[0],N[N.length-1].range[1]]),re=this.performAction.apply(ie,[I,O,$,B.yy,Z[1],P,N].concat(z)),typeof re<"u")return re;te&&(R=R.slice(0,-1*te*2),P=P.slice(0,-1*te),N=N.slice(0,-1*te)),R.push(this.productions_[Z[1]][0]),P.push(ie.$),N.push(ie._$),_e=L[R[R.length-2]][R[R.length-1]],R.push(_e);break;case 3:return!0}}return!0},"parse")},C=(function(){var k={EOF:1,parseError:w(function(A,R){if(this.yy.parser)this.yy.parser.parseError(A,R);else throw new Error(A)},"parseError"),setInput:w(function(E,A){return this.yy=A||this.yy||{},this._input=E,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var A=E.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),E},"input"),unput:w(function(E){var A=E.length,R=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;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),R.length-1&&(this.yylineno-=R.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:R?(R.length===_.length?this.yylloc.first_column:0)+_[_.length-R.length].length-R[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[P[0],P[0]+this.yyleng-A]),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(E){this.unput(this.match.slice(E))},"less"),pastInput:w(function(){var E=this.matched.substr(0,this.matched.length-this.match.length);return(E.length>20?"...":"")+E.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var E=this.match;return E.length<20&&(E+=this._input.substr(0,20-E.length)),(E.substr(0,20)+(E.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var E=this.pastInput(),A=new Array(E.length+1).join("-");return E+this.upcomingInput()+` `+A+"^"},"showPosition"),test_match:w(function(E,A){var R,_,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))),_=E[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+E[0].length},this.yytext+=E[0],this.match+=E[0],this.matches=E,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(E[0].length),this.matched+=E[0],R=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),R)return R;if(this._backtrack){for(var N in P)this[N]=P[N];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,A,R,_;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),N=0;NA[0].length)){if(A=R,_=N,this.options.backtrack_lexer){if(E=this.test_match(R,P[N]),E!==!1)return E;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(E=this.test_match(A,P[_]),E!==!1?E:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var A=this.next();return A||this.lex()},"lex"),begin:w(function(A){this.conditionStack.push(A)},"begin"),popState:w(function(){var A=this.conditionStack.length-1;return A>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(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:w(function(A){this.begin(A)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(A,R,_,P){switch(_){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 N=/\n\s*/g;return R.yytext=R.yytext.replace(N,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return A.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:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return A.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:A.getLogger().trace("end icon"),this.popState();break;case 16:return A.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return A.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return A.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:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return A.getLogger().trace("description:",R.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),A.getLogger().trace("node end ...",R.yytext),"NODE_DEND";case 36:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 41:return A.getLogger().trace("Long description:",R.yytext),21;case 42:return A.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 k})();T.lexer=C;function S(){this.yy={}}return w(S,"Parser"),S.prototype=T,T.Parser=S,new S})();wj.parser=wj;var amr=wj,lu=[],Pne=[],Tj=0,$ne={},omr=w(()=>{lu=[],Pne=[],Tj=0,$ne={}},"clear"),lmr=w(t=>{if(lu.length===0)return null;const e=lu[0].level;let r=null;for(let n=lu.length-1;n>=0;n--)if(lu[n].level===e&&!r&&(r=lu[n]),lu[n].levelo.parentId===i.id);for(const o of a){const l={id:o.id,parentId:i.id,label:Ln(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Ve()}},"getData"),umr=w((t,e,r,n,i)=>{var u,h;const s=Ve();let a=((u=s.mindmap)==null?void 0:u.padding)??Sn.mindmap.padding;switch(n){case Ta.ROUNDED_RECT:case Ta.RECT:case Ta.HEXAGON:a*=2}const o={id:Ln(e,s)||"kbn"+Tj++,level:t,label:Ln(r,s),width:((h=s.mindmap)==null?void 0:h.maxNodeWidth)??Sn.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(i!==void 0){let d;i.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var A=this.next();return A||this.lex()},"lex"),begin:w(function(A){this.conditionStack.push(A)},"begin"),popState:w(function(){var A=this.conditionStack.length-1;return A>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(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:w(function(A){this.begin(A)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(A,R,_,P){switch(_){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 N=/\n\s*/g;return R.yytext=R.yytext.replace(N,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return A.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:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return A.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:A.getLogger().trace("end icon"),this.popState();break;case 16:return A.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return A.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return A.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:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return A.getLogger().trace("description:",R.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),A.getLogger().trace("node end ...",R.yytext),"NODE_DEND";case 36:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 41:return A.getLogger().trace("Long description:",R.yytext),21;case 42:return A.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 k})();T.lexer=C;function S(){this.yy={}}return w(S,"Parser"),S.prototype=T,T.Parser=S,new S})();Sj.parser=Sj;var Tmr=Sj,hu=[],zne=[],Ej=0,Vne={},Cmr=w(()=>{hu=[],zne=[],Ej=0,Vne={}},"clear"),kmr=w(t=>{if(hu.length===0)return null;const e=hu[0].level;let r=null;for(let n=hu.length-1;n>=0;n--)if(hu[n].level===e&&!r&&(r=hu[n]),hu[n].levelo.parentId===i.id);for(const o of a){const l={id:o.id,parentId:i.id,label:Ln(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Ve()}},"getData"),Emr=w((t,e,r,n,i)=>{var u,h;const s=Ve();let a=((u=s.mindmap)==null?void 0:u.padding)??Sn.mindmap.padding;switch(n){case Ta.ROUNDED_RECT:case Ta.RECT:case Ta.HEXAGON:a*=2}const o={id:Ln(e,s)||"kbn"+Ej++,level:t,label:Ln(r,s),width:((h=s.mindmap)==null?void 0:h.maxNodeWidth)??Sn.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=KN(d,{schema:XN});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=lmr(t);l?o.parentId=l.id||"kbn"+Tj++:Pne.push(o),lu.push(o)},"addNode"),Ta={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},hmr=w((t,e)=>{switch(de.debug("In get type",t,e),t){case"[":return Ta.RECT;case"(":return e===")"?Ta.ROUNDED_RECT:Ta.CLOUD;case"((":return Ta.CIRCLE;case")":return Ta.CLOUD;case"))":return Ta.BANG;case"{{":return Ta.HEXAGON;default:return Ta.DEFAULT}},"getType"),dmr=w((t,e)=>{$ne[t]=e},"setElementForId"),fmr=w(t=>{if(!t)return;const e=Ve(),r=lu[lu.length-1];t.icon&&(r.icon=Ln(t.icon,e)),t.class&&(r.cssClasses=Ln(t.class,e))},"decorateNode"),pmr=w(t=>{switch(t){case Ta.DEFAULT:return"no-border";case Ta.RECT:return"rect";case Ta.ROUNDED_RECT:return"rounded-rect";case Ta.CIRCLE:return"circle";case Ta.CLOUD:return"cloud";case Ta.BANG:return"bang";case Ta.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),gmr=w(()=>de,"getLogger"),mmr=w(t=>$ne[t],"getElementById"),ymr={clear:omr,addNode:umr,getSections:Vqe,getData:cmr,nodeType:Ta,getType:hmr,setElementForId:dmr,decorateNode:fmr,type2Str:pmr,getLogger:gmr,getElementById:mmr},vmr=ymr,bmr=w(async(t,e,r,n)=>{var y,v,x,b,T;de.debug(`Rendering kanban diagram -`+t);const s=n.db.getData(),a=Ve();a.htmlLabels=!1;const o=Xo(e);for(const C of s.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=s.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const S=((y=a==null?void 0:a.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=S*d+(d-1)*f/2,C.width=S,C.y=0,C.height=S*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await iD(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const S=p[m];m=m+1;const k=((x=a==null?void 0:a.kanban)==null?void 0:x.sectionWidth)||200,E=-k*3/2+g;let A=E;const R=s.nodes.filter(N=>N.parentId===C.id);for(const N of R){if(N.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");N.x=C.x,N.width=k-1.5*f;const I=(await r7(u,N,{config:a})).node().getBBox();N.y=A+I.height/2,await u_(N),A=N.y+I.height/2+f/2}const _=S.cluster.select("rect"),P=Math.max(A-E+3*f,50)+(g-25);_.attr("height",P)}n3(void 0,o,((b=a.mindmap)==null?void 0:b.padding)??Sn.kanban.padding,((T=a.mindmap)==null?void 0:T.useMaxWidth)??Sn.kanban.useMaxWidth)},"draw"),xmr={draw:bmr},wmr=w(t=>{let e="";for(let n=0;nt.darkMode?ut(n,i):ct(n,i),"adjuster");for(let n=0;n{switch(de.debug("In get type",t,e),t){case"[":return Ta.RECT;case"(":return e===")"?Ta.ROUNDED_RECT:Ta.CLOUD;case"((":return Ta.CIRCLE;case")":return Ta.CLOUD;case"))":return Ta.BANG;case"{{":return Ta.HEXAGON;default:return Ta.DEFAULT}},"getType"),Mmr=w((t,e)=>{Vne[t]=e},"setElementForId"),Rmr=w(t=>{if(!t)return;const e=Ve(),r=hu[hu.length-1];t.icon&&(r.icon=Ln(t.icon,e)),t.class&&(r.cssClasses=Ln(t.class,e))},"decorateNode"),_mr=w(t=>{switch(t){case Ta.DEFAULT:return"no-border";case Ta.RECT:return"rect";case Ta.ROUNDED_RECT:return"rounded-rect";case Ta.CIRCLE:return"circle";case Ta.CLOUD:return"cloud";case Ta.BANG:return"bang";case Ta.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Lmr=w(()=>de,"getLogger"),Imr=w(t=>Vne[t],"getElementById"),Nmr={clear:Cmr,addNode:Emr,getSections:Yqe,getData:Smr,nodeType:Ta,getType:Amr,setElementForId:Mmr,decorateNode:Rmr,type2Str:_mr,getLogger:Lmr,getElementById:Imr},Dmr=Nmr,Omr=w(async(t,e,r,n)=>{var y,v,x,b,T;de.debug(`Rendering kanban diagram +`+t);const s=n.db.getData(),a=Ve();a.htmlLabels=!1;const o=Xo(e);for(const C of s.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=s.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const S=((y=a==null?void 0:a.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=S*d+(d-1)*f/2,C.width=S,C.y=0,C.height=S*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await oD(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const S=p[m];m=m+1;const k=((x=a==null?void 0:a.kanban)==null?void 0:x.sectionWidth)||200,E=-k*3/2+g;let A=E;const R=s.nodes.filter(N=>N.parentId===C.id);for(const N of R){if(N.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");N.x=C.x,N.width=k-1.5*f;const I=(await s7(u,N,{config:a})).node().getBBox();N.y=A+I.height/2,await p_(N),A=N.y+I.height/2+f/2}const _=S.cluster.select("rect"),P=Math.max(A-E+3*f,50)+(g-25);_.attr("height",P)}a3(void 0,o,((b=a.mindmap)==null?void 0:b.padding)??Sn.kanban.padding,((T=a.mindmap)==null?void 0:T.useMaxWidth)??Sn.kanban.useMaxWidth)},"draw"),Pmr={draw:Omr},$mr=w(t=>{let e="";for(let n=0;nt.darkMode?ut(n,i):ct(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),Bmr=w(t=>` .edge { stroke-width: 3; } - ${wmr(t)} + ${$mr(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -5147,15 +5154,15 @@ Expecting `+$e.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Fe="Parse erro dominant-baseline: middle; text-align: center; } - ${S7()} -`,"getStyles"),Cmr=Tmr,kmr={db:vmr,renderer:xmr,parser:amr,styles:Cmr};const Smr=Object.freeze(Object.defineProperty({__proto__:null,diagram:kmr},Symbol.toStringTag,{value:"Module"}));function oye(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Hqe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function xV(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function Emr(t){return t.target.depth}function Amr(t){return t.depth}function Mmr(t,e){return e-1-t.height}function Gqe(t,e){return t.sourceLinks.length?t.depth:e-1}function Rmr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Hqe(t.sourceLinks,Emr)-1:0}function sM(t){return function(){return t}}function lye(t,e){return VI(t.source,e.source)||t.index-e.index}function cye(t,e){return VI(t.target,e.target)||t.index-e.index}function VI(t,e){return t.y0-e.y0}function wV(t){return t.value}function _mr(t){return t.index}function Lmr(t){return t.nodes}function Imr(t){return t.links}function uye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function hye({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function Nmr(){let t=0,e=0,r=1,n=1,i=24,s=8,a,o=_mr,l=Gqe,u,h,d=Lmr,f=Imr,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),x(I),C(I),hye(I),I}g.update=function(I){return hye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:sM(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:sM(I),g):l},g.nodeSort=function(I){return arguments.length?(u=I,g):u},g.nodeWidth=function(I){return arguments.length?(i=+I,g):i},g.nodePadding=function(I){return arguments.length?(s=a=+I,g):s},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:sM(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:sM(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:$}){for(const[D,F]of I.entries())F.index=D,F.sourceLinks=[],F.targetLinks=[];const O=new Map(I.map((D,F)=>[o(D,F,I),D]));for(const[D,F]of $.entries()){F.index=D;let{source:z,target:V}=F;typeof z!="object"&&(z=F.source=uye(O,z)),typeof V!="object"&&(V=F.target=uye(O,V)),z.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:D,targetLinks:F}of I)D.sort(h),F.sort(h)}function y({nodes:I}){for(const $ of I)$.value=$.fixedValue===void 0?Math.max(xV($.sourceLinks,wV),xV($.targetLinks,wV)):$.fixedValue}function v({nodes:I}){const $=I.length;let O=new Set(I),D=new Set,F=0;for(;O.size;){for(const z of O){z.depth=F;for(const{target:V}of z.sourceLinks)D.add(V)}if(++F>$)throw new Error("circular link");O=D,D=new Set}}function x({nodes:I}){const $=I.length;let O=new Set(I),D=new Set,F=0;for(;O.size;){for(const z of O){z.height=F;for(const{source:V}of z.targetLinks)D.add(V)}if(++F>$)throw new Error("circular link");O=D,D=new Set}}function b({nodes:I}){const $=oye(I,F=>F.depth)+1,O=(r-t-i)/($-1),D=new Array($);for(const F of I){const z=Math.max(0,Math.min($-1,Math.floor(l.call(null,F,$))));F.layer=z,F.x0=t+z*O,F.x1=F.x0+i,D[z]?D[z].push(F):D[z]=[F]}if(u)for(const F of D)F.sort(u);return D}function T(I){const $=Hqe(I,O=>(n-e-(O.length-1)*a)/xV(O,wV));for(const O of I){let D=e;for(const F of O){F.y0=D,F.y1=D+F.value*$,D=F.y1+a;for(const z of F.sourceLinks)z.width=z.value*$}D=(n-D+a)/(O.length+1);for(let F=0;FO.length)-1)),T($);for(let O=0;O0))continue;let G=(B/H-V.y0)*$;V.y0+=G,V.y1+=G,_(V)}u===void 0&&z.sort(VI),E(z,O)}}function k(I,$,O){for(let D=I.length,F=D-2;F>=0;--F){const z=I[F];for(const V of z){let B=0,H=0;for(const{target:W,value:K}of V.sourceLinks){let q=K*(W.layer-V.layer);B+=L(V,W)*q,H+=q}if(!(H>0))continue;let G=(B/H-V.y0)*$;V.y0+=G,V.y1+=G,_(V)}u===void 0&&z.sort(VI),E(z,O)}}function E(I,$){const O=I.length>>1,D=I[O];R(I,D.y0-a,O-1,$),A(I,D.y1+a,O+1,$),R(I,n,I.length-1,$),A(I,e,0,$)}function A(I,$,O,D){for(;O1e-6&&(F.y0+=z,F.y1+=z),$=F.y1+a}}function R(I,$,O,D){for(;O>=0;--O){const F=I[O],z=(F.y1-$)*D;z>1e-6&&(F.y0-=z,F.y1-=z),$=F.y0-a}}function _({sourceLinks:I,targetLinks:$}){if(h===void 0){for(const{source:{sourceLinks:O}}of $)O.sort(cye);for(const{target:{targetLinks:O}}of I)O.sort(lye)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(cye),O.sort(lye)}function N(I,$){let O=I.y0-(I.sourceLinks.length-1)*a/2;for(const{target:D,width:F}of I.sourceLinks){if(D===$)break;O+=F+a}for(const{source:D,width:F}of $.targetLinks){if(D===I)break;O-=F}return O}function L(I,$){let O=$.y0-($.targetLinks.length-1)*a/2;for(const{source:D,width:F}of $.targetLinks){if(D===I)break;O+=F+a}for(const{target:D,width:F}of I.sourceLinks){if(D===$)break;O-=F}return O}return g}var Cj=Math.PI,kj=2*Cj,i1=1e-6,Dmr=kj-i1;function Sj(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Wqe(){return new Sj}Sj.prototype=Wqe.prototype={constructor:Sj,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,s){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var s=this._x1,a=this._y1,o=r-t,l=n-e,u=s-t,h=a-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>i1)if(!(Math.abs(h*o-l*u)>i1)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-s,p=n-a,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),x=i*Math.tan((Cj-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,T=x/y;Math.abs(b-1)>i1&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+T*o)+","+(this._y1=e+T*l)}},arc:function(t,e,r,n,i,s){t=+t,e=+e,r=+r,s=!!s;var a=r*Math.cos(n),o=r*Math.sin(n),l=t+a,u=e+o,h=1^s,d=s?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>i1||Math.abs(this._y1-u)>i1)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%kj+kj),d>Dmr?this._+="A"+r+","+r+",0,1,"+h+","+(t-a)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>i1&&(this._+="A"+r+","+r+",0,"+ +(d>=Cj)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function dye(t){return function(){return t}}function Omr(t){return t[0]}function Pmr(t){return t[1]}var $mr=Array.prototype.slice;function Bmr(t){return t.source}function Fmr(t){return t.target}function zmr(t){var e=Bmr,r=Fmr,n=Omr,i=Pmr,s=null;function a(){var o,l=$mr.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(s||(s=o=Wqe()),t(s,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(e=o,a):e},a.target=function(o){return arguments.length?(r=o,a):r},a.x=function(o){return arguments.length?(n=typeof o=="function"?o:dye(+o),a):n},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:dye(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Vmr(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Hmr(){return zmr(Vmr)}function Gmr(t){return[t.source.x1,t.y0]}function Wmr(t){return[t.target.x0,t.y1]}function qmr(){return Hmr().source(Gmr).target(Wmr)}var Ej=(function(){var t=w(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:w(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:w(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:w(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,T=p.slice.call(arguments,1),C=Object.create(this.lexer),S={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(S.yy[k]=this.yy[k]);C.setInput(l,S.yy),S.yy.lexer=C,S.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var A=C.options&&C.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(B){h.length=h.length-2*B,f.length=f.length-B,p.length=p.length-B}w(R,"popStack");function _(){var B;return B=d.pop()||C.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}w(_,"lex");for(var P,N,L,I,$={},O,D,F,z;;){if(N=h[h.length-1],this.defaultActions[N]?L=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=_()),L=g[N]&&g[N][P]),typeof L>"u"||!L.length||!L[0]){var V="";z=[];for(O in g[N])this.terminals_[O]&&O>x&&z.push("'"+this.terminals_[O]+"'");C.showPosition?V="Parse error on line "+(y+1)+`: + ${M7()} +`,"getStyles"),Fmr=Bmr,zmr={db:Dmr,renderer:Pmr,parser:Tmr,styles:Fmr};const Vmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:zmr},Symbol.toStringTag,{value:"Module"}));function fye(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function jqe(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function kV(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function Hmr(t){return t.target.depth}function Gmr(t){return t.depth}function Wmr(t,e){return e-1-t.height}function Xqe(t,e){return t.sourceLinks.length?t.depth:e-1}function qmr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?jqe(t.sourceLinks,Hmr)-1:0}function cM(t){return function(){return t}}function pye(t,e){return WI(t.source,e.source)||t.index-e.index}function gye(t,e){return WI(t.target,e.target)||t.index-e.index}function WI(t,e){return t.y0-e.y0}function SV(t){return t.value}function Umr(t){return t.index}function Ymr(t){return t.nodes}function jmr(t){return t.links}function mye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function yye({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function Xmr(){let t=0,e=0,r=1,n=1,i=24,s=8,a,o=Umr,l=Xqe,u,h,d=Ymr,f=jmr,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),x(I),C(I),yye(I),I}g.update=function(I){return yye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:cM(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:cM(I),g):l},g.nodeSort=function(I){return arguments.length?(u=I,g):u},g.nodeWidth=function(I){return arguments.length?(i=+I,g):i},g.nodePadding=function(I){return arguments.length?(s=a=+I,g):s},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:cM(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:cM(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:$}){for(const[D,F]of I.entries())F.index=D,F.sourceLinks=[],F.targetLinks=[];const O=new Map(I.map((D,F)=>[o(D,F,I),D]));for(const[D,F]of $.entries()){F.index=D;let{source:z,target:V}=F;typeof z!="object"&&(z=F.source=mye(O,z)),typeof V!="object"&&(V=F.target=mye(O,V)),z.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:D,targetLinks:F}of I)D.sort(h),F.sort(h)}function y({nodes:I}){for(const $ of I)$.value=$.fixedValue===void 0?Math.max(kV($.sourceLinks,SV),kV($.targetLinks,SV)):$.fixedValue}function v({nodes:I}){const $=I.length;let O=new Set(I),D=new Set,F=0;for(;O.size;){for(const z of O){z.depth=F;for(const{target:V}of z.sourceLinks)D.add(V)}if(++F>$)throw new Error("circular link");O=D,D=new Set}}function x({nodes:I}){const $=I.length;let O=new Set(I),D=new Set,F=0;for(;O.size;){for(const z of O){z.height=F;for(const{source:V}of z.targetLinks)D.add(V)}if(++F>$)throw new Error("circular link");O=D,D=new Set}}function b({nodes:I}){const $=fye(I,F=>F.depth)+1,O=(r-t-i)/($-1),D=new Array($);for(const F of I){const z=Math.max(0,Math.min($-1,Math.floor(l.call(null,F,$))));F.layer=z,F.x0=t+z*O,F.x1=F.x0+i,D[z]?D[z].push(F):D[z]=[F]}if(u)for(const F of D)F.sort(u);return D}function T(I){const $=jqe(I,O=>(n-e-(O.length-1)*a)/kV(O,SV));for(const O of I){let D=e;for(const F of O){F.y0=D,F.y1=D+F.value*$,D=F.y1+a;for(const z of F.sourceLinks)z.width=z.value*$}D=(n-D+a)/(O.length+1);for(let F=0;FO.length)-1)),T($);for(let O=0;O0))continue;let G=(B/H-V.y0)*$;V.y0+=G,V.y1+=G,_(V)}u===void 0&&z.sort(WI),E(z,O)}}function k(I,$,O){for(let D=I.length,F=D-2;F>=0;--F){const z=I[F];for(const V of z){let B=0,H=0;for(const{target:W,value:K}of V.sourceLinks){let q=K*(W.layer-V.layer);B+=L(V,W)*q,H+=q}if(!(H>0))continue;let G=(B/H-V.y0)*$;V.y0+=G,V.y1+=G,_(V)}u===void 0&&z.sort(WI),E(z,O)}}function E(I,$){const O=I.length>>1,D=I[O];R(I,D.y0-a,O-1,$),A(I,D.y1+a,O+1,$),R(I,n,I.length-1,$),A(I,e,0,$)}function A(I,$,O,D){for(;O1e-6&&(F.y0+=z,F.y1+=z),$=F.y1+a}}function R(I,$,O,D){for(;O>=0;--O){const F=I[O],z=(F.y1-$)*D;z>1e-6&&(F.y0-=z,F.y1-=z),$=F.y0-a}}function _({sourceLinks:I,targetLinks:$}){if(h===void 0){for(const{source:{sourceLinks:O}}of $)O.sort(gye);for(const{target:{targetLinks:O}}of I)O.sort(pye)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(gye),O.sort(pye)}function N(I,$){let O=I.y0-(I.sourceLinks.length-1)*a/2;for(const{target:D,width:F}of I.sourceLinks){if(D===$)break;O+=F+a}for(const{source:D,width:F}of $.targetLinks){if(D===I)break;O-=F}return O}function L(I,$){let O=$.y0-($.targetLinks.length-1)*a/2;for(const{source:D,width:F}of $.targetLinks){if(D===I)break;O+=F+a}for(const{target:D,width:F}of I.sourceLinks){if(D===$)break;O-=F}return O}return g}var Aj=Math.PI,Mj=2*Aj,o1=1e-6,Kmr=Mj-o1;function Rj(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Kqe(){return new Rj}Rj.prototype=Kqe.prototype={constructor:Rj,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,s){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var s=this._x1,a=this._y1,o=r-t,l=n-e,u=s-t,h=a-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>o1)if(!(Math.abs(h*o-l*u)>o1)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-s,p=n-a,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),x=i*Math.tan((Aj-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,T=x/y;Math.abs(b-1)>o1&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+T*o)+","+(this._y1=e+T*l)}},arc:function(t,e,r,n,i,s){t=+t,e=+e,r=+r,s=!!s;var a=r*Math.cos(n),o=r*Math.sin(n),l=t+a,u=e+o,h=1^s,d=s?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>o1||Math.abs(this._y1-u)>o1)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%Mj+Mj),d>Kmr?this._+="A"+r+","+r+",0,1,"+h+","+(t-a)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>o1&&(this._+="A"+r+","+r+",0,"+ +(d>=Aj)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function vye(t){return function(){return t}}function Zmr(t){return t[0]}function Qmr(t){return t[1]}var Jmr=Array.prototype.slice;function e1r(t){return t.source}function t1r(t){return t.target}function r1r(t){var e=e1r,r=t1r,n=Zmr,i=Qmr,s=null;function a(){var o,l=Jmr.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(s||(s=o=Kqe()),t(s,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(e=o,a):e},a.target=function(o){return arguments.length?(r=o,a):r},a.x=function(o){return arguments.length?(n=typeof o=="function"?o:vye(+o),a):n},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:vye(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function n1r(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function i1r(){return r1r(n1r)}function s1r(t){return[t.source.x1,t.y0]}function a1r(t){return[t.target.x0,t.y1]}function o1r(){return i1r().source(s1r).target(a1r)}var _j=(function(){var t=w(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:w(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:w(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:w(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,T=p.slice.call(arguments,1),C=Object.create(this.lexer),S={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(S.yy[k]=this.yy[k]);C.setInput(l,S.yy),S.yy.lexer=C,S.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var A=C.options&&C.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(B){h.length=h.length-2*B,f.length=f.length-B,p.length=p.length-B}w(R,"popStack");function _(){var B;return B=d.pop()||C.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}w(_,"lex");for(var P,N,L,I,$={},O,D,F,z;;){if(N=h[h.length-1],this.defaultActions[N]?L=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=_()),L=g[N]&&g[N][P]),typeof L>"u"||!L.length||!L[0]){var V="";z=[];for(O in g[N])this.terminals_[O]&&O>x&&z.push("'"+this.terminals_[O]+"'");C.showPosition?V="Parse error on line "+(y+1)+`: `+C.showPosition()+` Expecting `+z.join(", ")+", got '"+(this.terminals_[P]||P)+"'":V="Parse error on line "+(y+1)+": Unexpected "+(P==b?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(V,{text:C.match,token:this.terminals_[P]||P,line:C.yylineno,loc:E,expected:z})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+P);switch(L[0]){case 1:h.push(P),f.push(C.yytext),p.push(C.yylloc),h.push(L[1]),P=null,v=C.yyleng,m=C.yytext,y=C.yylineno,E=C.yylloc;break;case 2:if(D=this.productions_[L[1]][1],$.$=f[f.length-D],$._$={first_line:p[p.length-(D||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(D||1)].first_column,last_column:p[p.length-1].last_column},A&&($._$.range=[p[p.length-(D||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply($,[m,v,y,S.yy,L[1],f,p].concat(T)),typeof I<"u")return I;D&&(h=h.slice(0,-1*D*2),f=f.slice(0,-1*D),p=p.slice(0,-1*D)),h.push(this.productions_[L[1]][0]),f.push($.$),p.push($._$),F=g[h[h.length-2]][h[h.length-1]],h.push(F);break;case 3:return!0}}return!0},"parse")},s=(function(){var o={EOF:1,parseError:w(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:w(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:w(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more: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(l){this.unput(this.match.slice(l))},"less"),pastInput:w(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:w(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:w(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:w(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var u=this.next();return u||this.lex()},"lex"),begin:w(function(u){this.conditionStack.push(u)},"begin"),popState:w(function(){var u=this.conditionStack.length-1;return u>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(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:w(function(u){this.begin(u)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=s;function a(){this.yy={}}return w(a,"Parser"),a.prototype=i,i.Parser=a,new a})();Ej.parser=Ej;var HI=Ej,LP=[],IP=[],GI=new Map,Umr=w(()=>{LP=[],IP=[],GI=new Map,Ri()},"clear"),TT,Ymr=(TT=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(TT,"SankeyLink"),TT),jmr=w((t,e,r)=>{LP.push(new Ymr(t,e,r))},"addLink"),CT,Xmr=(CT=class{constructor(e){this.ID=e}},w(CT,"SankeyNode"),CT),Kmr=w(t=>{t=Vt.sanitizeText(t,Ve());let e=GI.get(t);return e===void 0&&(e=new Xmr(t),GI.set(t,e),IP.push(e)),e},"findOrCreateNode"),Zmr=w(()=>IP,"getNodes"),Qmr=w(()=>LP,"getLinks"),Jmr=w(()=>({nodes:IP.map(t=>({id:t.ID})),links:LP.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),e1r={nodesMap:GI,getConfig:w(()=>Ve().sankey,"getConfig"),getNodes:Zmr,getLinks:Qmr,getGraph:Jmr,addLink:jmr,findOrCreateNode:Kmr,getAccTitle:ts,setAccTitle:Hi,getAccDescription:ns,setAccDescription:rs,getDiagramTitle:qi,setDiagramTitle:Ji,clear:Umr},qf,fye=(qf=class{static next(e){return new qf(e+ ++qf.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},w(qf,"Uid"),qf.count=0,qf),t1r={left:Amr,right:Mmr,center:Rmr,justify:Gqe},r1r=w(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),n1r=w(function(t,e,r,n){const{securityLevel:i,sankey:s}=Ve(),a=hTe.sankey;let o;i==="sandbox"&&(o=wt("#i"+e));const l=wt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):wt(`[id="${e}"]`),h=(s==null?void 0:s.width)??a.width,d=(s==null?void 0:s.height)??a.width,f=(s==null?void 0:s.useMaxWidth)??a.useMaxWidth,p=(s==null?void 0:s.nodeAlignment)??a.nodeAlignment,g=(s==null?void 0:s.prefix)??a.prefix,m=(s==null?void 0:s.suffix)??a.suffix,y=(s==null?void 0:s.showValues)??a.showValues,v=(s==null?void 0:s.nodeWidth)??a.nodeWidth??10,x=(s==null?void 0:s.nodePadding)??a.nodePadding??12,b=(s==null?void 0:s.labelStyle)??a.labelStyle??"legacy",T=(s==null?void 0:s.nodeColors)??{},C=n.db.getGraph(),S=t1r[p];Nmr().nodeId(D=>D.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=r1r(C.nodes),A=Q1(e4t),R=w(D=>T[D]??A(D),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",D=>(D.uid=fye.next("node-")).id).attr("transform",function(D){return"translate("+D.x0+","+D.y0+")"}).attr("x",D=>D.x0).attr("y",D=>D.y0).append("rect").attr("height",D=>D.y1-D.y0).attr("width",D=>D.x1-D.x0).attr("fill",D=>R(D.id));const _=w(({id:D,value:F})=>y?`${D} -${g}${Math.round(F*100)/100}${m}`:D,"getText"),P=w(D=>b==="outlined"?(D.layer??0)N.selectAll(D?`.${D}`:"text").data(C.nodes).join("text").attr("class",D??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",F=>P(F).anchor).text(_),"appendLabel");b==="outlined"?(L("sankey-label-bg"),L("sankey-label-fg")):L();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=(s==null?void 0:s.linkColor)??"gradient";if($==="gradient"){const D=I.append("linearGradient").attr("id",F=>(F.uid=fye.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);D.append("stop").attr("offset","0%").attr("stop-color",F=>R(F.source.id)),D.append("stop").attr("offset","100%").attr("stop-color",F=>R(F.target.id))}let O;switch($){case"gradient":O=w(D=>D.uid,"coloring");break;case"source":O=w(D=>R(D.source.id),"coloring");break;case"target":O=w(D=>R(D.target.id),"coloring");break;default:O=$}I.append("path").attr("d",qmr()).attr("stroke",O).attr("stroke-width",D=>Math.max(1,D.width)),n3(void 0,u,0,f)},"draw"),i1r={draw:n1r},s1r=w(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),a1r=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var u=this.next();return u||this.lex()},"lex"),begin:w(function(u){this.conditionStack.push(u)},"begin"),popState:w(function(){var u=this.conditionStack.length-1;return u>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(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:w(function(u){this.begin(u)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=s;function a(){this.yy={}}return w(a,"Parser"),a.prototype=i,i.Parser=a,new a})();_j.parser=_j;var qI=_j,DP=[],OP=[],UI=new Map,l1r=w(()=>{DP=[],OP=[],UI=new Map,Ri()},"clear"),kT,c1r=(kT=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(kT,"SankeyLink"),kT),u1r=w((t,e,r)=>{DP.push(new c1r(t,e,r))},"addLink"),ST,h1r=(ST=class{constructor(e){this.ID=e}},w(ST,"SankeyNode"),ST),d1r=w(t=>{t=Vt.sanitizeText(t,Ve());let e=UI.get(t);return e===void 0&&(e=new h1r(t),UI.set(t,e),OP.push(e)),e},"findOrCreateNode"),f1r=w(()=>OP,"getNodes"),p1r=w(()=>DP,"getLinks"),g1r=w(()=>({nodes:OP.map(t=>({id:t.ID})),links:DP.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),m1r={nodesMap:UI,getConfig:w(()=>Ve().sankey,"getConfig"),getNodes:f1r,getLinks:p1r,getGraph:g1r,addLink:u1r,findOrCreateNode:d1r,getAccTitle:ts,setAccTitle:Hi,getAccDescription:ns,setAccDescription:rs,getDiagramTitle:qi,setDiagramTitle:Ji,clear:l1r},Xf,bye=(Xf=class{static next(e){return new Xf(e+ ++Xf.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},w(Xf,"Uid"),Xf.count=0,Xf),y1r={left:Gmr,right:Wmr,center:qmr,justify:Xqe},v1r=w(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),b1r=w(function(t,e,r,n){const{securityLevel:i,sankey:s}=Ve(),a=yTe.sankey;let o;i==="sandbox"&&(o=wt("#i"+e));const l=wt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):wt(`[id="${e}"]`),h=(s==null?void 0:s.width)??a.width,d=(s==null?void 0:s.height)??a.width,f=(s==null?void 0:s.useMaxWidth)??a.useMaxWidth,p=(s==null?void 0:s.nodeAlignment)??a.nodeAlignment,g=(s==null?void 0:s.prefix)??a.prefix,m=(s==null?void 0:s.suffix)??a.suffix,y=(s==null?void 0:s.showValues)??a.showValues,v=(s==null?void 0:s.nodeWidth)??a.nodeWidth??10,x=(s==null?void 0:s.nodePadding)??a.nodePadding??12,b=(s==null?void 0:s.labelStyle)??a.labelStyle??"legacy",T=(s==null?void 0:s.nodeColors)??{},C=n.db.getGraph(),S=y1r[p];Xmr().nodeId(D=>D.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=v1r(C.nodes),A=ey(a4t),R=w(D=>T[D]??A(D),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",D=>(D.uid=bye.next("node-")).id).attr("transform",function(D){return"translate("+D.x0+","+D.y0+")"}).attr("x",D=>D.x0).attr("y",D=>D.y0).append("rect").attr("height",D=>D.y1-D.y0).attr("width",D=>D.x1-D.x0).attr("fill",D=>R(D.id));const _=w(({id:D,value:F})=>y?`${D} +${g}${Math.round(F*100)/100}${m}`:D,"getText"),P=w(D=>b==="outlined"?(D.layer??0)N.selectAll(D?`.${D}`:"text").data(C.nodes).join("text").attr("class",D??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",F=>P(F).anchor).text(_),"appendLabel");b==="outlined"?(L("sankey-label-bg"),L("sankey-label-fg")):L();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=(s==null?void 0:s.linkColor)??"gradient";if($==="gradient"){const D=I.append("linearGradient").attr("id",F=>(F.uid=bye.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);D.append("stop").attr("offset","0%").attr("stop-color",F=>R(F.source.id)),D.append("stop").attr("offset","100%").attr("stop-color",F=>R(F.target.id))}let O;switch($){case"gradient":O=w(D=>D.uid,"coloring");break;case"source":O=w(D=>R(D.source.id),"coloring");break;case"target":O=w(D=>R(D.target.id),"coloring");break;default:O=$}I.append("path").attr("d",o1r()).attr("stroke",O).attr("stroke-width",D=>Math.max(1,D.width)),a3(void 0,u,0,f)},"draw"),x1r={draw:b1r},w1r=w(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),T1r=w(t=>`.label { font-family: ${t.fontFamily}; } @@ -5187,7 +5194,7 @@ ${g}${Math.round(F*100)/100}${m}`:D,"getText"),P=w(D=>b==="outlined"?(D.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),o1r=a1r,l1r=HI.parse.bind(HI);HI.parse=t=>l1r(s1r(t));var c1r={styles:o1r,parser:HI,db:e1r,renderer:i1r};const u1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:c1r},Symbol.toStringTag,{value:"Module"}));var h1r=Sn.packet,kT,qqe=(kT=class{constructor(){this.packet=[],this.setAccTitle=Hi,this.getAccTitle=ts,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getAccDescription=ns,this.setAccDescription=rs}getConfig(){const e=es({...h1r,...vr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Ri(),this.packet=[]}},w(kT,"PacketDB"),kT),d1r=1e4,f1r=w((t,e)=>{Fl(t,e);let r=-1,n=[],i=1;const{bitsPerRow:s}=e.getConfig();for(let{start:a,end:o,bits:l,label:u}of t.blocks){if(a!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),Uqe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await $u("packet",t),r=(n=Uqe.parser)==null?void 0:n.yy;if(!(r instanceof qqe))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.");de.debug(e),f1r(e,r)},"parse")},g1r=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:l,bitsPerRow:u}=s,h=i.getPacket(),d=i.getDiagramTitle(),f=a+o,p=f*(h.length+1)-(d?0:a),g=l*u+2,m=Xo(e);m.attr("viewBox",`0 0 ${g} ${p}`),Fs(m,p,g,s.useMaxWidth);for(const[y,v]of h.entries())m1r(m,v,y,s);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),m1r=w((t,e,r,{rowHeight:n,paddingX:i,paddingY:s,bitWidth:a,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+s)+s;for(const d of e){const f=d.start%o*a+1,p=(d.end-d.start+1)*a-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),y1r={draw:g1r},v1r={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},b1r=w(({packet:t}={})=>{const e=es(v1r,t);return` +`,"getStyles"),C1r=T1r,k1r=qI.parse.bind(qI);qI.parse=t=>k1r(w1r(t));var S1r={styles:C1r,parser:qI,db:m1r,renderer:x1r};const E1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:S1r},Symbol.toStringTag,{value:"Module"}));var A1r=Sn.packet,ET,Zqe=(ET=class{constructor(){this.packet=[],this.setAccTitle=Hi,this.getAccTitle=ts,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getAccDescription=ns,this.setAccDescription=rs}getConfig(){const e=es({...A1r,...br().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Ri(),this.packet=[]}},w(ET,"PacketDB"),ET),M1r=1e4,R1r=w((t,e)=>{Vl(t,e);let r=-1,n=[],i=1;const{bitsPerRow:s}=e.getConfig();for(let{start:a,end:o,bits:l,label:u}of t.blocks){if(a!==void 0&&o!==void 0&&o{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),Qqe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("packet",t),r=(n=Qqe.parser)==null?void 0:n.yy;if(!(r instanceof Zqe))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.");de.debug(e),R1r(e,r)},"parse")},L1r=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:l,bitsPerRow:u}=s,h=i.getPacket(),d=i.getDiagramTitle(),f=a+o,p=f*(h.length+1)-(d?0:a),g=l*u+2,m=Xo(e);m.attr("viewBox",`0 0 ${g} ${p}`),Fs(m,p,g,s.useMaxWidth);for(const[y,v]of h.entries())I1r(m,v,y,s);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),I1r=w((t,e,r,{rowHeight:n,paddingX:i,paddingY:s,bitWidth:a,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+s)+s;for(const d of e){const f=d.start%o*a+1,p=(d.end-d.start+1)*a-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),N1r={draw:L1r},D1r={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},O1r=w(({packet:t}={})=>{const e=es(D1r,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -5210,7 +5217,7 @@ ${g}${Math.round(F*100)/100}${m}`:D,"getText"),P=w(D=>b==="outlined"?(D.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),x1r={parser:Uqe,get db(){return new qqe},renderer:y1r,styles:b1r};const w1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:x1r},Symbol.toStringTag,{value:"Module"}));var G2={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},aM=32,Yqe={axes:[],curves:[],options:G2},bd=structuredClone(Yqe),T1r=Sn.radar,C1r=w(()=>es({...T1r,...vr().radar}),"getConfig"),jqe=w(()=>bd.axes,"getAxes"),k1r=w(()=>bd.curves,"getCurves"),S1r=w(()=>bd.options,"getOptions"),E1r=w(t=>{bd.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),A1r=w(t=>{bd.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:M1r(e.entries)}))},"setCurves"),M1r=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=jqe();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var s;return((s=i.axis)==null?void 0:s.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),R1r=w(t=>{var r,n,i,s,a;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});bd.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??G2.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??G2.ticks,max:((i=e.max)==null?void 0:i.value)??G2.max,min:((s=e.min)==null?void 0:s.value)??G2.min,graticule:((a=e.graticule)==null?void 0:a.value)??G2.graticule},bd.options.ticks>aM&&(de.warn(`Radar diagram ticks (${bd.options.ticks}) exceeds maximum allowed (${aM}). Using ${aM} instead.`),bd.options.ticks=aM)},"setOptions"),_1r=w(()=>{Ri(),bd=structuredClone(Yqe)},"clear"),Mk={getAxes:jqe,getCurves:k1r,getOptions:S1r,setAxes:E1r,setCurves:A1r,setOptions:R1r,getConfig:C1r,clear:_1r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},L1r=w(t=>{Fl(t,Mk);const{axes:e,curves:r,options:n}=t;Mk.setAxes(e),Mk.setCurves(r),Mk.setOptions(n)},"populate"),I1r={parse:w(async t=>{const e=await $u("radar",t);de.debug(e),L1r(e)},"parse")},N1r=w((t,e,r,n)=>{const i=n.db,s=i.getAxes(),a=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Xo(e),d=D1r(h,l),f=o.max??Math.max(...a.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;O1r(d,s,g,o.ticks,o.graticule),P1r(d,s,g,l),Xqe(d,s,a,p,f,o.graticule,l),Qqe(d,a,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),D1r=w((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Fs(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),O1r=w((t,e,r,n,i)=>{if(i==="circle")for(let s=0;s{const d=2*h*Math.PI/s-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),P1r=w((t,e,r,n)=>{const i=e.length;for(let s=0;s.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(a).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function Xqe(t,e,r,n,i,s,a){const o=e.length,l=Math.min(a.width,a.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=Kqe(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});s==="circle"?t.append("path").attr("d",Zqe(d,a.curveTension)).attr("class",`radarCurve-${h}`):s==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}w(Xqe,"drawCurves");function Kqe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(Kqe,"relativeRadius");function Zqe(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${s+l*a})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}w(Qqe,"drawLegend");var $1r={draw:N1r},B1r=w((t,e)=>{let r="";for(let n=0;nes({...B1r,...br().radar}),"getConfig"),eUe=w(()=>Td.axes,"getAxes"),z1r=w(()=>Td.curves,"getCurves"),V1r=w(()=>Td.options,"getOptions"),H1r=w(t=>{Td.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),G1r=w(t=>{Td.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:W1r(e.entries)}))},"setCurves"),W1r=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=eUe();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var s;return((s=i.axis)==null?void 0:s.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),q1r=w(t=>{var r,n,i,s,a;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Td.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??q2.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??q2.ticks,max:((i=e.max)==null?void 0:i.value)??q2.max,min:((s=e.min)==null?void 0:s.value)??q2.min,graticule:((a=e.graticule)==null?void 0:a.value)??q2.graticule},Td.options.ticks>uM&&(de.warn(`Radar diagram ticks (${Td.options.ticks}) exceeds maximum allowed (${uM}). Using ${uM} instead.`),Td.options.ticks=uM)},"setOptions"),U1r=w(()=>{Ri(),Td=structuredClone(Jqe)},"clear"),Lk={getAxes:eUe,getCurves:z1r,getOptions:V1r,setAxes:H1r,setCurves:G1r,setOptions:q1r,getConfig:F1r,clear:U1r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Y1r=w(t=>{Vl(t,Lk);const{axes:e,curves:r,options:n}=t;Lk.setAxes(e),Lk.setCurves(r),Lk.setOptions(n)},"populate"),j1r={parse:w(async t=>{const e=await zu("radar",t);de.debug(e),Y1r(e)},"parse")},X1r=w((t,e,r,n)=>{const i=n.db,s=i.getAxes(),a=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Xo(e),d=K1r(h,l),f=o.max??Math.max(...a.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;Z1r(d,s,g,o.ticks,o.graticule),Q1r(d,s,g,l),tUe(d,s,a,p,f,o.graticule,l),iUe(d,a,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),K1r=w((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Fs(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),Z1r=w((t,e,r,n,i)=>{if(i==="circle")for(let s=0;s{const d=2*h*Math.PI/s-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),Q1r=w((t,e,r,n)=>{const i=e.length;for(let s=0;s.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(a).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function tUe(t,e,r,n,i,s,a){const o=e.length,l=Math.min(a.width,a.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=rUe(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});s==="circle"?t.append("path").attr("d",nUe(d,a.curveTension)).attr("class",`radarCurve-${h}`):s==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}w(tUe,"drawCurves");function rUe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(rUe,"relativeRadius");function nUe(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${s+l*a})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}w(iUe,"drawLegend");var J1r={draw:X1r},eyr=w((t,e)=>{let r="";for(let n=0;nb==="outlined"?(D.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),F1r=w(t=>{const e=$0(),r=vr(),n=es(e,r.themeVariables),i=es(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),z1r=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=F1r(t);return` + `}return r},"genIndexStyles"),tyr=w(t=>{const e=V0(),r=br(),n=es(e,r.themeVariables),i=es(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),ryr=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=tyr(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -5249,13 +5256,13 @@ ${g}${Math.round(F*100)/100}${m}`:D,"getText"),P=w(D=>b==="outlined"?(D.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${B1r(e,r)} - `},"styles"),V1r={parser:I1r,db:Mk,renderer:$1r,styles:z1r};const H1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:V1r},Symbol.toStringTag,{value:"Module"}));var Aj=(function(){var t=w(function(b,T,C,S){for(C=C||{},S=b.length;S--;C[b[S]]=T);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],s=[1,19],a=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:w(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:w(function(T,C,S,k,E,A,R){var _=A.length-1;switch(E){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",A[_-1]),k.setHierarchy(A[_-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",A[_]),typeof A[_].length=="number"?this.$=A[_]:this.$=[A[_]];break;case 13:k.getLogger().debug("Rule: statement #2: ",A[_-1]),this.$=[A[_-1]].concat(A[_]);break;case 14:k.getLogger().debug("Rule: link: ",A[_],T),this.$={edgeTypeStr:A[_],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",A[_-3],A[_-1],A[_]),this.$={edgeTypeStr:A[_],label:A[_-1]};break;case 18:const P=parseInt(A[_]),N=k.generateId();this.$={id:N,type:"space",label:"",width:P,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",A[_-2],A[_-1],A[_]," typestr: ",A[_-1].edgeTypeStr);const L=k.edgeStrToEdgeData(A[_-1].edgeTypeStr),I=k.edgeStrToEdgeStartData(A[_-1].edgeTypeStr),$=k.edgeStrToThickness(A[_-1].edgeTypeStr),O=k.edgeStrToPattern(A[_-1].edgeTypeStr);this.$=[{id:A[_-2].id,label:A[_-2].label,type:A[_-2].type,directions:A[_-2].directions},{id:A[_-2].id+"-"+A[_].id,start:A[_-2].id,end:A[_].id,label:A[_-1].label,type:"edge",thickness:$,pattern:O,directions:A[_].directions,arrowTypeEnd:L,arrowTypeStart:I},{id:A[_].id,label:A[_].label,type:k.typeStr2Type(A[_].typeStr),directions:A[_].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",A[_-1],A[_]),this.$={id:A[_-1].id,label:A[_-1].label,type:k.typeStr2Type(A[_-1].typeStr),directions:A[_-1].directions,widthInColumns:parseInt(A[_],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",A[_]),this.$={id:A[_].id,label:A[_].label,type:k.typeStr2Type(A[_].typeStr),directions:A[_].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",A[_]),this.$={type:"column-setting",columns:A[_]==="auto"?-1:parseInt(A[_])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",A[_-2],A[_-1]),k.generateId(),this.$={...A[_-2],type:"composite",children:A[_-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",A[_-2],A[_-1],A[_]);const D=k.generateId();this.$={id:D,type:"composite",label:"",children:A[_-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",A[_]),this.$={id:A[_]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",A[_-1],A[_]),this.$={id:A[_-1],label:A[_].label,typeStr:A[_].typeStr,directions:A[_].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",A[_]),this.$=[A[_]];break;case 32:k.getLogger().debug("Rule: dirList: ",A[_-1],A[_]),this.$=[A[_-1]].concat(A[_]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",A[_-2],A[_-1],A[_]),this.$={typeStr:A[_-2]+A[_],label:A[_-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",A[_-3],A[_-2]," #3:",A[_-1],A[_]),this.$={typeStr:A[_-3]+A[_],label:A[_-2],directions:A[_-1]};break;case 35:case 36:this.$={type:"classDef",id:A[_-1].trim(),css:A[_].trim()};break;case 37:this.$={type:"applyClass",id:A[_-1].trim(),styleClass:A[_].trim()};break;case 38:this.$={type:"applyStyles",id:A[_-1].trim(),stylesStr:A[_].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:s,39:a,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:s,39:a,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:s},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:s,39:a,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:s,39:a,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:w(function(T,C){if(C.recoverable)this.trace(T);else{var S=new Error(T);throw S.hash=C,S}},"parseError"),parse:w(function(T){var C=this,S=[0],k=[],E=[null],A=[],R=this.table,_="",P=0,N=0,L=2,I=1,$=A.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(D.yy[F]=this.yy[F]);O.setInput(T,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var z=O.yylloc;A.push(z);var V=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(te){S.length=S.length-2*te,E.length=E.length-te,A.length=A.length-te}w(B,"popStack");function H(){var te;return te=k.pop()||O.lex()||I,typeof te!="number"&&(te instanceof Array&&(k=te,te=k.pop()),te=C.symbols_[te]||te),te}w(H,"lex");for(var G,W,K,q,oe={},Q,Z,re,ie;;){if(W=S[S.length-1],this.defaultActions[W]?K=this.defaultActions[W]:((G===null||typeof G>"u")&&(G=H()),K=R[W]&&R[W][G]),typeof K>"u"||!K.length||!K[0]){var me="";ie=[];for(Q in R[W])this.terminals_[Q]&&Q>L&&ie.push("'"+this.terminals_[Q]+"'");O.showPosition?me="Parse error on line "+(P+1)+`: + ${eyr(e,r)} + `},"styles"),nyr={parser:j1r,db:Lk,renderer:J1r,styles:ryr};const iyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:nyr},Symbol.toStringTag,{value:"Module"}));var Lj=(function(){var t=w(function(b,T,C,S){for(C=C||{},S=b.length;S--;C[b[S]]=T);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],s=[1,19],a=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:w(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:w(function(T,C,S,k,E,A,R){var _=A.length-1;switch(E){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",A[_-1]),k.setHierarchy(A[_-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",A[_]),typeof A[_].length=="number"?this.$=A[_]:this.$=[A[_]];break;case 13:k.getLogger().debug("Rule: statement #2: ",A[_-1]),this.$=[A[_-1]].concat(A[_]);break;case 14:k.getLogger().debug("Rule: link: ",A[_],T),this.$={edgeTypeStr:A[_],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",A[_-3],A[_-1],A[_]),this.$={edgeTypeStr:A[_],label:A[_-1]};break;case 18:const P=parseInt(A[_]),N=k.generateId();this.$={id:N,type:"space",label:"",width:P,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",A[_-2],A[_-1],A[_]," typestr: ",A[_-1].edgeTypeStr);const L=k.edgeStrToEdgeData(A[_-1].edgeTypeStr),I=k.edgeStrToEdgeStartData(A[_-1].edgeTypeStr),$=k.edgeStrToThickness(A[_-1].edgeTypeStr),O=k.edgeStrToPattern(A[_-1].edgeTypeStr);this.$=[{id:A[_-2].id,label:A[_-2].label,type:A[_-2].type,directions:A[_-2].directions},{id:A[_-2].id+"-"+A[_].id,start:A[_-2].id,end:A[_].id,label:A[_-1].label,type:"edge",thickness:$,pattern:O,directions:A[_].directions,arrowTypeEnd:L,arrowTypeStart:I},{id:A[_].id,label:A[_].label,type:k.typeStr2Type(A[_].typeStr),directions:A[_].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",A[_-1],A[_]),this.$={id:A[_-1].id,label:A[_-1].label,type:k.typeStr2Type(A[_-1].typeStr),directions:A[_-1].directions,widthInColumns:parseInt(A[_],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",A[_]),this.$={id:A[_].id,label:A[_].label,type:k.typeStr2Type(A[_].typeStr),directions:A[_].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",A[_]),this.$={type:"column-setting",columns:A[_]==="auto"?-1:parseInt(A[_])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",A[_-2],A[_-1]),k.generateId(),this.$={...A[_-2],type:"composite",children:A[_-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",A[_-2],A[_-1],A[_]);const D=k.generateId();this.$={id:D,type:"composite",label:"",children:A[_-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",A[_]),this.$={id:A[_]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",A[_-1],A[_]),this.$={id:A[_-1],label:A[_].label,typeStr:A[_].typeStr,directions:A[_].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",A[_]),this.$=[A[_]];break;case 32:k.getLogger().debug("Rule: dirList: ",A[_-1],A[_]),this.$=[A[_-1]].concat(A[_]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",A[_-2],A[_-1],A[_]),this.$={typeStr:A[_-2]+A[_],label:A[_-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",A[_-3],A[_-2]," #3:",A[_-1],A[_]),this.$={typeStr:A[_-3]+A[_],label:A[_-2],directions:A[_-1]};break;case 35:case 36:this.$={type:"classDef",id:A[_-1].trim(),css:A[_].trim()};break;case 37:this.$={type:"applyClass",id:A[_-1].trim(),styleClass:A[_].trim()};break;case 38:this.$={type:"applyStyles",id:A[_-1].trim(),stylesStr:A[_].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:s,39:a,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:s,39:a,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:s},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:s,39:a,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:s,39:a,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:w(function(T,C){if(C.recoverable)this.trace(T);else{var S=new Error(T);throw S.hash=C,S}},"parseError"),parse:w(function(T){var C=this,S=[0],k=[],E=[null],A=[],R=this.table,_="",P=0,N=0,L=2,I=1,$=A.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(D.yy[F]=this.yy[F]);O.setInput(T,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var z=O.yylloc;A.push(z);var V=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(te){S.length=S.length-2*te,E.length=E.length-te,A.length=A.length-te}w(B,"popStack");function H(){var te;return te=k.pop()||O.lex()||I,typeof te!="number"&&(te instanceof Array&&(k=te,te=k.pop()),te=C.symbols_[te]||te),te}w(H,"lex");for(var G,W,K,q,oe={},Q,Z,re,ie;;){if(W=S[S.length-1],this.defaultActions[W]?K=this.defaultActions[W]:((G===null||typeof G>"u")&&(G=H()),K=R[W]&&R[W][G]),typeof K>"u"||!K.length||!K[0]){var me="";ie=[];for(Q in R[W])this.terminals_[Q]&&Q>L&&ie.push("'"+this.terminals_[Q]+"'");O.showPosition?me="Parse error on line "+(P+1)+`: `+O.showPosition()+` Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error on line "+(P+1)+": Unexpected "+(G==I?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(me,{text:O.match,token:this.terminals_[G]||G,line:O.yylineno,loc:z,expected:ie})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+G);switch(K[0]){case 1:S.push(G),E.push(O.yytext),A.push(O.yylloc),S.push(K[1]),G=null,N=O.yyleng,_=O.yytext,P=O.yylineno,z=O.yylloc;break;case 2:if(Z=this.productions_[K[1]][1],oe.$=E[E.length-Z],oe._$={first_line:A[A.length-(Z||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Z||1)].first_column,last_column:A[A.length-1].last_column},V&&(oe._$.range=[A[A.length-(Z||1)].range[0],A[A.length-1].range[1]]),q=this.performAction.apply(oe,[_,N,P,D.yy,K[1],E,A].concat($)),typeof q<"u")return q;Z&&(S=S.slice(0,-1*Z*2),E=E.slice(0,-1*Z),A=A.slice(0,-1*Z)),S.push(this.productions_[K[1]][0]),E.push(oe.$),A.push(oe._$),re=R[S[S.length-2]][S[S.length-1]],S.push(re);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:w(function(C,S){if(this.yy.parser)this.yy.parser.parseError(C,S);else throw new Error(C)},"parseError"),setInput:w(function(T,C){return this.yy=C||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:w(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var C=T.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:w(function(T){var C=T.length,S=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===k.length?this.yylloc.first_column:0)+k[k.length-S.length].length-S[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more: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(T){this.unput(this.match.slice(T))},"less"),pastInput:w(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:w(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:w(function(){var T=this.pastInput(),C=new Array(T.length+1).join("-");return T+this.upcomingInput()+` `+C+"^"},"showPosition"),test_match:w(function(T,C){var S,k,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),k=T[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],S=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var A in E)this[A]=E[A];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,C,S,k;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),A=0;AC[0].length)){if(C=S,k=A,this.options.backtrack_lexer){if(T=this.test_match(S,E[A]),T!==!1)return T;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(T=this.test_match(C,E[k]),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:w(function(){var C=this.next();return C||this.lex()},"lex"),begin:w(function(C){this.conditionStack.push(C)},"begin"),popState:w(function(){var C=this.conditionStack.length-1;return C>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(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:w(function(C){this.begin(C)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(C,S,k,E){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",S.yytext);break;case 4:C.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",C.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function x(){this.yy={}}return w(x,"Parser"),x.prototype=y,y.Parser=x,new x})();Aj.parser=Aj;var G1r=Aj,Th=new Map,Bne=[],Mj=new Map,pye="color",gye="fill",W1r="bgFill",Jqe=",",WI=new Map,Fne="",q1r=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),U1r=w(function(t,e=""){let r=WI.get(t);r||(r={id:t,styles:[],textStyles:[]},WI.set(t,r)),e!=null&&e.split(Jqe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(pye).exec(n)){const a=i.replace(gye,W1r).replace(pye,gye);r.textStyles.push(a)}r.styles.push(i)})},"addStyleClass"),Y1r=w(function(t,e=""){const r=Th.get(t);e!=null&&(r.styles=e.split(Jqe))},"addStyle2Node"),j1r=w(function(t,e){t.split(",").forEach(function(r){let n=Th.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Th.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),eUe=w((t,e)=>{const r=t.flat(),n=[],i=r.find(a=>(a==null?void 0:a.type)==="column-setting"),s=(i==null?void 0:i.columns)??-1;for(const a of r){if(typeof s=="number"&&s>0&&a.type!=="column-setting"&&typeof a.widthInColumns=="number"&&a.widthInColumns>s&&de.warn(`Block ${a.id} width ${a.widthInColumns} exceeds configured column width ${s}`),a.label&&(a.label=q1r(a.label)),a.type==="classDef"){U1r(a.id,a.css);continue}if(a.type==="applyClass"){j1r(a.id,(a==null?void 0:a.styleClass)??"");continue}if(a.type==="applyStyles"){a!=null&&a.stylesStr&&Y1r(a.id,a==null?void 0:a.stylesStr);continue}if(a.type==="column-setting")e.columns=a.columns??-1;else if(a.type==="edge"){const o=(Mj.get(a.id)??0)+1;Mj.set(a.id,o),a.id=o+"-"+a.id,Bne.push(a)}else{a.label||(a.type==="composite"?a.label="":a.label=a.id);const o=Th.get(a.id);if(o===void 0?Th.set(a.id,a):(a.type!=="na"&&(o.type=a.type),a.label!==a.id&&(o.label=a.label)),a.children&&eUe(a.children,a),a.type==="space"){const l=a.width??1;for(let u=0;u{de.debug("Clear called"),Ri(),SS={id:"root",type:"composite",children:[],columns:-1},Th=new Map([["root",SS]]),zne=[],WI=new Map,Bne=[],Mj=new Map,Fne=""},"clear");function tUe(t){switch(de.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return de.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}w(tUe,"typeStr2Type");function rUe(t){switch(de.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(rUe,"edgeTypeStr2Type");function nUe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(nUe,"edgeStrToEdgeData");function iUe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}w(iUe,"edgeStrToEdgeStartData");function sUe(t){return t.includes("==")?"thick":"normal"}w(sUe,"edgeStrToThickness");function aUe(t){return t.includes(".-")?"dotted":"solid"}w(aUe,"edgeStrToPattern");var mye=0,K1r=w(()=>(mye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+mye),"generateId"),Z1r=w(t=>{SS.children=t,eUe(t,SS),zne=SS.children},"setHierarchy"),Q1r=w(t=>{const e=Th.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),J1r=w(()=>[...Th.values()],"getBlocksFlat"),eyr=w(()=>zne||[],"getBlocks"),tyr=w(()=>Bne,"getEdges"),ryr=w(t=>Th.get(t),"getBlock"),nyr=w(t=>{Th.set(t.id,t)},"setBlock"),iyr=w(t=>{Fne=t},"setDiagramId"),syr=w(()=>Fne,"getDiagramId"),ayr=w(()=>de,"getLogger"),oyr=w(function(){return WI},"getClasses"),lyr={getConfig:w(()=>vr().block,"getConfig"),typeStr2Type:tUe,edgeTypeStr2Type:rUe,edgeStrToEdgeData:nUe,edgeStrToEdgeStartData:iUe,edgeStrToThickness:sUe,edgeStrToPattern:aUe,getLogger:ayr,getBlocksFlat:J1r,getBlocks:eyr,getEdges:tyr,setHierarchy:Z1r,getBlock:ryr,setBlock:nyr,getColumns:Q1r,getClasses:oyr,clear:X1r,generateId:K1r,setDiagramId:iyr,getDiagramId:syr},cyr=lyr,TV=w((t,e)=>{const r=yK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return dh(n,i,s,e)},"fade"),uyr=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var C=this.next();return C||this.lex()},"lex"),begin:w(function(C){this.conditionStack.push(C)},"begin"),popState:w(function(){var C=this.conditionStack.length-1;return C>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(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:w(function(C){this.begin(C)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(C,S,k,E){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",S.yytext);break;case 4:C.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",C.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function x(){this.yy={}}return w(x,"Parser"),x.prototype=y,y.Parser=x,new x})();Lj.parser=Lj;var syr=Lj,Sh=new Map,Hne=[],Ij=new Map,xye="color",wye="fill",ayr="bgFill",sUe=",",YI=new Map,Gne="",oyr=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),lyr=w(function(t,e=""){let r=YI.get(t);r||(r={id:t,styles:[],textStyles:[]},YI.set(t,r)),e!=null&&e.split(sUe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(xye).exec(n)){const a=i.replace(wye,ayr).replace(xye,wye);r.textStyles.push(a)}r.styles.push(i)})},"addStyleClass"),cyr=w(function(t,e=""){const r=Sh.get(t);e!=null&&(r.styles=e.split(sUe))},"addStyle2Node"),uyr=w(function(t,e){t.split(",").forEach(function(r){let n=Sh.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Sh.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),aUe=w((t,e)=>{const r=t.flat(),n=[],i=r.find(a=>(a==null?void 0:a.type)==="column-setting"),s=(i==null?void 0:i.columns)??-1;for(const a of r){if(typeof s=="number"&&s>0&&a.type!=="column-setting"&&typeof a.widthInColumns=="number"&&a.widthInColumns>s&&de.warn(`Block ${a.id} width ${a.widthInColumns} exceeds configured column width ${s}`),a.label&&(a.label=oyr(a.label)),a.type==="classDef"){lyr(a.id,a.css);continue}if(a.type==="applyClass"){uyr(a.id,(a==null?void 0:a.styleClass)??"");continue}if(a.type==="applyStyles"){a!=null&&a.stylesStr&&cyr(a.id,a==null?void 0:a.stylesStr);continue}if(a.type==="column-setting")e.columns=a.columns??-1;else if(a.type==="edge"){const o=(Ij.get(a.id)??0)+1;Ij.set(a.id,o),a.id=o+"-"+a.id,Hne.push(a)}else{a.label||(a.type==="composite"?a.label="":a.label=a.id);const o=Sh.get(a.id);if(o===void 0?Sh.set(a.id,a):(a.type!=="na"&&(o.type=a.type),a.label!==a.id&&(o.label=a.label)),a.children&&aUe(a.children,a),a.type==="space"){const l=a.width??1;for(let u=0;u{de.debug("Clear called"),Ri(),MS={id:"root",type:"composite",children:[],columns:-1},Sh=new Map([["root",MS]]),Wne=[],YI=new Map,Hne=[],Ij=new Map,Gne=""},"clear");function oUe(t){switch(de.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return de.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}w(oUe,"typeStr2Type");function lUe(t){switch(de.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(lUe,"edgeTypeStr2Type");function cUe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(cUe,"edgeStrToEdgeData");function uUe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}w(uUe,"edgeStrToEdgeStartData");function hUe(t){return t.includes("==")?"thick":"normal"}w(hUe,"edgeStrToThickness");function dUe(t){return t.includes(".-")?"dotted":"solid"}w(dUe,"edgeStrToPattern");var Tye=0,dyr=w(()=>(Tye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Tye),"generateId"),fyr=w(t=>{MS.children=t,aUe(t,MS),Wne=MS.children},"setHierarchy"),pyr=w(t=>{const e=Sh.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),gyr=w(()=>[...Sh.values()],"getBlocksFlat"),myr=w(()=>Wne||[],"getBlocks"),yyr=w(()=>Hne,"getEdges"),vyr=w(t=>Sh.get(t),"getBlock"),byr=w(t=>{Sh.set(t.id,t)},"setBlock"),xyr=w(t=>{Gne=t},"setDiagramId"),wyr=w(()=>Gne,"getDiagramId"),Tyr=w(()=>de,"getLogger"),Cyr=w(function(){return YI},"getClasses"),kyr={getConfig:w(()=>br().block,"getConfig"),typeStr2Type:oUe,edgeTypeStr2Type:lUe,edgeStrToEdgeData:cUe,edgeStrToEdgeStartData:uUe,edgeStrToThickness:hUe,edgeStrToPattern:dUe,getLogger:Tyr,getBlocksFlat:gyr,getBlocks:myr,getEdges:yyr,setHierarchy:fyr,getBlock:vyr,setBlock:byr,getColumns:pyr,getClasses:Cyr,clear:hyr,generateId:dyr,setDiagramId:xyr,getDiagramId:wyr},Syr=kyr,EV=w((t,e)=>{const r=wK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),Eyr=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -5340,9 +5347,9 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error } .node .cluster { - // fill: ${TV(t.mainBkg,.5)}; - fill: ${TV(t.clusterBkg,.5)}; - stroke: ${TV(t.clusterBorder,.2)}; + // fill: ${EV(t.mainBkg,.5)}; + fill: ${EV(t.clusterBkg,.5)}; + stroke: ${EV(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } @@ -5377,14 +5384,14 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error font-size: 18px; fill: ${t.textColor}; } - ${S7()} -`,"getStyles"),hyr=uyr,dyr=w((t,e,r,n)=>{e.forEach(i=>{Tyr[i](t,r,n)})},"insertMarkers"),fyr=w((t,e,r)=>{de.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),pyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),gyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),myr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),yyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),vyr=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),byr=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),xyr=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),wyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Tyr={extension:fyr,composition:pyr,aggregation:gyr,dependency:myr,lollipop:yyr,point:vyr,circle:byr,cross:xyr,barb:wyr},Cyr=dyr;function Rj(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}w(Rj,"calculateBlockPosition");var kyr=w(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:s,x:a,y:o}=n.size??{width:0,height:0,x:0,y:0};if(de.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",s,"x:",a,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),s>r&&(r=s)}return{width:e,height:r}},"getMaxChildSize");function qI(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;de.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let s=0,a=0;if(((u=t.children)==null?void 0:u.length)>0){for(const A of t.children)qI(A,e,0,0,i);const x=kyr(t);s=x.width,a=x.height,de.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",s,a);for(const A of t.children)A.size&&(de.debug(`abc95 Setting size of children of ${t.id} id=${A.id} ${s} ${a} ${JSON.stringify(A.size)}`),A.size.width=s*(A.widthInColumns??1)+i*((A.widthInColumns??1)-1),A.size.height=a,A.size.x=0,A.size.y=0,de.debug(`abc95 updating size of ${t.id} children child:${A.id} maxWidth:${s} maxHeight:${a}`));for(const A of t.children)qI(A,e,s,a,i);const b=t.columns??-1;let T=0;for(const A of t.children)T+=A.widthInColumns??1;let C=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(A>0){const R=(k-A*i-i)/A;de.debug("abc95 (growing to fit) width",t.id,k,(p=t.size)==null?void 0:p.width,R);for(const _ of t.children)_.size&&(_.size.width=R)}}t.size={width:k,height:E,x:0,y:0}}de.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}w(qI,"setBlockSizes");function Vne(t,e,r=8){var i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T;de.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(s=t==null?void 0:t.size)==null?void 0:s.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const n=t.columns??-1;if(de.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*C+(t.children.length-1)*r;de.debug("widthOfChildren 88",S,"posX");const k=new Map;{let P=0;for(const N of t.children){if(!N.size)continue;const{py:L}=Rj(n,P),I=k.get(L)??0;N.size.height>I&&k.set(L,N.size.height);let $=(N==null?void 0:N.widthInColumns)??1;n>0&&($=Math.min($,n-P%n)),P+=$}}const E=new Map;{let P=0;const N=[...k.keys()].sort((L,I)=>L-I);for(const L of N)E.set(L,P),P+=(k.get(L)??0)+r}let A=0;de.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let R=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,_=0;for(const P of t.children){const N=t;if(!P.size)continue;const{width:L,height:I}=P.size,{px:$,py:O}=Rj(n,A);if(O!=_&&(_=O,R=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,de.debug("New row in layout for block",t.id," and child ",P.id,_)),de.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${A} (px, py) ${$},${O} (${(y=N==null?void 0:N.size)==null?void 0:y.x},${(v=N==null?void 0:N.size)==null?void 0:v.y}) parent: ${N.id} width: ${L}${r}`),N.size){const F=L/2;P.size.x=R+r+F,de.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${R} new startingPosX${P.size.x} ${F} padding=${r} width=${L} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${L*((P==null?void 0:P.widthInColumns)??1)/2}`),R=P.size.x+F;const z=E.get(O)??0,V=k.get(O)??I;P.size.y=N.size.y-N.size.height/2+z+V/2+r,de.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${R}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${L*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&Vne(P,e,r);let D=(P==null?void 0:P.widthInColumns)??1;n>0&&(D=Math.min(D,n-A%n)),A+=D,de.debug("abc88 columnsPos",P,A)}}de.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(x=t==null?void 0:t.size)==null?void 0:x.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(T=t==null?void 0:t.size)==null?void 0:T.width}`)}w(Vne,"layoutBlocks");function Hne(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:s,y:a,width:o,height:l}=t.size;s-o/2n&&(n=s+o/2),a+l/2>i&&(i=a+l/2)}if(t.children)for(const s of t.children)({minX:e,minY:r,maxX:n,maxY:i}=Hne(s,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(Hne,"findBounds");function oUe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Ve())==null?void 0:u.block)==null?void 0:h.padding)??8;qI(e,t,0,0,r),Vne(e,t,r),de.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:s,maxY:a}=Hne(e),o=a-i,l=s-n;return{x:n,y:i,width:l,height:o}}w(oUe,"layout");var Syr=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=ui(a);return await Zo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),oh=Syr,Eyr=w((t,e,r,n,i)=>{e.arrowTypeStart&&yye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&yye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Ayr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},yye=w((t,e,r,n,i,s)=>{const a=Ayr[r];if(!a){de.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${s}-${a}${o})`)},"addEdgeMarker"),_j={},Po={},Myr=w(async(t,e)=>{const r=Ve(),n=ui(r),i=t.insert("g").attr("class","edgeLabel"),s=i.insert("g").attr("class","label"),a=e.labelType==="markdown",o=await Zo(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:a,isNode:!1,markdown:a,width:a?void 0:Number.POSITIVE_INFINITY},r);s.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=wt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=wt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}s.attr("transform",cd(u,n)),_j[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await oh(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",cd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].startLeft=d,Rk(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await oh(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",cd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].startRight=d,Rk(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await oh(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",cd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].endLeft=d,Rk(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await oh(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",cd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].endRight=d,Rk(h,e.endLabelRight)}return o},"insertEdgeLabel");function Rk(t,e){ui(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(Rk,"setTerminalWidth");var Ryr=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,_j[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=s3(n);if(t.label){const s=_j[t.id];let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const s=Po[t.id].startLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Po[t.id].startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Po[t.id].endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Po[t.id].endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),_yr=w((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),a=t.width/2,o=t.height/2;return i>=a||s>=o},"outsideNode"),Lyr=w((t,e,r)=>{de.debug(`intersection calc abc89: + ${M7()} +`,"getStyles"),Ayr=Eyr,Myr=w((t,e,r,n)=>{e.forEach(i=>{Byr[i](t,r,n)})},"insertMarkers"),Ryr=w((t,e,r)=>{de.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),_yr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Lyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Iyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Nyr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Dyr=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Oyr=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Pyr=w((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),$yr=w((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Byr={extension:Ryr,composition:_yr,aggregation:Lyr,dependency:Iyr,lollipop:Nyr,point:Dyr,circle:Oyr,cross:Pyr,barb:$yr},Fyr=Myr;function Nj(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}w(Nj,"calculateBlockPosition");var zyr=w(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:s,x:a,y:o}=n.size??{width:0,height:0,x:0,y:0};if(de.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",s,"x:",a,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),s>r&&(r=s)}return{width:e,height:r}},"getMaxChildSize");function jI(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;de.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let s=0,a=0;if(((u=t.children)==null?void 0:u.length)>0){for(const A of t.children)jI(A,e,0,0,i);const x=zyr(t);s=x.width,a=x.height,de.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",s,a);for(const A of t.children)A.size&&(de.debug(`abc95 Setting size of children of ${t.id} id=${A.id} ${s} ${a} ${JSON.stringify(A.size)}`),A.size.width=s*(A.widthInColumns??1)+i*((A.widthInColumns??1)-1),A.size.height=a,A.size.x=0,A.size.y=0,de.debug(`abc95 updating size of ${t.id} children child:${A.id} maxWidth:${s} maxHeight:${a}`));for(const A of t.children)jI(A,e,s,a,i);const b=t.columns??-1;let T=0;for(const A of t.children)T+=A.widthInColumns??1;let C=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(A>0){const R=(k-A*i-i)/A;de.debug("abc95 (growing to fit) width",t.id,k,(p=t.size)==null?void 0:p.width,R);for(const _ of t.children)_.size&&(_.size.width=R)}}t.size={width:k,height:E,x:0,y:0}}de.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}w(jI,"setBlockSizes");function qne(t,e,r=8){var i,s,a,o,l,u,h,d,f,p,g,m,y,v,x,b,T;de.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(s=t==null?void 0:t.size)==null?void 0:s.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const n=t.columns??-1;if(de.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*C+(t.children.length-1)*r;de.debug("widthOfChildren 88",S,"posX");const k=new Map;{let P=0;for(const N of t.children){if(!N.size)continue;const{py:L}=Nj(n,P),I=k.get(L)??0;N.size.height>I&&k.set(L,N.size.height);let $=(N==null?void 0:N.widthInColumns)??1;n>0&&($=Math.min($,n-P%n)),P+=$}}const E=new Map;{let P=0;const N=[...k.keys()].sort((L,I)=>L-I);for(const L of N)E.set(L,P),P+=(k.get(L)??0)+r}let A=0;de.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let R=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,_=0;for(const P of t.children){const N=t;if(!P.size)continue;const{width:L,height:I}=P.size,{px:$,py:O}=Nj(n,A);if(O!=_&&(_=O,R=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,de.debug("New row in layout for block",t.id," and child ",P.id,_)),de.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${A} (px, py) ${$},${O} (${(y=N==null?void 0:N.size)==null?void 0:y.x},${(v=N==null?void 0:N.size)==null?void 0:v.y}) parent: ${N.id} width: ${L}${r}`),N.size){const F=L/2;P.size.x=R+r+F,de.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${R} new startingPosX${P.size.x} ${F} padding=${r} width=${L} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${L*((P==null?void 0:P.widthInColumns)??1)/2}`),R=P.size.x+F;const z=E.get(O)??0,V=k.get(O)??I;P.size.y=N.size.y-N.size.height/2+z+V/2+r,de.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${R}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${L*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&qne(P,e,r);let D=(P==null?void 0:P.widthInColumns)??1;n>0&&(D=Math.min(D,n-A%n)),A+=D,de.debug("abc88 columnsPos",P,A)}}de.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(x=t==null?void 0:t.size)==null?void 0:x.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(T=t==null?void 0:t.size)==null?void 0:T.width}`)}w(qne,"layoutBlocks");function Une(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:s,y:a,width:o,height:l}=t.size;s-o/2n&&(n=s+o/2),a+l/2>i&&(i=a+l/2)}if(t.children)for(const s of t.children)({minX:e,minY:r,maxX:n,maxY:i}=Une(s,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(Une,"findBounds");function fUe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Ve())==null?void 0:u.block)==null?void 0:h.padding)??8;jI(e,t,0,0,r),qne(e,t,r),de.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:s,maxY:a}=Une(e),o=a-i,l=s-n;return{x:n,y:i,width:l,height:o}}w(fUe,"layout");var Vyr=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=hi(a);return await Zo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),uh=Vyr,Hyr=w((t,e,r,n,i)=>{e.arrowTypeStart&&Cye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Cye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Gyr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Cye=w((t,e,r,n,i,s)=>{const a=Gyr[r];if(!a){de.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${s}-${a}${o})`)},"addEdgeMarker"),Dj={},Po={},Wyr=w(async(t,e)=>{const r=Ve(),n=hi(r),i=t.insert("g").attr("class","edgeLabel"),s=i.insert("g").attr("class","label"),a=e.labelType==="markdown",o=await Zo(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:a,isNode:!1,markdown:a,width:a?void 0:Number.POSITIVE_INFINITY},r);s.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=wt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=wt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}s.attr("transform",dd(u,n)),Dj[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await uh(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",dd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].startLeft=d,Ik(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await uh(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",dd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].startRight=d,Ik(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await uh(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",dd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].endLeft=d,Ik(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await uh(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=wt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",dd(g,n)),Po[e.id]||(Po[e.id]={}),Po[e.id].endRight=d,Ik(h,e.endLabelRight)}return o},"insertEdgeLabel");function Ik(t,e){hi(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(Ik,"setTerminalWidth");var qyr=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,Dj[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=l3(n);if(t.label){const s=Dj[t.id];let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const s=Po[t.id].startLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Po[t.id].startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Po[t.id].endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Po[t.id].endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),Uyr=w((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),a=t.width/2,o=t.height/2;return i>=a||s>=o},"outsideNode"),Yyr=w((t,e,r)=>{de.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,s=Math.abs(n-r.x),a=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{de.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(!_yr(e,s)&&!i){const a=Lyr(e,n,s);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)||r.push(a),i=!0}else n=s,i||r.push(s)}),r},"cutPathAtIntersect"),Iyr=w(function(t,e,r,n,i,s,a){let o=r.points;de.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=s.node(e.v);var h=s.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(de.debug("to cluster abc88",n[r.toCluster]),o=vye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(de.debug("from cluster abc88",n[r.fromCluster]),o=vye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=m6;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=USe(r),m=g6().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";(Ve().flowchart.arrowMarkerAbsolute||Ve().state.arrowMarkerAbsolute)&&(x=$N(!0)),Eyr(v,r,x,a,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Nyr=w(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),Dyr=w((t,e,r,n)=>{const i=Nyr(t),s=2,a=e.height+2*r.padding,o=a/s,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-a/3},{x:l+2*u,y:-a/2},{x:l,y:-2*a/3},{x:l,y:-a},{x:l-o,y:-a},{x:l/2,y:-a-2*u},{x:o,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*u,y:-a/2},{x:0,y:-a/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-a},{x:l-o,y:-a},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-a+o},{x:0,y:-a}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-a+o},{x:l,y:-a}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a},{x:0,y:-a/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-a}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-a}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-a}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-a}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a},{x:0,y:-a/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function lUe(t,e){return t.intersect(e)}w(lUe,"intersectNode");var Oyr=lUe;function cUe(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(Lj,"sameSign");var $yr=dUe,Byr=fUe;function fUe(t,e,r){var n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){a=Math.min(a,g.x),o=Math.min(o,g.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-a,u=i-t.height/2-o,h=0;h1&&s.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,x=Math.sqrt(y*y+v*v),b=m.x-r.x,T=m.y-r.y,C=Math.sqrt(b*b+T*T);return x{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),zyr=Fyr,ps={node:Oyr,circle:Pyr,ellipse:uUe,polygon:Byr,rect:zyr},so=w(async(t,e,r,n)=>{const i=Ve();let s;const a=e.useHtmlLabels||ui(i);r?s=r:s="node default";const o=t.insert("g").attr("class",s).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Zo(l,Ln(h0(u),i),{useHtmlLabels:a,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await oh(l,Ln(h0(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(ui(i)){const p=h.children[0],g=wt(h);await lZ(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return a?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Vs=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Oh(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}w(Oh,"insertPolygonShape");var Vyr=w(async(t,e)=>{e.useHtmlLabels||ui(Ve())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:s}=await so(t,e,"node "+e.classes,!0);de.info("Classes = ",e.classes);const a=n.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-s).attr("y",-i.height/2-s).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Vs(e,a),e.intersect=function(o){return ps.rect(e,o)},n},"note"),Hyr=Vyr,bye=w(t=>t?" "+t:"","formatClass"),Zc=w((t,e)=>`${e||"node default"}${bye(t.classes)} ${bye(t.class)}`,"getClassesFromNode"),xye=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=i+s,o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];de.info("Question main (Circle)");const l=Oh(r,a,a,o);return l.attr("style",e.style),Vs(e,l),e.intersect=function(u){return de.warn("Intersect called"),ps.polygon(e,o,u)},r},"question"),Gyr=w((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(a){return ps.circle(e,14,a)},r},"choice"),Wyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=4,s=e.positioned?e.height:n.height+e.padding,a=s/i,o=e.positioned?e.width:n.width+2*a+e.padding,l=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-s/2},{x:o-a,y:-s},{x:a,y:-s},{x:0,y:-s/2}],u=Oh(r,o,s,l);return u.attr("style",e.style),Vs(e,u),e.intersect=function(h){return ps.polygon(e,l,h)},r},"hexagon"),qyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,void 0,!0),i=2,s=n.height+2*e.padding,a=s/i,o=n.width+2*a+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=Dyr(e.directions,n,e,u),d=Oh(r,u,s,h);return d.attr("style",e.style),Vs(e,d),e.intersect=function(f){return ps.polygon(e,h,f)},r},"block_arrow"),Uyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-s/2,y:0},{x:i,y:0},{x:i,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return Oh(r,i,s,a).attr("style",e.style),e.width=i+s,e.height=s,e.intersect=function(l){return ps.polygon(e,a,l)},r},"rect_left_inv_arrow"),Yyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-2*s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:s/6,y:-s}],o=Oh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"lean_right"),jyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:2*s/6,y:0},{x:i+s/6,y:0},{x:i-2*s/6,y:-s},{x:-s/6,y:-s}],o=Oh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"lean_left"),Xyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-2*s/6,y:0},{x:i+2*s/6,y:0},{x:i-s/6,y:-s},{x:s/6,y:-s}],o=Oh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"trapezoid"),Kyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:-2*s/6,y:-s}],o=Oh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"inv_trapezoid"),Zyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:0,y:0},{x:i+s/2,y:0},{x:i,y:-s/2},{x:i+s/2,y:-s},{x:0,y:-s}],o=Oh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"rect_right_inv_arrow"),Qyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=i/2,a=s/(2.5+i/50),o=n.height+a+e.padding,l="M 0,"+a+" a "+s+","+a+" 0,0,0 "+i+" 0 a "+s+","+a+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+s+","+a+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",a).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+a)+")");return Vs(e,u),e.intersect=function(h){const d=ps.rect(e,h),f=d.x-e.x;if(s!=0&&(Math.abs(f)e.height/2-a)){let p=a*a*(1-f*f/(s*s));p!=0&&(p=Math.sqrt(p)),p=a-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),Jyr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,"node "+e.classes+" "+e.class,!0),s=r.insert("rect",":first-child"),a=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-a/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",a).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(NP(s,e.props.borders,a,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return Vs(e,s),e.intersect=function(h){return ps.rect(e,h)},r},"rect"),evr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,"node "+e.classes,!0),s=r.insert("rect",":first-child"),a=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-a/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(s.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",a).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(NP(s,e.props.borders,a,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return Vs(e,s),e.intersect=function(h){return ps.rect(e,h)},r},"composite"),tvr=w(async(t,e)=>{const{shapeSvg:r}=await so(t,e,"label",!0);de.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,s=0;if(n.attr("width",i).attr("height",s),r.attr("class","label edgeLabel"),e.props){const a=new Set(Object.keys(e.props));e.props.borders&&(NP(n,e.props.borders,i,s),a.delete("borders")),a.forEach(o=>{de.warn(`Unknown node property ${o}`)})}return Vs(e,n),e.intersect=function(a){return ps.rect(e,a)},r},"labelRect");function NP(t,e,r,n){const i=[],s=w(o=>{i.push(o,0)},"addBorder"),a=w(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(de.debug("add top border"),s(r)):a(r),e.includes("r")?(de.debug("add right border"),s(n)):a(n),e.includes("b")?(de.debug("add bottom border"),s(r)):a(r),e.includes("l")?(de.debug("add left border"),s(n)):a(n),t.attr("stroke-dasharray",i.join(" "))}w(NP,"applyNodePropertyBorders");var rvr=w(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),s=n.insert("line"),a=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,de.info("Label text abc79",l,o,typeof o=="object");const u=await oh(a,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(ui(Ve())){const m=u.children[0],y=wt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}de.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await oh(a,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(ui(Ve())){const m=p.children[0],y=wt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return wt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),wt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.height+e.padding,s=n.width+i/4+e.padding,a=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-s/2).attr("y",-i/2).attr("width",s).attr("height",i);return Vs(e,a),e.intersect=function(o){return ps.rect(e,o)},r},"stadium"),ivr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,Zc(e,void 0),!0),s=r.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),de.info("Circle main"),Vs(e,s),e.intersect=function(a){return de.info("Circle intersect",e,n.width/2+i,a),ps.circle(e,n.width/2+i,a)},r},"circle"),svr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,Zc(e,void 0),!0),s=5,a=r.insert("g",":first-child"),o=a.insert("circle"),l=a.insert("circle");return a.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+s).attr("width",n.width+e.padding+s*2).attr("height",n.height+e.padding+s*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),de.info("DoubleCircle main"),Vs(e,o),e.intersect=function(u){return de.info("DoubleCircle intersect",e,n.width/2+i+s,u),ps.circle(e,n.width/2+i+s,u)},r},"doublecircle"),avr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,Zc(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:0,y:0},{x:i,y:0},{x:i,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],o=Oh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"subroutine"),ovr=w((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Vs(e,n),e.intersect=function(i){return ps.circle(e,7,i)},r},"start"),wye=w((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,s=10;r==="LR"&&(i=10,s=70);const a=n.append("rect").attr("x",-1*i/2).attr("y",-1*s/2).attr("width",i).attr("height",s).attr("class","fork-join");return Vs(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ps.rect(e,o)},n},"forkJoin"),lvr=w((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Vs(e,i),e.intersect=function(s){return ps.circle(e,7,s)},r},"end"),cvr=w(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let s;e.classes?s="node "+e.classes:s="node default";const a=t.insert("g").attr("class",s).attr("id",e.domId||e.id),o=a.insert("rect",":first-child"),l=a.insert("line"),u=a.insert("line");let h=0,d=n;const f=a.insert("g").attr("class","label");let p=0;const g=(E=e.classData.annotations)==null?void 0:E[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await oh(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(ui(Ve())){const A=y.children[0],R=wt(y);v=A.getBoundingClientRect(),R.attr("width",v.width),R.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(ui(Ve())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await oh(f,x,e.labelStyle,!0,!0);wt(b).attr("class","classTitle");let T=b.getBBox();if(ui(Ve())){const A=b.children[0],R=wt(b);T=A.getBoundingClientRect(),R.attr("width",T.width),R.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const C=[];e.classData.members.forEach(async A=>{const R=A.getDisplayDetails();let _=R.displayText;ui(Ve())&&(_=_.replace(//g,">"));const P=await oh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(ui(Ve())){const L=P.children[0],I=wt(P);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,C.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async A=>{const R=A.getDisplayDetails();let _=R.displayText;ui(Ve())&&(_=_.replace(//g,">"));const P=await oh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(ui(Ve())){const L=P.children[0],I=wt(P);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,S.push(P)}),d+=i,g){let A=(h-v.width)/2;wt(y).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=v.height+n}let k=(h-T.width)/2;return wt(b).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*d/2+p)+")"),p+=T.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(A=>{wt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(A=>{wt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Vs(e,o),e.intersect=function(A){return ps.rect(e,A)},a},"class_box"),Tye={rhombus:xye,composite:evr,question:xye,rect:Jyr,labelRect:tvr,rectWithTitle:rvr,choice:Gyr,circle:ivr,doublecircle:svr,stadium:nvr,hexagon:Wyr,block_arrow:qyr,rect_left_inv_arrow:Uyr,lean_right:Yyr,lean_left:jyr,trapezoid:Xyr,inv_trapezoid:Kyr,rect_right_inv_arrow:Zyr,cylinder:Qyr,start:ovr,end:lvr,note:Hyr,subroutine:avr,fork:wye,join:wye,class_box:cvr},HR={},pUe=w(async(t,e,r)=>{let n,i;if(e.link){let s;Ve().securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),i=await Tye[e.shape](n,e,r)}else i=await Tye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),HR[e.id]=n,e.haveCallback&&HR[e.id].attr("class",HR[e.id].attr("class")+" clickable"),n},"insertNode"),uvr=w(t=>{const e=HR[t.id];de.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function Gne(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let s=0,a="",o;switch(n.type){case"round":s=5,a="rect";break;case"composite":s=0,a="composite",o=0;break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"block_arrow":a="block_arrow";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"rect_left_inv_arrow":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}const l=aZ((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:a,labelText:u,rx:s,ry:s,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=vr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}w(Gne,"getNodeFromBlock");async function gUe(t,e,r){const n=Gne(e,r,!1);if(n.type==="group")return;const i=vr(),s=await pUe(t,n,{config:i}),a=s.node().getBBox(),o=r.getBlock(n.id);o.size={width:a.width,height:a.height,x:0,y:0,node:s},r.setBlock(o),s.remove()}w(gUe,"calculateBlockSize");async function mUe(t,e,r){const n=Gne(e,r,!0);if(r.getBlock(n.id).type!=="space"){const s=vr();await pUe(t,n,{config:s}),e.intersect=n==null?void 0:n.intersect,uvr(n)}}w(mUe,"insertBlockPositioned");async function DP(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await DP(t,i.children,r,n)}w(DP,"performOperations");async function yUe(t,e,r){await DP(t,e,r,gUe)}w(yUe,"calculateBlockSizes");async function vUe(t,e,r){await DP(t,e,r,mUe)}w(vUe,"insertBlocks");async function bUe(t,e,r,n,i){const s=new qo({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of r)a.size&&s.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(const a of e)if(a.start&&a.end){const o=n.getBlock(a.start),l=n.getBlock(a.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${a.id}`:a.id,p=a.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=a.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;Iyr(t,{v:a.start,w:a.end,name:f},{...a,id:f,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m},void 0,"block",s,i),a.label&&(await Myr(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m}),Ryr({...a,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(bUe,"insertEdges");var hvr=w(function(t,e){return e.db.getClasses()},"getClasses"),dvr=w(async function(t,e,r,n){const{securityLevel:i,block:s}=vr(),a=n.db;a.setDiagramId(e);let o;i==="sandbox"&&(o=wt("#i"+e));const l=wt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):wt(`[id="${e}"]`);Cyr(u,["point","circle","cross"],n.type,e);const d=a.getBlocks(),f=a.getBlocksFlat(),p=a.getEdges(),g=u.insert("g").attr("class","block");await yUe(g,d,a);const m=oUe(a);if(await vUe(g,d,a),await bUe(g,p,f,a,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:T}=s;Fs(u,x,b,!!T),de.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),fvr={draw:dvr,getClasses:hvr},pvr={parser:G1r,db:cyr,renderer:fvr,styles:hyr};const gvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:pvr},Symbol.toStringTag,{value:"Module"}));var xUe=/[─━│┃└┗├┣]/,wUe=/[└┗├┣]/,mvr=/[─━]/,Cye=/^[\s│┃]+$/,kye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Sye=/^\s*%%/,yvr=" ";function TUe(t){return t.some(e=>xUe.test(e))}w(TUe,"isBoxDrawingFormat");function CUe(t){for(const e of t){const r=wUe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(CUe,"inferSegmentWidth");function kUe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),s=e.get(i);return s?`line ${s}`:r})}w(kUe,"remapErrorLines");function SUe(t){const e=t.split(` -`),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),vvr=w(()=>{sd.reset(),Ri()},"clear"),bvr=w(()=>sd.records.stack[0],"getRoot"),xvr=w(()=>sd.records.cnt,"getCount"),wvr=Sn.treeView,Tvr=w(()=>es(wvr,vr().treeView),"getConfig"),Cvr=w((t,e,r,n,i,s)=>{for(;t<=sd.records.stack[sd.records.stack.length-1].level;)sd.records.stack.pop();const a={id:sd.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:s,children:[]};sd.records.stack[sd.records.stack.length-1].children.push(a),sd.records.stack.push(a)},"addNode"),kvr={clear:vvr,addNode:Cvr,getRoot:bvr,getCount:xvr,getConfig:Tvr,getAccTitle:ts,getAccDescription:ns,getDiagramTitle:qi,setAccDescription:rs,setAccTitle:Hi,setDiagramTitle:Ji},Ij=kvr,Svr=w(t=>{Fl(t,Ij);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const s=i?"directory":"file",a=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Ln(u,vr()):void 0;Ij.addNode(r,n,s,a,l,h)}},"populate"),Evr={parse:w(async t=>{const{text:e,lineMap:r}=SUe(t);try{const n=await $u("treeView",e);de.debug(n),Svr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=kUe(n.message,r)),n}},"parse")},xE={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function EUe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const s=t.substring(n).toLowerCase(),a=e==null?void 0:e.extensionIcons;return(a==null?void 0:a[s])??(a==null?void 0:a[s.slice(1)])}}w(EUe,"detectIcon");function Nj(t,e){return t.includes(":")?t:t in xE.icons||!e?`${xE.prefix}:${t}`:`${e}:${t}`}w(Nj,"qualifyIcon");function Wne(t,e){if(t.icon!=="none"){if(t.icon)return Nj(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=EUe(t.name,e);if(r==="none")return;if(r)return Nj(r,e.defaultIconPack)}return`${xE.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(Wne,"getNodeIcon");cZ([{name:xE.prefix,icons:xE}]);var Dj=14,Avr=4,Mvr=16,AUe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),Rvr=w(async(t,e,r,n)=>{const i=new Set,s=w(l=>{const u=Wne(l,r);u&&i.add(u),l.children.forEach(s)},"collect");if(s(e),i.size===0)return;const a=await Promise.all([...i].map(async l=>({icon:l,svg:await d0(l,{height:Dj,width:Dj})}))),o=t.append("defs");for(const{icon:l,svg:u}of a)o.append("g").attr("id",AUe(n,l)).html(u)},"injectIconDefs"),_vr=w((t,e,r,n,i,s)=>{var x;const a=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=Dj+Avr,u=Wne(r,i),h=u!==void 0;u&&a.append("use").attr("xlink:href",`#${AUe(s,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=a.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(x=r.cssClass)!=null&&x.split(/\s+/).includes("highlight")&&a.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:a,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),Eye=w((t,e,r,n,i,s)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",s).attr("class","treeView-node-line"),"positionLine"),Lvr=w((t,e,r,n)=>{var h;let i=0,s=0;const a=[],o=w((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=_vr(m,i,f,d,p,n);a.push(y);const{height:v,width:x}=f.BBox;Eye(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),s=Math.max(s,m+x),i+=v},"drawNode"),l=w((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;Eye(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=a.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...a.map(p=>p.labelRightEdge))+Mvr;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();s=Math.max(s,f+m.width+r.paddingX)}}for(const d of a)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=s-d.node.BBox.x+8;f.attr("width",p),s=Math.max(s,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:s}},"drawTree"),Ivr=w(async(t,e,r,n)=>{de.debug(`Rendering treeView diagram -`+t);const i=n.db,s=i.getRoot(),a=i.getConfig(),o=Xo(e);await Rvr(o,s,a,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=Lvr(l,s,a,e);o.attr("viewBox",`-${a.lineThickness/2} 0 ${h} ${u}`),Fs(o,u,h,a.useMaxWidth)},"draw"),Nvr={draw:Ivr},Dvr=Nvr,Ovr={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Pvr=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:s,highlightBg:a,highlightStroke:o}=es(Ovr,t);return` + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,s=Math.abs(n-r.x),a=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{de.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(!Uyr(e,s)&&!i){const a=Yyr(e,n,s);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)||r.push(a),i=!0}else n=s,i||r.push(s)}),r},"cutPathAtIntersect"),jyr=w(function(t,e,r,n,i,s,a){let o=r.points;de.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=s.node(e.v);var h=s.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(de.debug("to cluster abc88",n[r.toCluster]),o=kye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(de.debug("from cluster abc88",n[r.fromCluster]),o=kye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=b6;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=QSe(r),m=v6().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";(Ve().flowchart.arrowMarkerAbsolute||Ve().state.arrowMarkerAbsolute)&&(x=zN(!0)),Hyr(v,r,x,a,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Xyr=w(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),Kyr=w((t,e,r,n)=>{const i=Xyr(t),s=2,a=e.height+2*r.padding,o=a/s,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-a/3},{x:l+2*u,y:-a/2},{x:l,y:-2*a/3},{x:l,y:-a},{x:l-o,y:-a},{x:l/2,y:-a-2*u},{x:o,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*u,y:-a/2},{x:0,y:-a/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-a},{x:l-o,y:-a},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-a+o},{x:0,y:-a}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-a+o},{x:l,y:-a}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a},{x:0,y:-a/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-a}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-a}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-a}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-a}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a},{x:0,y:-a/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function pUe(t,e){return t.intersect(e)}w(pUe,"intersectNode");var Zyr=pUe;function gUe(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(Oj,"sameSign");var Jyr=vUe,evr=bUe;function bUe(t,e,r){var n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){a=Math.min(a,g.x),o=Math.min(o,g.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-a,u=i-t.height/2-o,h=0;h1&&s.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,x=Math.sqrt(y*y+v*v),b=m.x-r.x,T=m.y-r.y,C=Math.sqrt(b*b+T*T);return x{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),rvr=tvr,ps={node:Zyr,circle:Qyr,ellipse:mUe,polygon:evr,rect:rvr},so=w(async(t,e,r,n)=>{const i=Ve();let s;const a=e.useHtmlLabels||hi(i);r?s=r:s="node default";const o=t.insert("g").attr("class",s).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Zo(l,Ln(g0(u),i),{useHtmlLabels:a,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await uh(l,Ln(g0(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(hi(i)){const p=h.children[0],g=wt(h);await dZ(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return a?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Vs=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Bh(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}w(Bh,"insertPolygonShape");var nvr=w(async(t,e)=>{e.useHtmlLabels||hi(Ve())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:s}=await so(t,e,"node "+e.classes,!0);de.info("Classes = ",e.classes);const a=n.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-s).attr("y",-i.height/2-s).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Vs(e,a),e.intersect=function(o){return ps.rect(e,o)},n},"note"),ivr=nvr,Sye=w(t=>t?" "+t:"","formatClass"),eu=w((t,e)=>`${e||"node default"}${Sye(t.classes)} ${Sye(t.class)}`,"getClassesFromNode"),Eye=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=i+s,o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];de.info("Question main (Circle)");const l=Bh(r,a,a,o);return l.attr("style",e.style),Vs(e,l),e.intersect=function(u){return de.warn("Intersect called"),ps.polygon(e,o,u)},r},"question"),svr=w((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(a){return ps.circle(e,14,a)},r},"choice"),avr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=4,s=e.positioned?e.height:n.height+e.padding,a=s/i,o=e.positioned?e.width:n.width+2*a+e.padding,l=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-s/2},{x:o-a,y:-s},{x:a,y:-s},{x:0,y:-s/2}],u=Bh(r,o,s,l);return u.attr("style",e.style),Vs(e,u),e.intersect=function(h){return ps.polygon(e,l,h)},r},"hexagon"),ovr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,void 0,!0),i=2,s=n.height+2*e.padding,a=s/i,o=n.width+2*a+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=Kyr(e.directions,n,e,u),d=Bh(r,u,s,h);return d.attr("style",e.style),Vs(e,d),e.intersect=function(f){return ps.polygon(e,h,f)},r},"block_arrow"),lvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-s/2,y:0},{x:i,y:0},{x:i,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return Bh(r,i,s,a).attr("style",e.style),e.width=i+s,e.height=s,e.intersect=function(l){return ps.polygon(e,a,l)},r},"rect_left_inv_arrow"),cvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-2*s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:s/6,y:-s}],o=Bh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"lean_right"),uvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:2*s/6,y:0},{x:i+s/6,y:0},{x:i-2*s/6,y:-s},{x:-s/6,y:-s}],o=Bh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"lean_left"),hvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-2*s/6,y:0},{x:i+2*s/6,y:0},{x:i-s/6,y:-s},{x:s/6,y:-s}],o=Bh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"trapezoid"),dvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:-2*s/6,y:-s}],o=Bh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"inv_trapezoid"),fvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:0,y:0},{x:i+s/2,y:0},{x:i,y:-s/2},{x:i+s/2,y:-s},{x:0,y:-s}],o=Bh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"rect_right_inv_arrow"),pvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=i/2,a=s/(2.5+i/50),o=n.height+a+e.padding,l="M 0,"+a+" a "+s+","+a+" 0,0,0 "+i+" 0 a "+s+","+a+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+s+","+a+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",a).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+a)+")");return Vs(e,u),e.intersect=function(h){const d=ps.rect(e,h),f=d.x-e.x;if(s!=0&&(Math.abs(f)e.height/2-a)){let p=a*a*(1-f*f/(s*s));p!=0&&(p=Math.sqrt(p)),p=a-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),gvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,"node "+e.classes+" "+e.class,!0),s=r.insert("rect",":first-child"),a=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-a/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",a).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(PP(s,e.props.borders,a,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return Vs(e,s),e.intersect=function(h){return ps.rect(e,h)},r},"rect"),mvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,"node "+e.classes,!0),s=r.insert("rect",":first-child"),a=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-a/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(s.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",a).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(PP(s,e.props.borders,a,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return Vs(e,s),e.intersect=function(h){return ps.rect(e,h)},r},"composite"),yvr=w(async(t,e)=>{const{shapeSvg:r}=await so(t,e,"label",!0);de.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,s=0;if(n.attr("width",i).attr("height",s),r.attr("class","label edgeLabel"),e.props){const a=new Set(Object.keys(e.props));e.props.borders&&(PP(n,e.props.borders,i,s),a.delete("borders")),a.forEach(o=>{de.warn(`Unknown node property ${o}`)})}return Vs(e,n),e.intersect=function(a){return ps.rect(e,a)},r},"labelRect");function PP(t,e,r,n){const i=[],s=w(o=>{i.push(o,0)},"addBorder"),a=w(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(de.debug("add top border"),s(r)):a(r),e.includes("r")?(de.debug("add right border"),s(n)):a(n),e.includes("b")?(de.debug("add bottom border"),s(r)):a(r),e.includes("l")?(de.debug("add left border"),s(n)):a(n),t.attr("stroke-dasharray",i.join(" "))}w(PP,"applyNodePropertyBorders");var vvr=w(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),s=n.insert("line"),a=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,de.info("Label text abc79",l,o,typeof o=="object");const u=await uh(a,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(hi(Ve())){const m=u.children[0],y=wt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}de.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await uh(a,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(hi(Ve())){const m=p.children[0],y=wt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return wt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),wt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.height+e.padding,s=n.width+i/4+e.padding,a=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-s/2).attr("y",-i/2).attr("width",s).attr("height",i);return Vs(e,a),e.intersect=function(o){return ps.rect(e,o)},r},"stadium"),xvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,eu(e,void 0),!0),s=r.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),de.info("Circle main"),Vs(e,s),e.intersect=function(a){return de.info("Circle intersect",e,n.width/2+i,a),ps.circle(e,n.width/2+i,a)},r},"circle"),wvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await so(t,e,eu(e,void 0),!0),s=5,a=r.insert("g",":first-child"),o=a.insert("circle"),l=a.insert("circle");return a.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+s).attr("width",n.width+e.padding+s*2).attr("height",n.height+e.padding+s*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),de.info("DoubleCircle main"),Vs(e,o),e.intersect=function(u){return de.info("DoubleCircle intersect",e,n.width/2+i+s,u),ps.circle(e,n.width/2+i+s,u)},r},"doublecircle"),Tvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await so(t,e,eu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:0,y:0},{x:i,y:0},{x:i,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],o=Bh(r,i,s,a);return o.attr("style",e.style),Vs(e,o),e.intersect=function(l){return ps.polygon(e,a,l)},r},"subroutine"),Cvr=w((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Vs(e,n),e.intersect=function(i){return ps.circle(e,7,i)},r},"start"),Aye=w((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,s=10;r==="LR"&&(i=10,s=70);const a=n.append("rect").attr("x",-1*i/2).attr("y",-1*s/2).attr("width",i).attr("height",s).attr("class","fork-join");return Vs(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ps.rect(e,o)},n},"forkJoin"),kvr=w((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Vs(e,i),e.intersect=function(s){return ps.circle(e,7,s)},r},"end"),Svr=w(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let s;e.classes?s="node "+e.classes:s="node default";const a=t.insert("g").attr("class",s).attr("id",e.domId||e.id),o=a.insert("rect",":first-child"),l=a.insert("line"),u=a.insert("line");let h=0,d=n;const f=a.insert("g").attr("class","label");let p=0;const g=(E=e.classData.annotations)==null?void 0:E[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await uh(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(hi(Ve())){const A=y.children[0],R=wt(y);v=A.getBoundingClientRect(),R.attr("width",v.width),R.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(hi(Ve())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await uh(f,x,e.labelStyle,!0,!0);wt(b).attr("class","classTitle");let T=b.getBBox();if(hi(Ve())){const A=b.children[0],R=wt(b);T=A.getBoundingClientRect(),R.attr("width",T.width),R.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const C=[];e.classData.members.forEach(async A=>{const R=A.getDisplayDetails();let _=R.displayText;hi(Ve())&&(_=_.replace(//g,">"));const P=await uh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(hi(Ve())){const L=P.children[0],I=wt(P);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,C.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async A=>{const R=A.getDisplayDetails();let _=R.displayText;hi(Ve())&&(_=_.replace(//g,">"));const P=await uh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(hi(Ve())){const L=P.children[0],I=wt(P);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,S.push(P)}),d+=i,g){let A=(h-v.width)/2;wt(y).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=v.height+n}let k=(h-T.width)/2;return wt(b).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*d/2+p)+")"),p+=T.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(A=>{wt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(A=>{wt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Vs(e,o),e.intersect=function(A){return ps.rect(e,A)},a},"class_box"),Mye={rhombus:Eye,composite:mvr,question:Eye,rect:gvr,labelRect:yvr,rectWithTitle:vvr,choice:svr,circle:xvr,doublecircle:wvr,stadium:bvr,hexagon:avr,block_arrow:ovr,rect_left_inv_arrow:lvr,lean_right:cvr,lean_left:uvr,trapezoid:hvr,inv_trapezoid:dvr,rect_right_inv_arrow:fvr,cylinder:pvr,start:Cvr,end:kvr,note:ivr,subroutine:Tvr,fork:Aye,join:Aye,class_box:Svr},UR={},xUe=w(async(t,e,r)=>{let n,i;if(e.link){let s;Ve().securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),i=await Mye[e.shape](n,e,r)}else i=await Mye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),UR[e.id]=n,e.haveCallback&&UR[e.id].attr("class",UR[e.id].attr("class")+" clickable"),n},"insertNode"),Evr=w(t=>{const e=UR[t.id];de.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function Yne(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let s=0,a="",o;switch(n.type){case"round":s=5,a="rect";break;case"composite":s=0,a="composite",o=0;break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"block_arrow":a="block_arrow";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"rect_left_inv_arrow":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}const l=uZ((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:a,labelText:u,rx:s,ry:s,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=br())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}w(Yne,"getNodeFromBlock");async function wUe(t,e,r){const n=Yne(e,r,!1);if(n.type==="group")return;const i=br(),s=await xUe(t,n,{config:i}),a=s.node().getBBox(),o=r.getBlock(n.id);o.size={width:a.width,height:a.height,x:0,y:0,node:s},r.setBlock(o),s.remove()}w(wUe,"calculateBlockSize");async function TUe(t,e,r){const n=Yne(e,r,!0);if(r.getBlock(n.id).type!=="space"){const s=br();await xUe(t,n,{config:s}),e.intersect=n==null?void 0:n.intersect,Evr(n)}}w(TUe,"insertBlockPositioned");async function $P(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await $P(t,i.children,r,n)}w($P,"performOperations");async function CUe(t,e,r){await $P(t,e,r,wUe)}w(CUe,"calculateBlockSizes");async function kUe(t,e,r){await $P(t,e,r,TUe)}w(kUe,"insertBlocks");async function SUe(t,e,r,n,i){const s=new qo({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of r)a.size&&s.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(const a of e)if(a.start&&a.end){const o=n.getBlock(a.start),l=n.getBlock(a.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${a.id}`:a.id,p=a.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=a.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;jyr(t,{v:a.start,w:a.end,name:f},{...a,id:f,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m},void 0,"block",s,i),a.label&&(await Wyr(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m}),qyr({...a,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(SUe,"insertEdges");var Avr=w(function(t,e){return e.db.getClasses()},"getClasses"),Mvr=w(async function(t,e,r,n){const{securityLevel:i,block:s}=br(),a=n.db;a.setDiagramId(e);let o;i==="sandbox"&&(o=wt("#i"+e));const l=wt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):wt(`[id="${e}"]`);Fyr(u,["point","circle","cross"],n.type,e);const d=a.getBlocks(),f=a.getBlocksFlat(),p=a.getEdges(),g=u.insert("g").attr("class","block");await CUe(g,d,a);const m=fUe(a);if(await kUe(g,d,a),await SUe(g,p,f,a,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:T}=s;Fs(u,x,b,!!T),de.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),Rvr={draw:Mvr,getClasses:Avr},_vr={parser:syr,db:Syr,renderer:Rvr,styles:Ayr};const Lvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:_vr},Symbol.toStringTag,{value:"Module"}));var EUe=/[─━│┃└┗├┣]/,AUe=/[└┗├┣]/,Ivr=/[─━]/,Rye=/^[\s│┃]+$/,_ye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Lye=/^\s*%%/,Nvr=" ";function MUe(t){return t.some(e=>EUe.test(e))}w(MUe,"isBoxDrawingFormat");function RUe(t){for(const e of t){const r=AUe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(RUe,"inferSegmentWidth");function _Ue(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),s=e.get(i);return s?`line ${s}`:r})}w(_Ue,"remapErrorLines");function LUe(t){const e=t.split(` +`),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),Dvr=w(()=>{ld.reset(),Ri()},"clear"),Ovr=w(()=>ld.records.stack[0],"getRoot"),Pvr=w(()=>ld.records.cnt,"getCount"),$vr=Sn.treeView,Bvr=w(()=>es($vr,br().treeView),"getConfig"),Fvr=w((t,e,r,n,i,s)=>{for(;t<=ld.records.stack[ld.records.stack.length-1].level;)ld.records.stack.pop();const a={id:ld.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:s,children:[]};ld.records.stack[ld.records.stack.length-1].children.push(a),ld.records.stack.push(a)},"addNode"),zvr={clear:Dvr,addNode:Fvr,getRoot:Ovr,getCount:Pvr,getConfig:Bvr,getAccTitle:ts,getAccDescription:ns,getDiagramTitle:qi,setAccDescription:rs,setAccTitle:Hi,setDiagramTitle:Ji},Pj=zvr,Vvr=w(t=>{Vl(t,Pj);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const s=i?"directory":"file",a=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Ln(u,br()):void 0;Pj.addNode(r,n,s,a,l,h)}},"populate"),Hvr={parse:w(async t=>{const{text:e,lineMap:r}=LUe(t);try{const n=await zu("treeView",e);de.debug(n),Vvr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=_Ue(n.message,r)),n}},"parse")},CE={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function IUe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const s=t.substring(n).toLowerCase(),a=e==null?void 0:e.extensionIcons;return(a==null?void 0:a[s])??(a==null?void 0:a[s.slice(1)])}}w(IUe,"detectIcon");function $j(t,e){return t.includes(":")?t:t in CE.icons||!e?`${CE.prefix}:${t}`:`${e}:${t}`}w($j,"qualifyIcon");function jne(t,e){if(t.icon!=="none"){if(t.icon)return $j(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=IUe(t.name,e);if(r==="none")return;if(r)return $j(r,e.defaultIconPack)}return`${CE.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(jne,"getNodeIcon");fZ([{name:CE.prefix,icons:CE}]);var Bj=14,Gvr=4,Wvr=16,NUe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),qvr=w(async(t,e,r,n)=>{const i=new Set,s=w(l=>{const u=jne(l,r);u&&i.add(u),l.children.forEach(s)},"collect");if(s(e),i.size===0)return;const a=await Promise.all([...i].map(async l=>({icon:l,svg:await m0(l,{height:Bj,width:Bj})}))),o=t.append("defs");for(const{icon:l,svg:u}of a)o.append("g").attr("id",NUe(n,l)).html(u)},"injectIconDefs"),Uvr=w((t,e,r,n,i,s)=>{var x;const a=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=Bj+Gvr,u=jne(r,i),h=u!==void 0;u&&a.append("use").attr("xlink:href",`#${NUe(s,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=a.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(x=r.cssClass)!=null&&x.split(/\s+/).includes("highlight")&&a.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:a,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),Iye=w((t,e,r,n,i,s)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",s).attr("class","treeView-node-line"),"positionLine"),Yvr=w((t,e,r,n)=>{var h;let i=0,s=0;const a=[],o=w((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=Uvr(m,i,f,d,p,n);a.push(y);const{height:v,width:x}=f.BBox;Iye(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),s=Math.max(s,m+x),i+=v},"drawNode"),l=w((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;Iye(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=a.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...a.map(p=>p.labelRightEdge))+Wvr;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();s=Math.max(s,f+m.width+r.paddingX)}}for(const d of a)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=s-d.node.BBox.x+8;f.attr("width",p),s=Math.max(s,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:s}},"drawTree"),jvr=w(async(t,e,r,n)=>{de.debug(`Rendering treeView diagram +`+t);const i=n.db,s=i.getRoot(),a=i.getConfig(),o=Xo(e);await qvr(o,s,a,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=Yvr(l,s,a,e);o.attr("viewBox",`-${a.lineThickness/2} 0 ${h} ${u}`),Fs(o,u,h,a.useMaxWidth)},"draw"),Xvr={draw:jvr},Kvr=Xvr,Zvr={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Qvr=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:s,highlightBg:a,highlightStroke:o}=es(Zvr,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -5410,7 +5417,7 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error stroke: ${o}; stroke-width: 1; } - `},"styles"),$vr=Pvr,Bvr={db:Ij,renderer:Dvr,parser:Evr,styles:$vr};const Fvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Bvr},Symbol.toStringTag,{value:"Module"}));var GR={exports:{}},WR={exports:{}},qR={exports:{}},zvr=qR.exports,Aye;function Vvr(){return Aye||(Aye=1,(function(t,e){(function(n,i){t.exports=i()})(zvr,function(){return(function(r){var n={};function i(s){if(n[s])return n[s].exports;var a=n[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=r,i.c=n,i.i=function(s){return s},i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=28)})([(function(r,n,i){function s(){}s.QUALITY=1,s.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,s.DEFAULT_INCREMENTAL=!1,s.DEFAULT_ANIMATION_ON_LAYOUT=!0,s.DEFAULT_ANIMATION_DURING_LAYOUT=!1,s.DEFAULT_ANIMATION_PERIOD=50,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,s.DEFAULT_GRAPH_MARGIN=15,s.NODE_DIMENSIONS_INCLUDE_LABELS=!1,s.SIMPLE_NODE_SIZE=40,s.SIMPLE_NODE_HALF_SIZE=s.SIMPLE_NODE_SIZE/2,s.EMPTY_COMPOUND_NODE_SIZE=40,s.MIN_EDGE_LENGTH=1,s.WORLD_BOUNDARY=1e6,s.INITIAL_WORLD_BOUNDARY=s.WORLD_BOUNDARY/1e3,s.WORLD_CENTER_X=1200,s.WORLD_CENTER_Y=900,r.exports=s}),(function(r,n,i){var s=i(2),a=i(8),o=i(9);function l(h,d,f){s.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(s.prototype);for(var u in s)l[u]=s[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=a.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function s(a){this.vGraphObject=a}r.exports=s}),(function(r,n,i){var s=i(2),a=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),s.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var s=i(0);function a(){}for(var o in s)a[o]=s[o];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=a}),(function(r,n,i){function s(a,o){a==null&&o==null?(this.x=0,this.y=0):(this.x=a,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(a){this.x=a},s.prototype.setY=function(a){this.y=a},s.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},r.exports=s}),(function(r,n,i){var s=i(2),a=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){s.call(this,x),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(s.prototype);for(var m in s)g[m]=s[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,T=x.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=a.MAX_VALUE,v=a.MAX_VALUE,x,b,T,C=this.getNodes(),S=C.length,k=0;kx&&(y=x),v>b&&(v=b)}return y==a.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=a.MAX_VALUE,x=-a.MAX_VALUE,b=a.MAX_VALUE,T=-a.MAX_VALUE,C,S,k,E,A,R=this.nodes,_=R.length,P=0;P<_;P++){var N=R[P];y&&N.child!=null&&N.updateBounds(),C=N.getLeft(),S=N.getRight(),k=N.getTop(),E=N.getBottom(),v>C&&(v=C),xk&&(b=k),TC&&(v=C),xk&&(b=k),T=this.nodes.length){var _=0;x.forEach(function(P){P.owner==y&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var s,a=i(1);function o(l){s=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof s){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=R,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,L=!0):(u[0]=y,u[1]=m,L=!0):$===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=b,u[1]=x,L=!0)),-O===D?f>h?(u[2]=A,u[3]=R,I=!0):(u[2]=E,u[3]=k,I=!0):O===D&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=_,u[3]=R,I=!0)),L&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,D,4),z=this.getCardinalDirection(O,D,2)):(F=this.getCardinalDirection(-$,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(F=this.getCardinalDirection(-$,D,1),z=this.getCardinalDirection(-O,D,3)):(F=this.getCardinalDirection($,D,2),z=this.getCardinalDirection(O,D,4)),!L)switch(F){case 1:B=m,V=h+-C/D,u[0]=V,u[1]=B;break;case 2:V=b,B=d+T*D,u[0]=V,u[1]=B;break;case 3:B=x,V=h+C/D,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-T*D,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:G=k,H=f+-N/D,u[2]=H,u[3]=G;break;case 2:H=_,G=p+P*D,u[2]=H,u[3]=G;break;case 3:G=R,H=f+N/D,u[2]=H,u[3]=G;break;case 4:H=A,G=p+-P*D,u[2]=H,u[3]=G;break}}return!1},a.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},a.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,T=void 0,C=void 0,S=void 0,k=void 0,E=void 0,A=void 0,R=void 0,_=void 0;return C=g-f,k=d-p,A=p*f-d*g,S=x-y,E=m-v,R=v*y-m*x,_=C*E-S*k,_===0?null:(b=(k*R-E*A)/_,T=(S*A-C*R)/_,new s(b,T))},a.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),T=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:T}else return null},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,r.exports=a}),(function(r,n,i){function s(){}s.sign=function(a){return a>0?1:a<0?-1:0},s.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},s.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},r.exports=s}),(function(r,n,i){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s}),(function(r,n,i){var s=(function(){function d(f,p){for(var g=0;g"u"?"undefined":s(o);return o==null||l!="object"&&l!="function"},r.exports=a}),(function(r,n,i){function s(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&k.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(R,1);var _=S.getNeighborsList();_.forEach(function(L){if(v.indexOf(L)<0){var I=x.get(L),$=I-1;$==1&&E.push(L),x.set(L,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s}),(function(r,n,i){var s=i(5);function a(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(o){this.lworldExtX=o},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(o){this.lworldExtY=o},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},a.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},a.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},a.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},a.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},a.prototype.inverseTransformPoint=function(o){var l=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=a}),(function(r,n,i){function s(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mC||T>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||T>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function s(){}s.svd=function(a){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=a.length,this.n=a[0].length;var o=Math.min(this.m,this.n);this.s=(function(It){for(var ft=[];It-- >0;)ft.push(0);return ft})(Math.min(this.m+1,this.n)),this.U=(function(It){var ft=function xe(Nt){if(Nt.length==0)return 0;for(var Tt=[],yt=0;yt0;)ft.push(0);return ft})(this.n),u=(function(It){for(var ft=[];It-- >0;)ft.push(0);return ft})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;O--)if(this.s[O]!==0){for(var D=O+1;D=0;W--){if((function(It,ft){return It&&ft})(W0;){var te=void 0,_e=void 0;for(te=L-2;te>=-1&&te!==-1;te--)if(Math.abs(l[te])<=me+ie*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){l[te]=0;break}if(te===L-2)_e=4;else{var $e=void 0;for($e=L-1;$e>=te&&$e!==te;$e--){var Fe=($e!==L?Math.abs(l[$e]):0)+($e!==te+1?Math.abs(l[$e-1]):0);if(Math.abs(this.s[$e])<=me+ie*Fe){this.s[$e]=0;break}}$e===te?_e=3:$e===L-1?_e=1:(_e=2,te=$e)}switch(te++,_e){case 1:{var ce=l[L-2];l[L-2]=0;for(var he=L-2;he>=te;he--){var Te=s.hypot(this.s[he],ce),ge=this.s[he]/Te,He=ce/Te;this.s[he]=Te,he!==te&&(ce=-He*l[he-1],l[he-1]=ge*l[he-1]);for(var we=0;we=this.s[te+1]);){var St=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=St,teMath.abs(o)?(l=o/a,l=Math.abs(a)*Math.sqrt(1+l*l)):o!=0?(l=a/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=s}),(function(r,n,i){var s=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},a.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,x=u(551).LayoutConstants,b=u(551).Point,T=u(551).PointD,C=u(551).DimensionD,S=u(551).Layout,k=u(551).Integer,E=u(551).IGeometry,A=u(551).LGraph,R=u(551).Transform,_=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var N in h)P[N]=h[N];P.prototype.newGraphManager=function(){var L=new d(this);return this.graphManager=L,L},P.prototype.newGraph=function(L){return new f(null,this.graphManager,L)},P.prototype.newNode=function(L){return new p(this.graphManager,L)},P.prototype.newEdge=function(L){return new g(null,null,L)},P.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},P.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},P.prototype.layout=function(){var L=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return L&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation($)}}else{var L=this.getFlatForest();if(L.length>0)this.positionNodesRadially(L);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation($),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(D){return L.has(D)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var $=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces($,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var L=this.graphManager.getAllNodes(),I={},$=0;$0&&this.updateDisplacements();for(var $=0;$0&&(O.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Q){L.fixedNodesOnHorizontal.add(Q),L.fixedNodesOnVertical.add(Q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,$=0;$=2*Q.length/3;ie--)Z=Math.floor(Math.random()*(ie+1)),re=Q[ie],Q[ie]=Q[Z],Q[Z]=re;return Q},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(Q){if(Q.left){var Z=z.has(Q.left)?z.get(Q.left):Q.left,re=z.has(Q.right)?z.get(Q.right):Q.right;L.nodesInRelativeHorizontal.includes(Z)||(L.nodesInRelativeHorizontal.push(Z),L.nodeToRelativeConstraintMapHorizontal.set(Z,[]),L.dummyToNodeForVerticalAlignment.has(Z)?L.nodeToTempPositionMapHorizontal.set(Z,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(Z,L.idToNodeMap.get(Z).getCenterX())),L.nodesInRelativeHorizontal.includes(re)||(L.nodesInRelativeHorizontal.push(re),L.nodeToRelativeConstraintMapHorizontal.set(re,[]),L.dummyToNodeForVerticalAlignment.has(re)?L.nodeToTempPositionMapHorizontal.set(re,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(re)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(re,L.idToNodeMap.get(re).getCenterX())),L.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:re,gap:Q.gap}),L.nodeToRelativeConstraintMapHorizontal.get(re).push({left:Z,gap:Q.gap})}else{var ie=V.has(Q.top)?V.get(Q.top):Q.top,me=V.has(Q.bottom)?V.get(Q.bottom):Q.bottom;L.nodesInRelativeVertical.includes(ie)||(L.nodesInRelativeVertical.push(ie),L.nodeToRelativeConstraintMapVertical.set(ie,[]),L.dummyToNodeForHorizontalAlignment.has(ie)?L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(ie)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(ie).getCenterY())),L.nodesInRelativeVertical.includes(me)||(L.nodesInRelativeVertical.push(me),L.nodeToRelativeConstraintMapVertical.set(me,[]),L.dummyToNodeForHorizontalAlignment.has(me)?L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(me).getCenterY())),L.nodeToRelativeConstraintMapVertical.get(ie).push({bottom:me,gap:Q.gap}),L.nodeToRelativeConstraintMapVertical.get(me).push({top:ie,gap:Q.gap})}});else{var G=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(Q){if(Q.left){var Z=z.has(Q.left)?z.get(Q.left):Q.left,re=z.has(Q.right)?z.get(Q.right):Q.right;G.has(Z)?G.get(Z).push(re):G.set(Z,[re]),G.has(re)?G.get(re).push(Z):G.set(re,[Z])}else{var ie=V.has(Q.top)?V.get(Q.top):Q.top,me=V.has(Q.bottom)?V.get(Q.bottom):Q.bottom;W.has(ie)?W.get(ie).push(me):W.set(ie,[me]),W.has(me)?W.get(me).push(ie):W.set(me,[ie])}});var K=function(Z,re){var ie=[],me=[],te=new _,_e=new Set,$e=0;return Z.forEach(function(Fe,ce){if(!_e.has(ce)){ie[$e]=[],me[$e]=!1;var he=ce;for(te.push(he),_e.add(he),ie[$e].push(he);te.length!=0;){he=te.shift(),re.has(he)&&(me[$e]=!0);var Te=Z.get(he);Te.forEach(function(ge){_e.has(ge)||(te.push(ge),_e.add(ge),ie[$e].push(ge))})}$e++}}),{components:ie,isFixed:me}},q=K(G,L.fixedNodesOnHorizontal);this.componentsOnHorizontal=q.components,this.fixedComponentsOnHorizontal=q.isFixed;var oe=K(W,L.fixedNodesOnVertical);this.componentsOnVertical=oe.components,this.fixedComponentsOnVertical=oe.isFixed}}},P.prototype.updateDisplacements=function(){var L=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(oe){var Q=L.idToNodeMap.get(oe.nodeId);Q.displacementX=0,Q.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,$=0;$1){var V;for(V=0;VO&&(O=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(x.WORLD_CENTER_X-z.x/2,x.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(L,I,$){var O=Math.max(this.maxDiagonalInTree(L),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,O);var D=A.calculateBounds(L),F=new R;F.setDeviceOrgX(D.getMinX()),F.setDeviceOrgY(D.getMinY()),F.setWorldOrgX($.x),F.setWorldOrgY($.y);for(var z=0;z1;){var re=Z[0];Z.splice(0,1);var ie=W.indexOf(re);ie>=0&&W.splice(ie,1),oe--,K--}I!=null?Q=(W.indexOf(Z[0])+1)%oe:Q=0;for(var me=Math.abs(O-$)/K,te=Q;q!=K;te=++te%oe){var _e=W[te].getOtherEnd(L);if(_e!=I){var $e=($+q*me)%360,Fe=($e+me)%360;P.branchRadialLayout(_e,L,$e,Fe,D+F,F),q++}}},P.maxDiagonalInTree=function(L){for(var I=k.MIN_VALUE,$=0;$I&&(I=D)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var L=this,I={};this.memberGroups={},this.idToDummyNode={};for(var $=[],O=this.graphManager.getAllNodes(),D=0;D"u"&&(I[V]=[]),I[V]=I[V].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var H="DummyCompound_"+B;L.memberGroups[H]=I[B];var G=I[B][0].getParent(),W=new p(L.graphManager);W.id=H,W.paddingLeft=G.paddingLeft||0,W.paddingRight=G.paddingRight||0,W.paddingBottom=G.paddingBottom||0,W.paddingTop=G.paddingTop||0,L.idToDummyNode[H]=W;var K=L.getGraphManager().add(L.newGraph(),W),q=G.getChild();q.add(W);for(var oe=0;oeD?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(F+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>F?(O.rect.y-=(O.labelHeight-F)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-F)/2):O.labelPosVertical=="bottom"&&O.setHeight(F+O.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var L=this.compoundOrder.length-1;L>=0;L--){var I=this.compoundOrder[L],$=I.id,O=I.paddingLeft,D=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[$],I.rect.x,I.rect.y,O,D,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var L=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function($){var O=L.idToDummyNode[$],D=O.paddingLeft,F=O.paddingTop,z=O.labelMarginLeft,V=O.labelMarginTop;L.adjustLocations(I[$],O.rect.x,O.rect.y,D,F,z,V)})},P.prototype.getToBeTiled=function(L){var I=L.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var $=L.getChild();if($==null)return this.toBeTiled[I]=!1,!1;for(var O=$.getNodes(),D=0;D0)return this.toBeTiled[I]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},P.prototype.getNodeDegree=function(L){L.id;for(var I=L.getEdges(),$=0,O=0;OG&&(G=K.rect.height)}$+=G+L.verticalPadding}},P.prototype.tileCompoundMembers=function(L,I){var $=this;this.tiledMemberPack=[],Object.keys(L).forEach(function(O){var D=I[O];if($.tiledMemberPack[O]=$.tileNodes(L[O],D.paddingLeft+D.paddingRight),D.rect.width=$.tiledMemberPack[O].width,D.rect.height=$.tiledMemberPack[O].height,D.setCenter($.tiledMemberPack[O].centerX,$.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=D.rect.width,z=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(F+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>F?(D.rect.x-=(D.labelWidth-F)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-F)/2):D.labelPosHorizontal=="right"&&D.setWidth(F+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(z+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>z?(D.rect.y-=(D.labelHeight-z)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-z)/2):D.labelPosVertical=="bottom"&&D.setHeight(z+D.labelHeight))}})},P.prototype.tileNodes=function(L,I){var $=this.tileNodesByFavoringDim(L,I,!0),O=this.tileNodesByFavoringDim(L,I,!1),D=this.getOrgRatio($),F=this.getOrgRatio(O),z;return FV&&(V=oe.getWidth())});var B=F/D,H=z/D,G=Math.pow($-O,2)+4*(B+O)*(H+$)*D,W=(O-$+Math.sqrt(G))/(2*(B+O)),K;I?(K=Math.ceil(W),K==W&&K++):K=Math.floor(W);var q=K*(B+O)-O;return V>q&&(q=V),q+=O*2,q},P.prototype.tileNodesByFavoringDim=function(L,I,$){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(L,$));var V=function(Q){return Q.rect.width*Q.rect.height},B=function(Q,Z){return V(Z)-V(Q)};L.sort(function(oe,Q){var Z=B;return z.idealRowWidth?(Z=F,Z(oe.id,Q.id)):Z(oe,Q)});for(var H=0,G=0,W=0;W0&&(z+=L.horizontalPadding),L.rowWidth[$]=z,L.width0&&(V+=L.verticalPadding);var B=0;V>L.rowHeight[$]&&(B=L.rowHeight[$],L.rowHeight[$]=V,B=L.rowHeight[$]-B),L.height+=B,L.rows[$].push(I)},P.prototype.getShortestRowIndex=function(L){for(var I=-1,$=Number.MAX_VALUE,O=0;O$&&(I=O,$=L.rowWidth[O]);return I},P.prototype.canAddHorizontal=function(L,I,$){if(L.idealRowWidth){var O=L.rows.length-1,D=L.rowWidth[O];return D+I+L.horizontalPadding<=L.idealRowWidth}var F=this.getShortestRowIndex(L);if(F<0)return!0;var z=L.rowWidth[F];if(z+L.horizontalPadding+I<=L.width)return!0;var V=0;L.rowHeight[F]<$&&F>0&&(V=$+L.verticalPadding-L.rowHeight[F]);var B;L.width-z>=I+L.horizontalPadding?B=(L.height+V)/(z+I+L.horizontalPadding):B=(L.height+V)/L.width,V=$+L.verticalPadding;var H;return L.widthF&&I!=$){O.splice(-1,1),L.rows[$].push(D),L.rowWidth[I]=L.rowWidth[I]-F,L.rowWidth[$]=L.rowWidth[$]+F,L.width=L.rowWidth[instance.getLongestRowIndex(L)];for(var z=Number.MIN_VALUE,V=0;Vz&&(z=O[V].height);I>0&&(z+=L.verticalPadding);var B=L.rowHeight[I]+L.rowHeight[$];L.rowHeight[I]=z,L.rowHeight[$]0)for(var q=D;q<=F;q++)K[0]+=this.grid[q][z-1].length+this.grid[q][z].length-1;if(F0)for(var q=z;q<=V;q++)K[3]+=this.grid[D-1][q].length+this.grid[D][q].length-1;for(var oe=k.MAX_VALUE,Q,Z,re=0;re{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var St=0;Le.forEach(function(lt){fe=="horizontal"?(qe.set(lt,b.has(lt)?T[b.get(lt)]:Ae.get(lt)),St+=qe.get(lt)):(qe.set(lt,b.has(lt)?C[b.get(lt)]:Ae.get(lt)),St+=qe.get(lt))}),St=St/Le.length,mt.forEach(function(lt){ee.has(lt)||qe.set(lt,St)})}else{var At=0;mt.forEach(function(lt){fe=="horizontal"?At+=b.has(lt)?T[b.get(lt)]:Ae.get(lt):At+=b.has(lt)?C[b.get(lt)]:Ae.get(lt)}),At=At/mt.length,mt.forEach(function(lt){qe.set(lt,At)})}});for(var ze=function(){var Le=Ke.shift(),St=X.get(Le);St.forEach(function(At){if(qe.get(At.id)lt&&(lt=Rt),Orzt&&(zt=Or)}}catch(Ur){ft=!0,xe=Ur}finally{try{!It&&Nt.return&&Nt.return()}finally{if(ft)throw xe}}var Ee=(St+lt)/2-(At+zt)/2,it=!0,gt=!1,xt=void 0;try{for(var nr=mt[Symbol.iterator](),$r;!(it=($r=nr.next()).done);it=!0){var Cr=$r.value;qe.set(Cr,qe.get(Cr)+Ee)}}catch(Ur){gt=!0,xt=Ur}finally{try{!it&&nr.return&&nr.return()}finally{if(gt)throw xt}}})}return qe},N=function(X){var fe=0,ee=0,Ae=0,Re=0;if(X.forEach(function(De){De.left?T[b.get(De.left)]-T[b.get(De.right)]>=0?fe++:ee++:C[b.get(De.top)]-C[b.get(De.bottom)]>=0?Ae++:Re++}),fe>ee&&Ae>Re)for(var Xe=0;Xeee)for(var Ne=0;NeRe)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(ue,X){O[X]=[ue.position.x,ue.position.y],D[X]=[T[b.get(ue.nodeId)],C[b.get(ue.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var ue=0;if(v.alignmentConstraint.vertical){for(var X=v.alignmentConstraint.vertical,fe=function(qe){var De=new Set;X[qe].forEach(function(st){De.add(st)});var Ke=new Set([].concat(h(De)).filter(function(st){return V.has(st)})),ze=void 0;Ke.size>0?ze=T[b.get(Ke.values().next().value)]:ze=_(De).x,X[qe].forEach(function(st){O[ue]=[ze,C[b.get(st)]],D[ue]=[T[b.get(st)],C[b.get(st)]],ue++})},ee=0;ee0?ze=T[b.get(Ke.values().next().value)]:ze=_(De).y,Ae[qe].forEach(function(st){O[ue]=[T[b.get(st)],ze],D[ue]=[T[b.get(st)],C[b.get(st)]],ue++})},Xe=0;XeW&&(W=G[q].length,K=q);if(W0){var we={x:0,y:0};v.fixedNodeConstraint.forEach(function(ue,X){var fe={x:T[b.get(ue.nodeId)],y:C[b.get(ue.nodeId)]},ee=ue.position,Ae=R(ee,fe);we.x+=Ae.x,we.y+=Ae.y}),we.x/=v.fixedNodeConstraint.length,we.y/=v.fixedNodeConstraint.length,T.forEach(function(ue,X){T[X]+=we.x}),C.forEach(function(ue,X){C[X]+=we.y}),v.fixedNodeConstraint.forEach(function(ue){T[b.get(ue.nodeId)]=ue.position.x,C[b.get(ue.nodeId)]=ue.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Me=v.alignmentConstraint.vertical,je=function(X){var fe=new Set;Me[X].forEach(function(Re){fe.add(Re)});var ee=new Set([].concat(h(fe)).filter(function(Re){return V.has(Re)})),Ae=void 0;ee.size>0?Ae=T[b.get(ee.values().next().value)]:Ae=_(fe).x,fe.forEach(function(Re){V.has(Re)||(T[b.get(Re)]=Ae)})},le=0;le0?Ae=C[b.get(ee.values().next().value)]:Ae=_(fe).y,fe.forEach(function(Re){V.has(Re)||(C[b.get(Re)]=Ae)})},ne=0;ne{o.exports=r})},i={};function s(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,s),u.exports}var a=s(45);return a})()})})(WR)),WR.exports}var Wvr=GR.exports,Rye;function qvr(){return Rye||(Rye=1,(function(t,e){(function(n,i){t.exports=i(Gvr())})(Wvr,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,x=!1,b=void 0;try{for(var T=g[Symbol.iterator](),C;!(v=(C=T.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(S){x=!0,b=S}finally{try{!v&&T.return&&T.return()}finally{if(x)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&F.merge(H)});for(var z=0;z1){C=b[0],S=C.connectedEdges().length,b.forEach(function(D){D.connectedEdges().length0&&y.set("dummy"+(y.size+1),A),R},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,C=!1,S=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),E;!(T=(E=k.next()).done);T=!0){var A=E.value,R=h(A,2),_=R[0],P=R[1],N=m.cy.getElementById(_);if(N){var L=N.boundingBox(),I=g.xCoords[P]-L.w/2,$=g.xCoords[P]+L.w/2,O=g.yCoords[P]-L.h/2,D=g.yCoords[P]+L.h/2;Iv&&(v=$),Ob&&(b=D)}}}catch(H){C=!0,S=H}finally{try{!T&&k.return&&k.return()}finally{if(C)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(H){return H+F}),g.yCoords=g.yCoords.map(function(H){return H+z})}else{Object.keys(g).forEach(function(H){var G=g[H],W=G.getRect().x,K=G.getRect().x+G.getRect().width,q=G.getRect().y,oe=G.getRect().y+G.getRect().height;Wv&&(v=K),qb&&(b=oe)});var V=p.x-(v+y)/2,B=p.y-(b+x)/2;Object.keys(g).forEach(function(H){var G=g[H];G.setCenter(G.getCenterX()+V,G.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,k=void 0,E=void 0,A=p.descendants().not(":parent"),R=A.length,_=0;_C&&(v=C),xk&&(b=k),T{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,x=function(T,C){var S=T.cy,k=T.eles,E=k.nodes(),A=k.edges(),R=void 0,_=void 0,P=void 0,N={};T.randomize&&(R=C.nodeIndexes,_=C.xCoords,P=C.yCoords);var L=function(H){return typeof H=="function"},I=function(H,G){return L(H)?H(G):H},$=h.calcParentsWithoutChildren(S,k),O=function B(H,G,W,K){for(var q=G.length,oe=0;oe0){var te=void 0;te=W.getGraphManager().add(W.newGraph(),re),B(te,Z,W,K)}}},D=function(H,G,W){for(var K=0,q=0,oe=0;oe0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=K/q:L(T.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(H,G){G.fixedNodeConstraint&&(H.constraints.fixedNodeConstraint=G.fixedNodeConstraint),G.alignmentConstraint&&(H.constraints.alignmentConstraint=G.alignmentConstraint),G.relativePlacementConstraint&&(H.constraints.relativePlacementConstraint=G.relativePlacementConstraint)};T.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=T.animate,v.TILE=T.tile,v.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),T.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),T.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,V=z.newGraphManager();return O(V.addRoot(),h.getTopMostNodes(E),z,T),D(z,V,A),F(z,T),z.runLayout(),N};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function T(C,S){for(var k=0;k0)if($){var F=p.getTopMostNodes(k.eles.nodes());if(P=p.connectComponents(E,k.eles,F),P.forEach(function(Fe){var ce=Fe.boundingBox();N.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),k.randomize&&P.forEach(function(Fe){k.eles=Fe,R.push(m(k))}),k.quality=="default"||k.quality=="proof"){var z=E.collection();if(k.tile){var V=new Map,B=[],H=[],G=0,W={nodeIndexes:V,xCoords:B,yCoords:H},K=[];if(P.forEach(function(Fe,ce){Fe.edges().length==0&&(Fe.nodes().forEach(function(he,Te){z.merge(Fe.nodes()[Te]),he.isParent()||(W.nodeIndexes.set(Fe.nodes()[Te].id(),G++),W.xCoords.push(Fe.nodes()[0].position().x),W.yCoords.push(Fe.nodes()[0].position().y))}),K.push(ce))}),z.length>1){var q=z.boundingBox();N.push({x:q.x1+q.w/2,y:q.y1+q.h/2}),P.push(z),R.push(W);for(var oe=K.length-1;oe>=0;oe--)P.splice(K[oe],1),R.splice(K[oe],1),N.splice(K[oe],1)}}P.forEach(function(Fe,ce){k.eles=Fe,_.push(v(k,R[ce])),p.relocateComponent(N[ce],_[ce],k)})}else P.forEach(function(Fe,ce){p.relocateComponent(N[ce],R[ce],k)});var Q=new Set;if(P.length>1){var Z=[],re=A.filter(function(Fe){return Fe.css("display")=="none"});P.forEach(function(Fe,ce){var he=void 0;if(k.quality=="draft"&&(he=R[ce].nodeIndexes),Fe.nodes().not(re).length>0){var Te={};Te.edges=[],Te.nodes=[];var ge=void 0;Fe.nodes().not(re).forEach(function(He){if(k.quality=="draft")if(!He.isParent())ge=he.get(He.id()),Te.nodes.push({x:R[ce].xCoords[ge]-He.boundingbox().w/2,y:R[ce].yCoords[ge]-He.boundingbox().h/2,width:He.boundingbox().w,height:He.boundingbox().h});else{var we=p.calcBoundingBox(He,R[ce].xCoords,R[ce].yCoords,he);Te.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else _[ce][He.id()]&&Te.nodes.push({x:_[ce][He.id()].getLeft(),y:_[ce][He.id()].getTop(),width:_[ce][He.id()].getWidth(),height:_[ce][He.id()].getHeight()})}),Fe.edges().forEach(function(He){var we=He.source(),Me=He.target();if(we.css("display")!="none"&&Me.css("display")!="none")if(k.quality=="draft"){var je=he.get(we.id()),le=he.get(Me.id()),pe=[],Ce=[];if(we.isParent()){var ne=p.calcBoundingBox(we,R[ce].xCoords,R[ce].yCoords,he);pe.push(ne.topLeftX+ne.width/2),pe.push(ne.topLeftY+ne.height/2)}else pe.push(R[ce].xCoords[je]),pe.push(R[ce].yCoords[je]);if(Me.isParent()){var j=p.calcBoundingBox(Me,R[ce].xCoords,R[ce].yCoords,he);Ce.push(j.topLeftX+j.width/2),Ce.push(j.topLeftY+j.height/2)}else Ce.push(R[ce].xCoords[le]),Ce.push(R[ce].yCoords[le]);Te.edges.push({startX:pe[0],startY:pe[1],endX:Ce[0],endY:Ce[1]})}else _[ce][we.id()]&&_[ce][Me.id()]&&Te.edges.push({startX:_[ce][we.id()].getCenterX(),startY:_[ce][we.id()].getCenterY(),endX:_[ce][Me.id()].getCenterX(),endY:_[ce][Me.id()].getCenterY()})}),Te.nodes.length>0&&(Z.push(Te),Q.add(ce))}});var ie=I.packComponents(Z,k.randomize).shifts;if(k.quality=="draft")R.forEach(function(Fe,ce){var he=Fe.xCoords.map(function(ge){return ge+ie[ce].dx}),Te=Fe.yCoords.map(function(ge){return ge+ie[ce].dy});Fe.xCoords=he,Fe.yCoords=Te});else{var me=0;Q.forEach(function(Fe){Object.keys(_[Fe]).forEach(function(ce){var he=_[Fe][ce];he.setCenter(he.getCenterX()+ie[me].dx,he.getCenterY()+ie[me].dy)}),me++})}}}else{var O=k.eles.boundingBox();if(N.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),k.randomize){var D=m(k);R.push(D)}k.quality=="default"||k.quality=="proof"?(_.push(v(k,R[0])),p.relocateComponent(N[0],_[0],k)):p.relocateComponent(N[0],R[0],k)}var te=function(ce,he){if(k.quality=="default"||k.quality=="proof"){typeof ce=="number"&&(ce=he);var Te=void 0,ge=void 0,He=ce.data("id");return _.forEach(function(Me){He in Me&&(Te={x:Me[He].getRect().getCenterX(),y:Me[He].getRect().getCenterY()},ge=Me[He])}),k.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?Te.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(Te.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?Te.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(Te.y-=ge.labelHeight/2))),Te==null&&(Te={x:ce.position("x"),y:ce.position("y")}),{x:Te.x,y:Te.y}}else{var we=void 0;return R.forEach(function(Me){var je=Me.nodeIndexes.get(ce.id());je!=null&&(we={x:Me.xCoords[je],y:Me.yCoords[je]})}),we==null&&(we={x:ce.position("x"),y:ce.position("y")}),{x:we.x,y:we.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var _e=p.calcParentsWithoutChildren(E,A),$e=A.filter(function(Fe){return Fe.css("display")=="none"});k.eles=A.not($e),A.nodes().not(":parent").not($e).layoutPositions(S,k,te),_e.length>0&&_e.forEach(function(Fe){Fe.position(te(Fe))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,x=v.nodes(),b=v.nodes(":parent"),T=new Map,C=new Map,S=new Map,k=[],E=[],A=[],R=[],_=[],P=[],N=[],L=[],I=void 0,$=1e8,O=1e-9,D=m.piTol,F=m.samplingType,z=m.nodeSeparation,V=void 0,B=function(){for(var X=0,fe=0,ee=!1;fe=Re;){Ne=Ae[Re++];for(var Oe=k[Ne],mt=0;mtKe&&(Ke=_[St],ze=St)}return ze},G=function(X){var fe=void 0;if(X){fe=Math.floor(Math.random()*I);for(var Ae=0;Ae=1)break;De=qe}for(var st=0;st=1)break;De=qe}for(var mt=0;mt0&&(fe.isParent()?k[X].push(S.get(fe.id())):k[X].push(fe.id()))})});var $e=function(X){var fe=C.get(X),ee=void 0;T.get(X).forEach(function(Ae){y.getElementById(Ae).isParent()?ee=S.get(Ae):ee=Ae,k[fe].push(ee),k[C.get(ee)].push(X)})},Fe=!0,ce=!1,he=void 0;try{for(var Te=T.keys()[Symbol.iterator](),ge;!(Fe=(ge=Te.next()).done);Fe=!0){var He=ge.value;$e(He)}}catch(ue){ce=!0,he=ue}finally{try{!Fe&&Te.return&&Te.return()}finally{if(ce)throw he}}I=C.size;var we=void 0;if(I>2){V=I{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function s(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,s),u.exports}var a=s(579);return a})()})})(GR)),GR.exports}var Uvr=qvr();const Yvr=qg(Uvr);var _ye={L:"left",R:"right",T:"top",B:"bottom"},Lye={L:w(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:w(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:w(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:w(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},oM={L:w((t,e)=>t-e+2,"L"),R:w((t,e)=>t-2,"R"),T:w((t,e)=>t-e+2,"T"),B:w((t,e)=>t-2,"B")},jvr=w(function(t){return dl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Iye=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),dl=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Pg=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),qne=w(function(t,e){const r=dl(t)&&Pg(e),n=Pg(t)&&dl(e);return r||n},"isArchitectureDirectionXY"),Xvr=w(function(t){const e=t[0],r=t[1],n=dl(e)&&Pg(r),i=Pg(e)&&dl(r);return n||i},"isArchitecturePairXY"),Kvr=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),Oj=w(function(t,e){const r=`${t}${e}`;return Kvr(r)?r:void 0},"getArchitectureDirectionPair"),Zvr=w(function([t,e],r){const n=r[0],i=r[1];return dl(n)?Pg(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:dl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Qvr=w(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Jvr=w(function(t,e){return qne(t,e)?"bend":dl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),e2r=w(function(t){return t.type==="service"},"isArchitectureService"),t2r=w(function(t){return t.type==="junction"},"isArchitectureJunction"),MUe=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),RUe=w(t=>t.data(),"edgeData"),pb=w(t=>t.data(),"nodeData"),r2r=Sn.architecture,ST,_Ue=(ST=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Hi,this.getAccTitle=ts,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getAccDescription=ns,this.setAccDescription=rs,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",Ri()}addService({id:e,icon:r,in:n,title:i,iconText:s}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:s,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(e2r)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(t2r)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:s,rhsInto:a,lhsGroup:o,rhsGroup:l,title:u}){if(!Iye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Iye(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:s,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:a,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=Jvr(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(MUe(p,g),m)}if(f.lhsId===u){const m=Oj(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=Oj(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const s=new Set,a=new Set(i.keys()),o=w(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){s.add(f),a.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,y]=g;p.forEach((v,x)=>{s.has(v)||(h.set(v,Zvr([m,y],x)),d.push(v))})}}return h},"BFS"),l=[];for(;a.size>0;){const u=a.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return es({...r2r,...vr().architecture})}getConfigField(e){return this.getConfig()[e]}},w(ST,"ArchitectureDB"),ST),n2r=w((t,e)=>{var r;Fl(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),LUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await $u("architecture",t);de.debug(e);const r=(n=LUe.parser)==null?void 0:n.yy;if(!(r instanceof _Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");n2r(e,r)},"parse")},i2r=w(t=>` + `},"styles"),Jvr=Qvr,e2r={db:Pj,renderer:Kvr,parser:Hvr,styles:Jvr};const t2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:e2r},Symbol.toStringTag,{value:"Module"}));var YR={exports:{}},jR={exports:{}},XR={exports:{}},r2r=XR.exports,Nye;function n2r(){return Nye||(Nye=1,(function(t,e){(function(n,i){t.exports=i()})(r2r,function(){return(function(r){var n={};function i(s){if(n[s])return n[s].exports;var a=n[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=r,i.c=n,i.i=function(s){return s},i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=28)})([(function(r,n,i){function s(){}s.QUALITY=1,s.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,s.DEFAULT_INCREMENTAL=!1,s.DEFAULT_ANIMATION_ON_LAYOUT=!0,s.DEFAULT_ANIMATION_DURING_LAYOUT=!1,s.DEFAULT_ANIMATION_PERIOD=50,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,s.DEFAULT_GRAPH_MARGIN=15,s.NODE_DIMENSIONS_INCLUDE_LABELS=!1,s.SIMPLE_NODE_SIZE=40,s.SIMPLE_NODE_HALF_SIZE=s.SIMPLE_NODE_SIZE/2,s.EMPTY_COMPOUND_NODE_SIZE=40,s.MIN_EDGE_LENGTH=1,s.WORLD_BOUNDARY=1e6,s.INITIAL_WORLD_BOUNDARY=s.WORLD_BOUNDARY/1e3,s.WORLD_CENTER_X=1200,s.WORLD_CENTER_Y=900,r.exports=s}),(function(r,n,i){var s=i(2),a=i(8),o=i(9);function l(h,d,f){s.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(s.prototype);for(var u in s)l[u]=s[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=a.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function s(a){this.vGraphObject=a}r.exports=s}),(function(r,n,i){var s=i(2),a=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),s.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;vg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var s=i(0);function a(){}for(var o in s)a[o]=s[o];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=a}),(function(r,n,i){function s(a,o){a==null&&o==null?(this.x=0,this.y=0):(this.x=a,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(a){this.x=a},s.prototype.setY=function(a){this.y=a},s.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},r.exports=s}),(function(r,n,i){var s=i(2),a=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,x){s.call(this,x),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(s.prototype);for(var m in s)g[m]=s[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,x){if(v==null&&x==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var x=v.edges.slice(),b,T=x.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=a.MAX_VALUE,v=a.MAX_VALUE,x,b,T,C=this.getNodes(),S=C.length,k=0;kx&&(y=x),v>b&&(v=b)}return y==a.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=a.MAX_VALUE,x=-a.MAX_VALUE,b=a.MAX_VALUE,T=-a.MAX_VALUE,C,S,k,E,A,R=this.nodes,_=R.length,P=0;P<_;P++){var N=R[P];y&&N.child!=null&&N.updateBounds(),C=N.getLeft(),S=N.getRight(),k=N.getTop(),E=N.getBottom(),v>C&&(v=C),xk&&(b=k),TC&&(v=C),xk&&(b=k),T=this.nodes.length){var _=0;x.forEach(function(P){P.owner==y&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var s,a=i(1);function o(l){s=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof s){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=R,!1;if(df)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(hf?(u[0]=v,u[1]=x,L=!0):(u[0]=y,u[1]=m,L=!0):$===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=b,u[1]=x,L=!0)),-O===D?f>h?(u[2]=A,u[3]=R,I=!0):(u[2]=E,u[3]=k,I=!0):O===D&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=_,u[3]=R,I=!0)),L&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,D,4),z=this.getCardinalDirection(O,D,2)):(F=this.getCardinalDirection(-$,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(F=this.getCardinalDirection(-$,D,1),z=this.getCardinalDirection(-O,D,3)):(F=this.getCardinalDirection($,D,2),z=this.getCardinalDirection(O,D,4)),!L)switch(F){case 1:B=m,V=h+-C/D,u[0]=V,u[1]=B;break;case 2:V=b,B=d+T*D,u[0]=V,u[1]=B;break;case 3:B=x,V=h+C/D,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-T*D,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:G=k,H=f+-N/D,u[2]=H,u[3]=G;break;case 2:H=_,G=p+P*D,u[2]=H,u[3]=G;break;case 3:G=R,H=f+N/D,u[2]=H,u[3]=G;break;case 4:H=A,G=p+-P*D,u[2]=H,u[3]=G;break}}return!1},a.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},a.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,x=h.y,b=void 0,T=void 0,C=void 0,S=void 0,k=void 0,E=void 0,A=void 0,R=void 0,_=void 0;return C=g-f,k=d-p,A=p*f-d*g,S=x-y,E=m-v,R=v*y-m*x,_=C*E-S*k,_===0?null:(b=(k*R-E*A)/_,T=(S*A-C*R)/_,new s(b,T))},a.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),T=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:T}else return null},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,r.exports=a}),(function(r,n,i){function s(){}s.sign=function(a){return a>0?1:a<0?-1:0},s.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},s.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},r.exports=s}),(function(r,n,i){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s}),(function(r,n,i){var s=(function(){function d(f,p){for(var g=0;g"u"?"undefined":s(o);return o==null||l!="object"&&l!="function"},r.exports=a}),(function(r,n,i){function s(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&k.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(R,1);var _=S.getNeighborsList();_.forEach(function(L){if(v.indexOf(L)<0){var I=x.get(L),$=I-1;$==1&&E.push(L),x.set(L,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s}),(function(r,n,i){var s=i(5);function a(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(o){this.lworldExtX=o},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(o){this.lworldExtY=o},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},a.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},a.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},a.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},a.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},a.prototype.inverseTransformPoint=function(o){var l=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=a}),(function(r,n,i){function s(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mC||T>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||T>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=b.length||C>=b[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function s(){}s.svd=function(a){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=a.length,this.n=a[0].length;var o=Math.min(this.m,this.n);this.s=(function(It){for(var ft=[];It-- >0;)ft.push(0);return ft})(Math.min(this.m+1,this.n)),this.U=(function(It){var ft=function xe(Nt){if(Nt.length==0)return 0;for(var Tt=[],yt=0;yt0;)ft.push(0);return ft})(this.n),u=(function(It){for(var ft=[];It-- >0;)ft.push(0);return ft})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;O--)if(this.s[O]!==0){for(var D=O+1;D=0;W--){if((function(It,ft){return It&&ft})(W0;){var te=void 0,_e=void 0;for(te=L-2;te>=-1&&te!==-1;te--)if(Math.abs(l[te])<=me+ie*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){l[te]=0;break}if(te===L-2)_e=4;else{var $e=void 0;for($e=L-1;$e>=te&&$e!==te;$e--){var Fe=($e!==L?Math.abs(l[$e]):0)+($e!==te+1?Math.abs(l[$e-1]):0);if(Math.abs(this.s[$e])<=me+ie*Fe){this.s[$e]=0;break}}$e===te?_e=3:$e===L-1?_e=1:(_e=2,te=$e)}switch(te++,_e){case 1:{var ce=l[L-2];l[L-2]=0;for(var he=L-2;he>=te;he--){var Te=s.hypot(this.s[he],ce),ge=this.s[he]/Te,He=ce/Te;this.s[he]=Te,he!==te&&(ce=-He*l[he-1],l[he-1]=ge*l[he-1]);for(var we=0;we=this.s[te+1]);){var St=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=St,teMath.abs(o)?(l=o/a,l=Math.abs(a)*Math.sqrt(1+l*l)):o!=0?(l=a/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=s}),(function(r,n,i){var s=(function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},a.emit=function(o,l){for(var u=0;u{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,x=u(551).LayoutConstants,b=u(551).Point,T=u(551).PointD,C=u(551).DimensionD,S=u(551).Layout,k=u(551).Integer,E=u(551).IGeometry,A=u(551).LGraph,R=u(551).Transform,_=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var N in h)P[N]=h[N];P.prototype.newGraphManager=function(){var L=new d(this);return this.graphManager=L,L},P.prototype.newGraph=function(L){return new f(null,this.graphManager,L)},P.prototype.newNode=function(L){return new p(this.graphManager,L)},P.prototype.newEdge=function(L){return new g(null,null,L)},P.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},P.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},P.prototype.layout=function(){var L=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return L&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation($)}}else{var L=this.getFlatForest();if(L.length>0)this.positionNodesRadially(L);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation($),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(D){return L.has(D)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var $=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces($,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var L=this.graphManager.getAllNodes(),I={},$=0;$0&&this.updateDisplacements();for(var $=0;$0&&(O.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Q){L.fixedNodesOnHorizontal.add(Q),L.fixedNodesOnVertical.add(Q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,$=0;$=2*Q.length/3;ie--)Z=Math.floor(Math.random()*(ie+1)),re=Q[ie],Q[ie]=Q[Z],Q[Z]=re;return Q},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(Q){if(Q.left){var Z=z.has(Q.left)?z.get(Q.left):Q.left,re=z.has(Q.right)?z.get(Q.right):Q.right;L.nodesInRelativeHorizontal.includes(Z)||(L.nodesInRelativeHorizontal.push(Z),L.nodeToRelativeConstraintMapHorizontal.set(Z,[]),L.dummyToNodeForVerticalAlignment.has(Z)?L.nodeToTempPositionMapHorizontal.set(Z,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(Z,L.idToNodeMap.get(Z).getCenterX())),L.nodesInRelativeHorizontal.includes(re)||(L.nodesInRelativeHorizontal.push(re),L.nodeToRelativeConstraintMapHorizontal.set(re,[]),L.dummyToNodeForVerticalAlignment.has(re)?L.nodeToTempPositionMapHorizontal.set(re,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(re)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(re,L.idToNodeMap.get(re).getCenterX())),L.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:re,gap:Q.gap}),L.nodeToRelativeConstraintMapHorizontal.get(re).push({left:Z,gap:Q.gap})}else{var ie=V.has(Q.top)?V.get(Q.top):Q.top,me=V.has(Q.bottom)?V.get(Q.bottom):Q.bottom;L.nodesInRelativeVertical.includes(ie)||(L.nodesInRelativeVertical.push(ie),L.nodeToRelativeConstraintMapVertical.set(ie,[]),L.dummyToNodeForHorizontalAlignment.has(ie)?L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(ie)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(ie).getCenterY())),L.nodesInRelativeVertical.includes(me)||(L.nodesInRelativeVertical.push(me),L.nodeToRelativeConstraintMapVertical.set(me,[]),L.dummyToNodeForHorizontalAlignment.has(me)?L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(me).getCenterY())),L.nodeToRelativeConstraintMapVertical.get(ie).push({bottom:me,gap:Q.gap}),L.nodeToRelativeConstraintMapVertical.get(me).push({top:ie,gap:Q.gap})}});else{var G=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(Q){if(Q.left){var Z=z.has(Q.left)?z.get(Q.left):Q.left,re=z.has(Q.right)?z.get(Q.right):Q.right;G.has(Z)?G.get(Z).push(re):G.set(Z,[re]),G.has(re)?G.get(re).push(Z):G.set(re,[Z])}else{var ie=V.has(Q.top)?V.get(Q.top):Q.top,me=V.has(Q.bottom)?V.get(Q.bottom):Q.bottom;W.has(ie)?W.get(ie).push(me):W.set(ie,[me]),W.has(me)?W.get(me).push(ie):W.set(me,[ie])}});var K=function(Z,re){var ie=[],me=[],te=new _,_e=new Set,$e=0;return Z.forEach(function(Fe,ce){if(!_e.has(ce)){ie[$e]=[],me[$e]=!1;var he=ce;for(te.push(he),_e.add(he),ie[$e].push(he);te.length!=0;){he=te.shift(),re.has(he)&&(me[$e]=!0);var Te=Z.get(he);Te.forEach(function(ge){_e.has(ge)||(te.push(ge),_e.add(ge),ie[$e].push(ge))})}$e++}}),{components:ie,isFixed:me}},q=K(G,L.fixedNodesOnHorizontal);this.componentsOnHorizontal=q.components,this.fixedComponentsOnHorizontal=q.isFixed;var oe=K(W,L.fixedNodesOnVertical);this.componentsOnVertical=oe.components,this.fixedComponentsOnVertical=oe.isFixed}}},P.prototype.updateDisplacements=function(){var L=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(oe){var Q=L.idToNodeMap.get(oe.nodeId);Q.displacementX=0,Q.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,$=0;$1){var V;for(V=0;VO&&(O=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(x.WORLD_CENTER_X-z.x/2,x.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(L,I,$){var O=Math.max(this.maxDiagonalInTree(L),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,O);var D=A.calculateBounds(L),F=new R;F.setDeviceOrgX(D.getMinX()),F.setDeviceOrgY(D.getMinY()),F.setWorldOrgX($.x),F.setWorldOrgY($.y);for(var z=0;z1;){var re=Z[0];Z.splice(0,1);var ie=W.indexOf(re);ie>=0&&W.splice(ie,1),oe--,K--}I!=null?Q=(W.indexOf(Z[0])+1)%oe:Q=0;for(var me=Math.abs(O-$)/K,te=Q;q!=K;te=++te%oe){var _e=W[te].getOtherEnd(L);if(_e!=I){var $e=($+q*me)%360,Fe=($e+me)%360;P.branchRadialLayout(_e,L,$e,Fe,D+F,F),q++}}},P.maxDiagonalInTree=function(L){for(var I=k.MIN_VALUE,$=0;$I&&(I=D)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var L=this,I={};this.memberGroups={},this.idToDummyNode={};for(var $=[],O=this.graphManager.getAllNodes(),D=0;D"u"&&(I[V]=[]),I[V]=I[V].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var H="DummyCompound_"+B;L.memberGroups[H]=I[B];var G=I[B][0].getParent(),W=new p(L.graphManager);W.id=H,W.paddingLeft=G.paddingLeft||0,W.paddingRight=G.paddingRight||0,W.paddingBottom=G.paddingBottom||0,W.paddingTop=G.paddingTop||0,L.idToDummyNode[H]=W;var K=L.getGraphManager().add(L.newGraph(),W),q=G.getChild();q.add(W);for(var oe=0;oeD?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(F+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>F?(O.rect.y-=(O.labelHeight-F)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-F)/2):O.labelPosVertical=="bottom"&&O.setHeight(F+O.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var L=this.compoundOrder.length-1;L>=0;L--){var I=this.compoundOrder[L],$=I.id,O=I.paddingLeft,D=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[$],I.rect.x,I.rect.y,O,D,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var L=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function($){var O=L.idToDummyNode[$],D=O.paddingLeft,F=O.paddingTop,z=O.labelMarginLeft,V=O.labelMarginTop;L.adjustLocations(I[$],O.rect.x,O.rect.y,D,F,z,V)})},P.prototype.getToBeTiled=function(L){var I=L.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var $=L.getChild();if($==null)return this.toBeTiled[I]=!1,!1;for(var O=$.getNodes(),D=0;D0)return this.toBeTiled[I]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},P.prototype.getNodeDegree=function(L){L.id;for(var I=L.getEdges(),$=0,O=0;OG&&(G=K.rect.height)}$+=G+L.verticalPadding}},P.prototype.tileCompoundMembers=function(L,I){var $=this;this.tiledMemberPack=[],Object.keys(L).forEach(function(O){var D=I[O];if($.tiledMemberPack[O]=$.tileNodes(L[O],D.paddingLeft+D.paddingRight),D.rect.width=$.tiledMemberPack[O].width,D.rect.height=$.tiledMemberPack[O].height,D.setCenter($.tiledMemberPack[O].centerX,$.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=D.rect.width,z=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(F+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>F?(D.rect.x-=(D.labelWidth-F)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-F)/2):D.labelPosHorizontal=="right"&&D.setWidth(F+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(z+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>z?(D.rect.y-=(D.labelHeight-z)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-z)/2):D.labelPosVertical=="bottom"&&D.setHeight(z+D.labelHeight))}})},P.prototype.tileNodes=function(L,I){var $=this.tileNodesByFavoringDim(L,I,!0),O=this.tileNodesByFavoringDim(L,I,!1),D=this.getOrgRatio($),F=this.getOrgRatio(O),z;return FV&&(V=oe.getWidth())});var B=F/D,H=z/D,G=Math.pow($-O,2)+4*(B+O)*(H+$)*D,W=(O-$+Math.sqrt(G))/(2*(B+O)),K;I?(K=Math.ceil(W),K==W&&K++):K=Math.floor(W);var q=K*(B+O)-O;return V>q&&(q=V),q+=O*2,q},P.prototype.tileNodesByFavoringDim=function(L,I,$){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(L,$));var V=function(Q){return Q.rect.width*Q.rect.height},B=function(Q,Z){return V(Z)-V(Q)};L.sort(function(oe,Q){var Z=B;return z.idealRowWidth?(Z=F,Z(oe.id,Q.id)):Z(oe,Q)});for(var H=0,G=0,W=0;W0&&(z+=L.horizontalPadding),L.rowWidth[$]=z,L.width0&&(V+=L.verticalPadding);var B=0;V>L.rowHeight[$]&&(B=L.rowHeight[$],L.rowHeight[$]=V,B=L.rowHeight[$]-B),L.height+=B,L.rows[$].push(I)},P.prototype.getShortestRowIndex=function(L){for(var I=-1,$=Number.MAX_VALUE,O=0;O$&&(I=O,$=L.rowWidth[O]);return I},P.prototype.canAddHorizontal=function(L,I,$){if(L.idealRowWidth){var O=L.rows.length-1,D=L.rowWidth[O];return D+I+L.horizontalPadding<=L.idealRowWidth}var F=this.getShortestRowIndex(L);if(F<0)return!0;var z=L.rowWidth[F];if(z+L.horizontalPadding+I<=L.width)return!0;var V=0;L.rowHeight[F]<$&&F>0&&(V=$+L.verticalPadding-L.rowHeight[F]);var B;L.width-z>=I+L.horizontalPadding?B=(L.height+V)/(z+I+L.horizontalPadding):B=(L.height+V)/L.width,V=$+L.verticalPadding;var H;return L.widthF&&I!=$){O.splice(-1,1),L.rows[$].push(D),L.rowWidth[I]=L.rowWidth[I]-F,L.rowWidth[$]=L.rowWidth[$]+F,L.width=L.rowWidth[instance.getLongestRowIndex(L)];for(var z=Number.MIN_VALUE,V=0;Vz&&(z=O[V].height);I>0&&(z+=L.verticalPadding);var B=L.rowHeight[I]+L.rowHeight[$];L.rowHeight[I]=z,L.rowHeight[$]0)for(var q=D;q<=F;q++)K[0]+=this.grid[q][z-1].length+this.grid[q][z].length-1;if(F0)for(var q=z;q<=V;q++)K[3]+=this.grid[D-1][q].length+this.grid[D][q].length-1;for(var oe=k.MAX_VALUE,Q,Z,re=0;re{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var St=0;Le.forEach(function(lt){fe=="horizontal"?(qe.set(lt,b.has(lt)?T[b.get(lt)]:Ae.get(lt)),St+=qe.get(lt)):(qe.set(lt,b.has(lt)?C[b.get(lt)]:Ae.get(lt)),St+=qe.get(lt))}),St=St/Le.length,mt.forEach(function(lt){ee.has(lt)||qe.set(lt,St)})}else{var At=0;mt.forEach(function(lt){fe=="horizontal"?At+=b.has(lt)?T[b.get(lt)]:Ae.get(lt):At+=b.has(lt)?C[b.get(lt)]:Ae.get(lt)}),At=At/mt.length,mt.forEach(function(lt){qe.set(lt,At)})}});for(var ze=function(){var Le=Ke.shift(),St=X.get(Le);St.forEach(function(At){if(qe.get(At.id)lt&&(lt=Rt),Orzt&&(zt=Or)}}catch(Ur){ft=!0,xe=Ur}finally{try{!It&&Nt.return&&Nt.return()}finally{if(ft)throw xe}}var Ee=(St+lt)/2-(At+zt)/2,it=!0,gt=!1,xt=void 0;try{for(var nr=mt[Symbol.iterator](),$r;!(it=($r=nr.next()).done);it=!0){var kr=$r.value;qe.set(kr,qe.get(kr)+Ee)}}catch(Ur){gt=!0,xt=Ur}finally{try{!it&&nr.return&&nr.return()}finally{if(gt)throw xt}}})}return qe},N=function(X){var fe=0,ee=0,Ae=0,Re=0;if(X.forEach(function(De){De.left?T[b.get(De.left)]-T[b.get(De.right)]>=0?fe++:ee++:C[b.get(De.top)]-C[b.get(De.bottom)]>=0?Ae++:Re++}),fe>ee&&Ae>Re)for(var Xe=0;Xeee)for(var Ne=0;NeRe)for(var qe=0;qe1)v.fixedNodeConstraint.forEach(function(ue,X){O[X]=[ue.position.x,ue.position.y],D[X]=[T[b.get(ue.nodeId)],C[b.get(ue.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var ue=0;if(v.alignmentConstraint.vertical){for(var X=v.alignmentConstraint.vertical,fe=function(qe){var De=new Set;X[qe].forEach(function(st){De.add(st)});var Ke=new Set([].concat(h(De)).filter(function(st){return V.has(st)})),ze=void 0;Ke.size>0?ze=T[b.get(Ke.values().next().value)]:ze=_(De).x,X[qe].forEach(function(st){O[ue]=[ze,C[b.get(st)]],D[ue]=[T[b.get(st)],C[b.get(st)]],ue++})},ee=0;ee0?ze=T[b.get(Ke.values().next().value)]:ze=_(De).y,Ae[qe].forEach(function(st){O[ue]=[T[b.get(st)],ze],D[ue]=[T[b.get(st)],C[b.get(st)]],ue++})},Xe=0;XeW&&(W=G[q].length,K=q);if(W0){var we={x:0,y:0};v.fixedNodeConstraint.forEach(function(ue,X){var fe={x:T[b.get(ue.nodeId)],y:C[b.get(ue.nodeId)]},ee=ue.position,Ae=R(ee,fe);we.x+=Ae.x,we.y+=Ae.y}),we.x/=v.fixedNodeConstraint.length,we.y/=v.fixedNodeConstraint.length,T.forEach(function(ue,X){T[X]+=we.x}),C.forEach(function(ue,X){C[X]+=we.y}),v.fixedNodeConstraint.forEach(function(ue){T[b.get(ue.nodeId)]=ue.position.x,C[b.get(ue.nodeId)]=ue.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Me=v.alignmentConstraint.vertical,je=function(X){var fe=new Set;Me[X].forEach(function(Re){fe.add(Re)});var ee=new Set([].concat(h(fe)).filter(function(Re){return V.has(Re)})),Ae=void 0;ee.size>0?Ae=T[b.get(ee.values().next().value)]:Ae=_(fe).x,fe.forEach(function(Re){V.has(Re)||(T[b.get(Re)]=Ae)})},le=0;le0?Ae=C[b.get(ee.values().next().value)]:Ae=_(fe).y,fe.forEach(function(Re){V.has(Re)||(C[b.get(Re)]=Ae)})},ne=0;ne{o.exports=r})},i={};function s(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,s),u.exports}var a=s(45);return a})()})})(jR)),jR.exports}var a2r=YR.exports,Oye;function o2r(){return Oye||(Oye=1,(function(t,e){(function(n,i){t.exports=i(s2r())})(a2r,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=(function(){function p(g,m){var y=[],v=!0,x=!1,b=void 0;try{for(var T=g[Symbol.iterator](),C;!(v=(C=T.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(S){x=!0,b=S}finally{try{!v&&T.return&&T.return()}finally{if(x)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&F.merge(H)});for(var z=0;z1){C=b[0],S=C.connectedEdges().length,b.forEach(function(D){D.connectedEdges().length0&&y.set("dummy"+(y.size+1),A),R},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,C=!1,S=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),E;!(T=(E=k.next()).done);T=!0){var A=E.value,R=h(A,2),_=R[0],P=R[1],N=m.cy.getElementById(_);if(N){var L=N.boundingBox(),I=g.xCoords[P]-L.w/2,$=g.xCoords[P]+L.w/2,O=g.yCoords[P]-L.h/2,D=g.yCoords[P]+L.h/2;Iv&&(v=$),Ob&&(b=D)}}}catch(H){C=!0,S=H}finally{try{!T&&k.return&&k.return()}finally{if(C)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(H){return H+F}),g.yCoords=g.yCoords.map(function(H){return H+z})}else{Object.keys(g).forEach(function(H){var G=g[H],W=G.getRect().x,K=G.getRect().x+G.getRect().width,q=G.getRect().y,oe=G.getRect().y+G.getRect().height;Wv&&(v=K),qb&&(b=oe)});var V=p.x-(v+y)/2,B=p.y-(b+x)/2;Object.keys(g).forEach(function(H){var G=g[H];G.setCenter(G.getCenterX()+V,G.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,k=void 0,E=void 0,A=p.descendants().not(":parent"),R=A.length,_=0;_C&&(v=C),xk&&(b=k),T{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,x=function(T,C){var S=T.cy,k=T.eles,E=k.nodes(),A=k.edges(),R=void 0,_=void 0,P=void 0,N={};T.randomize&&(R=C.nodeIndexes,_=C.xCoords,P=C.yCoords);var L=function(H){return typeof H=="function"},I=function(H,G){return L(H)?H(G):H},$=h.calcParentsWithoutChildren(S,k),O=function B(H,G,W,K){for(var q=G.length,oe=0;oe0){var te=void 0;te=W.getGraphManager().add(W.newGraph(),re),B(te,Z,W,K)}}},D=function(H,G,W){for(var K=0,q=0,oe=0;oe0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=K/q:L(T.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(H,G){G.fixedNodeConstraint&&(H.constraints.fixedNodeConstraint=G.fixedNodeConstraint),G.alignmentConstraint&&(H.constraints.alignmentConstraint=G.alignmentConstraint),G.relativePlacementConstraint&&(H.constraints.relativePlacementConstraint=G.relativePlacementConstraint)};T.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=T.animate,v.TILE=T.tile,v.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),T.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),T.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,V=z.newGraphManager();return O(V.addRoot(),h.getTopMostNodes(E),z,T),D(z,V,A),F(z,T),z.runLayout(),N};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function T(C,S){for(var k=0;k0)if($){var F=p.getTopMostNodes(k.eles.nodes());if(P=p.connectComponents(E,k.eles,F),P.forEach(function(Fe){var ce=Fe.boundingBox();N.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),k.randomize&&P.forEach(function(Fe){k.eles=Fe,R.push(m(k))}),k.quality=="default"||k.quality=="proof"){var z=E.collection();if(k.tile){var V=new Map,B=[],H=[],G=0,W={nodeIndexes:V,xCoords:B,yCoords:H},K=[];if(P.forEach(function(Fe,ce){Fe.edges().length==0&&(Fe.nodes().forEach(function(he,Te){z.merge(Fe.nodes()[Te]),he.isParent()||(W.nodeIndexes.set(Fe.nodes()[Te].id(),G++),W.xCoords.push(Fe.nodes()[0].position().x),W.yCoords.push(Fe.nodes()[0].position().y))}),K.push(ce))}),z.length>1){var q=z.boundingBox();N.push({x:q.x1+q.w/2,y:q.y1+q.h/2}),P.push(z),R.push(W);for(var oe=K.length-1;oe>=0;oe--)P.splice(K[oe],1),R.splice(K[oe],1),N.splice(K[oe],1)}}P.forEach(function(Fe,ce){k.eles=Fe,_.push(v(k,R[ce])),p.relocateComponent(N[ce],_[ce],k)})}else P.forEach(function(Fe,ce){p.relocateComponent(N[ce],R[ce],k)});var Q=new Set;if(P.length>1){var Z=[],re=A.filter(function(Fe){return Fe.css("display")=="none"});P.forEach(function(Fe,ce){var he=void 0;if(k.quality=="draft"&&(he=R[ce].nodeIndexes),Fe.nodes().not(re).length>0){var Te={};Te.edges=[],Te.nodes=[];var ge=void 0;Fe.nodes().not(re).forEach(function(He){if(k.quality=="draft")if(!He.isParent())ge=he.get(He.id()),Te.nodes.push({x:R[ce].xCoords[ge]-He.boundingbox().w/2,y:R[ce].yCoords[ge]-He.boundingbox().h/2,width:He.boundingbox().w,height:He.boundingbox().h});else{var we=p.calcBoundingBox(He,R[ce].xCoords,R[ce].yCoords,he);Te.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else _[ce][He.id()]&&Te.nodes.push({x:_[ce][He.id()].getLeft(),y:_[ce][He.id()].getTop(),width:_[ce][He.id()].getWidth(),height:_[ce][He.id()].getHeight()})}),Fe.edges().forEach(function(He){var we=He.source(),Me=He.target();if(we.css("display")!="none"&&Me.css("display")!="none")if(k.quality=="draft"){var je=he.get(we.id()),le=he.get(Me.id()),pe=[],Ce=[];if(we.isParent()){var ne=p.calcBoundingBox(we,R[ce].xCoords,R[ce].yCoords,he);pe.push(ne.topLeftX+ne.width/2),pe.push(ne.topLeftY+ne.height/2)}else pe.push(R[ce].xCoords[je]),pe.push(R[ce].yCoords[je]);if(Me.isParent()){var j=p.calcBoundingBox(Me,R[ce].xCoords,R[ce].yCoords,he);Ce.push(j.topLeftX+j.width/2),Ce.push(j.topLeftY+j.height/2)}else Ce.push(R[ce].xCoords[le]),Ce.push(R[ce].yCoords[le]);Te.edges.push({startX:pe[0],startY:pe[1],endX:Ce[0],endY:Ce[1]})}else _[ce][we.id()]&&_[ce][Me.id()]&&Te.edges.push({startX:_[ce][we.id()].getCenterX(),startY:_[ce][we.id()].getCenterY(),endX:_[ce][Me.id()].getCenterX(),endY:_[ce][Me.id()].getCenterY()})}),Te.nodes.length>0&&(Z.push(Te),Q.add(ce))}});var ie=I.packComponents(Z,k.randomize).shifts;if(k.quality=="draft")R.forEach(function(Fe,ce){var he=Fe.xCoords.map(function(ge){return ge+ie[ce].dx}),Te=Fe.yCoords.map(function(ge){return ge+ie[ce].dy});Fe.xCoords=he,Fe.yCoords=Te});else{var me=0;Q.forEach(function(Fe){Object.keys(_[Fe]).forEach(function(ce){var he=_[Fe][ce];he.setCenter(he.getCenterX()+ie[me].dx,he.getCenterY()+ie[me].dy)}),me++})}}}else{var O=k.eles.boundingBox();if(N.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),k.randomize){var D=m(k);R.push(D)}k.quality=="default"||k.quality=="proof"?(_.push(v(k,R[0])),p.relocateComponent(N[0],_[0],k)):p.relocateComponent(N[0],R[0],k)}var te=function(ce,he){if(k.quality=="default"||k.quality=="proof"){typeof ce=="number"&&(ce=he);var Te=void 0,ge=void 0,He=ce.data("id");return _.forEach(function(Me){He in Me&&(Te={x:Me[He].getRect().getCenterX(),y:Me[He].getRect().getCenterY()},ge=Me[He])}),k.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?Te.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(Te.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?Te.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(Te.y-=ge.labelHeight/2))),Te==null&&(Te={x:ce.position("x"),y:ce.position("y")}),{x:Te.x,y:Te.y}}else{var we=void 0;return R.forEach(function(Me){var je=Me.nodeIndexes.get(ce.id());je!=null&&(we={x:Me.xCoords[je],y:Me.yCoords[je]})}),we==null&&(we={x:ce.position("x"),y:ce.position("y")}),{x:we.x,y:we.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var _e=p.calcParentsWithoutChildren(E,A),$e=A.filter(function(Fe){return Fe.css("display")=="none"});k.eles=A.not($e),A.nodes().not(":parent").not($e).layoutPositions(S,k,te),_e.length>0&&_e.forEach(function(Fe){Fe.position(te(Fe))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,x=v.nodes(),b=v.nodes(":parent"),T=new Map,C=new Map,S=new Map,k=[],E=[],A=[],R=[],_=[],P=[],N=[],L=[],I=void 0,$=1e8,O=1e-9,D=m.piTol,F=m.samplingType,z=m.nodeSeparation,V=void 0,B=function(){for(var X=0,fe=0,ee=!1;fe=Re;){Ne=Ae[Re++];for(var Oe=k[Ne],mt=0;mtKe&&(Ke=_[St],ze=St)}return ze},G=function(X){var fe=void 0;if(X){fe=Math.floor(Math.random()*I);for(var Ae=0;Ae=1)break;De=qe}for(var st=0;st=1)break;De=qe}for(var mt=0;mt0&&(fe.isParent()?k[X].push(S.get(fe.id())):k[X].push(fe.id()))})});var $e=function(X){var fe=C.get(X),ee=void 0;T.get(X).forEach(function(Ae){y.getElementById(Ae).isParent()?ee=S.get(Ae):ee=Ae,k[fe].push(ee),k[C.get(ee)].push(X)})},Fe=!0,ce=!1,he=void 0;try{for(var Te=T.keys()[Symbol.iterator](),ge;!(Fe=(ge=Te.next()).done);Fe=!0){var He=ge.value;$e(He)}}catch(ue){ce=!0,he=ue}finally{try{!Fe&&Te.return&&Te.return()}finally{if(ce)throw he}}I=C.size;var we=void 0;if(I>2){V=I{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function s(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,s),u.exports}var a=s(579);return a})()})})(YR)),YR.exports}var l2r=o2r();const c2r=jg(l2r);var Pye={L:"left",R:"right",T:"top",B:"bottom"},$ye={L:w(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:w(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:w(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:w(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},hM={L:w((t,e)=>t-e+2,"L"),R:w((t,e)=>t-2,"R"),T:w((t,e)=>t-e+2,"T"),B:w((t,e)=>t-2,"B")},u2r=w(function(t){return pl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Bye=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),pl=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Fg=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),Xne=w(function(t,e){const r=pl(t)&&Fg(e),n=Fg(t)&&pl(e);return r||n},"isArchitectureDirectionXY"),h2r=w(function(t){const e=t[0],r=t[1],n=pl(e)&&Fg(r),i=Fg(e)&&pl(r);return n||i},"isArchitecturePairXY"),d2r=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),Fj=w(function(t,e){const r=`${t}${e}`;return d2r(r)?r:void 0},"getArchitectureDirectionPair"),f2r=w(function([t,e],r){const n=r[0],i=r[1];return pl(n)?Fg(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:pl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),p2r=w(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),g2r=w(function(t,e){return Xne(t,e)?"bend":pl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),m2r=w(function(t){return t.type==="service"},"isArchitectureService"),y2r=w(function(t){return t.type==="junction"},"isArchitectureJunction"),DUe=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),OUe=w(t=>t.data(),"edgeData"),mb=w(t=>t.data(),"nodeData"),v2r=Sn.architecture,AT,PUe=(AT=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Hi,this.getAccTitle=ts,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getAccDescription=ns,this.setAccDescription=rs,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",Ri()}addService({id:e,icon:r,in:n,title:i,iconText:s}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:s,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(m2r)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(y2r)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:s,rhsInto:a,lhsGroup:o,rhsGroup:l,title:u}){if(!Bye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Bye(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:s,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:a,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=g2r(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(DUe(p,g),m)}if(f.lhsId===u){const m=Fj(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=Fj(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const s=new Set,a=new Set(i.keys()),o=w(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){s.add(f),a.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,y]=g;p.forEach((v,x)=>{s.has(v)||(h.set(v,f2r([m,y],x)),d.push(v))})}}return h},"BFS"),l=[];for(;a.size>0;){const u=a.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return es({...v2r,...br().architecture})}getConfigField(e){return this.getConfig()[e]}},w(AT,"ArchitectureDB"),AT),b2r=w((t,e)=>{var r;Vl(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),$Ue={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("architecture",t);de.debug(e);const r=(n=$Ue.parser)==null?void 0:n.yy;if(!(r instanceof PUe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");b2r(e,r)},"parse")},x2r=w(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -5441,19 +5448,19 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),s2r=i2r;function Pj(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}w(Pj,"withSeededRandom");var l2=w(t=>`${t}`,"wrapIcon"),wE={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:l2('')},server:{body:l2('')},disk:{body:l2('')},internet:{body:l2('')},cloud:{body:l2('')},unknown:HCe,blank:{body:l2("")}}},a2r=w(async function(t,e,r,n){const i=r.getConfigField("padding"),s=r.getConfigField("iconSize"),a=s/2,o=s/6,l=o/2;await Promise.all(e.edges().map(async u=>{var R,_;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:x}=RUe(u);let{x:b,y:T}=u[0].sourceEndpoint();const{x:C,y:S}=u[0].midpoint();let{x:k,y:E}=u[0].targetEndpoint();const A=i+4;if(p&&(dl(d)?b+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(dl(m)?k+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((R=r.getNode(h))==null?void 0:R.type)==="junction"&&(dl(d)?b+=d==="L"?a:-a:T+=d==="T"?a:-a),!v&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(dl(m)?k+=m==="L"?a:-a:E+=m==="T"?a:-a),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${b},${T} L ${C},${S} L${k},${E} `).attr("class","edge").attr("id",`${n}-${Mb(h,g,{prefix:"L"})}`),f){const N=dl(d)?oM[d](b,o):b-l,L=Pg(d)?oM[d](T,o):T-l;P.insert("polygon").attr("points",Lye[d](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(y){const N=dl(m)?oM[m](k,o):k-l,L=Pg(m)?oM[m](E,o):E-l;P.insert("polygon").attr("points",Lye[m](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(x){const N=qne(d,m)?"XY":dl(d)?"X":"Y";let L=0;N==="X"?L=Math.abs(b-k):N==="Y"?L=Math.abs(T-E)/1.5:L=Math.abs(b-k)/2;const I=P.append("g");if(await Zo(I,x,{useHtmlLabels:!1,width:L,classes:"architecture-service-label"},Ve()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")I.attr("transform","translate("+C+", "+S+")");else if(N==="Y")I.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(N==="XY"){const $=Oj(d,m);if($&&Xvr($)){const O=I.node().getBoundingClientRect(),[D,F]=Qvr($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*D*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` +`,"getStyles"),w2r=x2r;function zj(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}w(zj,"withSeededRandom");var u2=w(t=>`${t}`,"wrapIcon"),kE={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:u2('')},server:{body:u2('')},disk:{body:u2('')},internet:{body:u2('')},cloud:{body:u2('')},unknown:jCe,blank:{body:u2("")}}},T2r=w(async function(t,e,r,n){const i=r.getConfigField("padding"),s=r.getConfigField("iconSize"),a=s/2,o=s/6,l=o/2;await Promise.all(e.edges().map(async u=>{var R,_;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:x}=OUe(u);let{x:b,y:T}=u[0].sourceEndpoint();const{x:C,y:S}=u[0].midpoint();let{x:k,y:E}=u[0].targetEndpoint();const A=i+4;if(p&&(pl(d)?b+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(pl(m)?k+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((R=r.getNode(h))==null?void 0:R.type)==="junction"&&(pl(d)?b+=d==="L"?a:-a:T+=d==="T"?a:-a),!v&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(pl(m)?k+=m==="L"?a:-a:E+=m==="T"?a:-a),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${b},${T} L ${C},${S} L${k},${E} `).attr("class","edge").attr("id",`${n}-${_b(h,g,{prefix:"L"})}`),f){const N=pl(d)?hM[d](b,o):b-l,L=Fg(d)?hM[d](T,o):T-l;P.insert("polygon").attr("points",$ye[d](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(y){const N=pl(m)?hM[m](k,o):k-l,L=Fg(m)?hM[m](E,o):E-l;P.insert("polygon").attr("points",$ye[m](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(x){const N=Xne(d,m)?"XY":pl(d)?"X":"Y";let L=0;N==="X"?L=Math.abs(b-k):N==="Y"?L=Math.abs(T-E)/1.5:L=Math.abs(b-k)/2;const I=P.append("g");if(await Zo(I,x,{useHtmlLabels:!1,width:L,classes:"architecture-service-label"},Ve()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")I.attr("transform","translate("+C+", "+S+")");else if(N==="Y")I.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(N==="XY"){const $=Fj(d,m);if($&&h2r($)){const O=I.node().getBoundingClientRect(),[D,F]=p2r($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*D*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` translate(${C}, ${S-O.height/2}) translate(${D*z.width/2}, ${F*z.height/2}) rotate(${-1*D*F*45}, 0, ${O.height/2}) - `)}}}}}))},"drawEdges"),o2r=w(async function(t,e,r,n){const s=r.getConfigField("padding")*.75,a=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=pb(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,x=g;if(h.icon){const b=y.append("g");b.html(`${await d0(h.icon,{height:s,width:s,fallbackPrefix:wE.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=s,x+=a/2-1-2}if(h.label){const b=y.append("g");await Zo(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Ve()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),l2r=w(async function(t,e,r,n){const i=Ve();for(const s of r){const a=e.append("g"),o=t.getConfigField("iconSize");if(s.title){const d=a.append("g");await Zo(d,s.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=a.append("g");if(s.icon)l.html(`${await d0(s.icon,{height:o,width:o,fallbackPrefix:wE.prefix})}`);else if(s.iconText){l.html(`${await d0("blank",{height:o,width:o,fallbackPrefix:wE.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Ln(s.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${s.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);a.attr("id",`${n}-service-${s.id}`).attr("class","architecture-service");const{width:u,height:h}=a.node().getBBox();s.width=u,s.height=h,t.setElementForId(s.id,a)}return 0},"drawServices"),c2r=w(function(t,e,r,n){r.forEach(i=>{const s=e.append("g"),a=t.getConfigField("iconSize");s.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",a).attr("height",a),s.attr("class","architecture-junction");const{width:l,height:u}=s._groups[0][0].getBBox();s.width=l,s.height=u,t.setElementForId(i.id,s)})},"drawJunctions");cZ([{name:wE.prefix,icons:wE}]);Od.use(Yvr);function IUe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}w(IUe,"addServices");function NUe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}w(NUe,"addJunctions");function DUe(t,e){e.nodes().map(r=>{const n=pb(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}w(DUe,"positionNodes");function OUe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}w(OUe,"addGroups");function PUe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:s,lhsGroup:a,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=qne(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:s,sourceGroup:a,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}w(PUe,"addEdges");function $Ue(t,e,r,n=[]){const i=w((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let x=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let T=0;T{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var C;const x=((C=t.getNode(v))==null?void 0:C.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const T=g.get(m)??new Map;g.has(m)||g.set(m,T);for(const S of[b,T]){const k=S.get(x)??[];S.has(x)||S.set(x,k),k.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[a,o]=s.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=w(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(a),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}w($Ue,"getAlignments");function BUe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),s=e.getConfigField("idealEdgeLengthMultiplier"),a=s*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=w(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d.get(m);if(y){const v=u(m);Object.entries(g).forEach(([x,b])=>{const T=l([v[0]+b[0],v[1]+b[1]]),C=d.get(T);if(C&&!p[T]){if(f.push(T),o.has(`${y}|${C}`))return;n.push({[_ye[x]]:C,[_ye[jvr(x)]]:y,gap:s*i})}})}}}}),n}w(BUe,"getRelativeConstraints");function FUe(t,e,r,n,i,{spatialMaps:s,groupAlignments:a}){return new Promise(o=>{const l=wt("body").append("div").attr("id","cy").attr("style","display:none"),u=Od({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),OUe(r,u),IUe(t,u,i),NUe(e,u,i),PUe(n,u);const h=i.getLayoutHints(),d=$Ue(i,s,a,h),f=BUe(s,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),x=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(b){const[T,C]=b.connectedNodes(),{parent:S}=pb(T),{parent:k}=pb(C);return S===k?g:m},edgeElasticity(b){const[T,C]=b.connectedNodes(),{parent:S}=pb(T),{parent:k}=pb(C);return S===k?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});x.one("layoutstop",()=>{var T;function b(C,S,k,E){let A,R;const{x:_,y:P}=C,{x:N,y:L}=S;R=(E-P+(_-k)*(P-L)/(_-N))/Math.sqrt(1+Math.pow((P-L)/(_-N),2)),A=Math.sqrt(Math.pow(E-P,2)+Math.pow(k-_,2)-Math.pow(R,2));const I=Math.sqrt(Math.pow(N-_,2)+Math.pow(L-P,2));A=A/I;let $=(N-_)*(E-P)-(L-P)*(k-_);switch(!0){case $>=0:$=1;break;case $<0:$=-1;break}let O=(N-_)*(k-_)+(L-P)*(E-P);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return R=Math.abs(R)*$,A=A*O,{distances:R,weights:A}}w(b,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((T=C.data)!=null&&T.call(C)){const{x:S,y:k}=C.source().position(),{x:E,y:A}=C.target().position();if(S!==E&&k!==A){const R=C.sourceEndpoint(),_=C.targetEndpoint(),{sourceDir:P}=RUe(C),[N,L]=Pg(P)?[R.x,_.y]:[_.x,R.y],{weights:I,distances:$}=b(R,_,N,L);C.style("segment-distances",$),C.style("segment-weights",I)}}u.endBatch(),Pj(v,()=>x.run())});try{Pj(v,()=>x.run())}catch(b){throw b instanceof RangeError&&b.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):b}u.ready(b=>{de.info("Ready",b),o(u)})})}w(FUe,"layoutArchitecture");var u2r=w(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const s=i.getServices(),a=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=Xo(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await l2r(i,f,s,e),c2r(i,f,a,e);const g=await FUe(s,a,o,l,i,u);await a2r(d,g,i,e),await o2r(p,g,i,e),DUe(i,g),n3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),h2r={draw:u2r},d2r={parser:LUe,get db(){return new _Ue},renderer:h2r,styles:s2r};const f2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:d2r},Symbol.toStringTag,{value:"Module"}));var zUe="position frame",VUe="frame positioned",$j="position relation",HUe="relation positioned",p2r=w(function(t){de.debug("options str",t)},"setOptions"),g2r=w(function(){return{}},"getOptions"),m2r=w(function(){GUe(),Ri()},"clear");function GUe(){Une={}}w(GUe,"reset");var y2r=Sn.eventmodeling,v2r=w(()=>es({...y2r,...vr().eventmodeling}),"getConfig"),Une={};function WUe(){let t=b2r;const{ast:e}=Une,r=Yne();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const s=ZUe(n,e.dataEntities,r);t=YR(t,{$kind:zUe,index:i,frame:n,textProps:s});let a;nYe(n)?(de.debug("source frame",n.sourceFrames),a=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),a.forEach(o=>{t=YR(t,{$kind:$j,index:i,frame:n,sourceFrame:o})})):t=YR(t,{$kind:$j,index:i,frame:n})}),t={...t,sortedSwimlanesArray:jne(t.swimlanes)},t}w(WUe,"getState");function qUe(t){Une.ast=t}w(qUe,"setAst");var Jn={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 Yne(){return Jn}w(Yne,"getDiagramProps");var b2r={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function UUe(t){const e=t.split(".");if(e.length===2)return e[0]}w(UUe,"extractNamespace");function YUe(t){const e=t.split(".");return e.length===2?e[1]:t}w(YUe,"extractName");function jUe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w(jUe,"findSwimlaneByNamespace");function UR(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}w(UR,"findNextAvailableIndex");function XUe(t,e){const r=UUe(t.entityIdentifier),n=jUe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Jn.labelUiAutomation}:r?{index:UR(e,0,100),label:Jn.labelUiAutomationPrefix+r}:{index:0,label:Jn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Jn.labelCommandReadModel}:r?{index:UR(e,100,200),label:Jn.labelCommandReadModelPrefix+r}:{index:100,label:Jn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Jn.labelEvents}:r?{index:UR(e,200,300),label:Jn.labelEventsPrefix+r}:{index:200,label:Jn.labelEvents}}}w(XUe,"calculateSwimlaneProps");function KUe(t){const{themeVariables:e}=vr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}w(KUe,"calculateEntityVisualProps");function ZUe(t,e,r){const n=vr(),i=Ln(YUe(t.entityIdentifier)??"",n);let s;const a={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${Xk(i,r.textMaxWidth,a)}`;if(t.dataInlineValue&&(s=t.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=Ln(s,n),s=Xk(s,r.textMaxWidth,a),s=s.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(s=g.dataBlockValue,s=s.substring(s.indexOf(`{ -`)+2),s=s.substring(0,s.lastIndexOf("}")-1),s=Ln(s,n),s=Xk(s,r.textMaxWidth,a),s=s.replaceAll(" "," "),s+="
    ")}const u=s!==void 0;u&&(l+=`

    ${s}`);const h={fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:a.fontFamily},d=QN(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return de.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}w(ZUe,"calculateTextProps");function QUe(t,e){const r=e,n=KUe(r.frame),i={width:r.textProps.width+2*Jn.boxTextPadding,height:r.textProps.height+2*Jn.boxTextPadding};return[{$kind:VUe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(QUe,"decidePositionFrame");function JUe(t,e,r){return e===void 0?Jn.contentStartX:e.index===t.index&&t.r?t.r+Jn.boxPadding:r===void 0?Jn.contentStartX:r.r-Jn.boxOverlap+Jn.boxPadding}w(JUe,"calculateX");function eYe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(eYe,"calculateMaxRight");function jne(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(jne,"sortedSwimlanesArray");function tYe(t,e){const r=e,n=XUe(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*Jn.swimlaneMinHeight+Jn.swimlaneGap,height:Jn.swimlaneMinHeight,maxHeight:Jn.swimlaneMinHeight};const s=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,a=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(Jn.boxMinWidth,Math.min(Jn.boxMaxWidth,r.dimension.width))+2*Jn.boxPadding,height:Math.max(Jn.boxMinHeight,Math.min(Jn.boxMaxHeight,r.dimension.height))+2*Jn.boxPadding},l=JUe(i,a,s),u=l+o.width+Jn.boxPadding,h=eYe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(Jn.swimlaneMinHeight,i.maxHeight)+2*Jn.swimlanePadding;const d={x:l,y:Jn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=jne(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}w(nYe,"hasSourceFrame");function Bj(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(Bj,"findBoxByFrame");function iYe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}w(iYe,"findBoxByLineIndex");function sYe(t,e){const r=e;if(pGe(r.frame)||rYe(r.index,r.frame))return[];const n=Bj(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=Bj(t.boxes,r.sourceFrame):i=iYe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:HUe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(sYe,"decidePositionRelation");function aYe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}w(aYe,"evolveRelationPositioned");var x2r={[zUe]:QUe,[$j]:sYe},w2r={[VUe]:tYe,[HUe]:aYe};function oYe(t,e){const r=x2r[e.$kind];if(r==null)return[];const n=r(t,e);return de.debug("decided events",n),n}w(oYe,"decide");function lYe(t,e){const r=e.reduce((n,i)=>{const s=w2r[i.$kind];return s==null?n:s(n,i)},t);return de.debug("evolve events",{state:t,newState:r,events:e}),r}w(lYe,"evolve");function YR(t,e){const r=oYe(t,e);return lYe(t,r)}w(YR,"dispatch");var Fj={getConfig:v2r,setOptions:p2r,getOptions:g2r,clear:m2r,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi,setAst:qUe,getDiagramProps:Yne,getState:WUe},T2r={parse:w(async t=>{const e=await $u("eventmodeling",t);de.debug(e),Fj.setAst(e),Fl(e,Fj)},"parse")},CV=Ve(),C2r=CV==null?void 0:CV.eventmodeling;function cYe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}w(cYe,"renderD3Box");function uYe(t,e){return t>e}w(uYe,"dirUpwards");function hYe(t,e,r,n){return i=>{const s=i.sourceBox.swimlane.y+e.swimlanePadding,a=i.targetBox.swimlane.y+e.swimlanePadding,o=uYe(s,a),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;de.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=s,d=a+i.targetBox.dimension.height):(h=s+i.sourceBox.dimension.height,d=a);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}w(hYe,"renderD3Relation");function dYe(t,e,r,n){return i=>{const s=t.append("g").attr("class","em-swimlane"),a=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";s.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",a).attr("stroke",o),s.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}w(dYe,"renderD3Swimlane");var k2r=w(function(t,e,r,n){if(de.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!C2r)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:s,eventmodeling:a}=Ve(),o=wt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=s.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(dYe(o,u.maxR,l,s)),u.boxes.forEach(cYe(o,l)),u.relations.forEach(hYe(o,l,h,s)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),EK(void 0,o,(a==null?void 0:a.padding)??30,a==null?void 0:a.useMaxWidth)},"draw"),S2r={draw:k2r},E2r=w(t=>"","getStyles"),A2r=E2r,M2r={parser:T2r,db:Fj,renderer:S2r,styles:A2r};const R2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:M2r},Symbol.toStringTag,{value:"Module"}));var zj=(function(){var t=w(function(v,x,b,T){for(b=b||{},T=v.length;T--;b[v[T]]=x);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],s=[6,7,8],a=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:w(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:w(function(x,b,T,C,S,k,E){var A=k.length-1;switch(S){case 6:case 7:return C;case 15:C.addNode(k[A-1].length,k[A].trim());break;case 16:C.addNode(0,k[A].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(s,[2,3]),{1:[2,2]},t(s,[2,4]),t(s,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:a,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:a,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:w(function(x,b){if(b.recoverable)this.trace(x);else{var T=new Error(x);throw T.hash=b,T}},"parseError"),parse:w(function(x){var b=this,T=[0],C=[],S=[null],k=[],E=this.table,A="",R=0,_=0,P=2,N=1,L=k.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&($.yy[O]=this.yy[O]);I.setInput(x,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var D=I.yylloc;k.push(D);var F=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ie){T.length=T.length-2*ie,S.length=S.length-ie,k.length=k.length-ie}w(z,"popStack");function V(){var ie;return ie=C.pop()||I.lex()||N,typeof ie!="number"&&(ie instanceof Array&&(C=ie,ie=C.pop()),ie=b.symbols_[ie]||ie),ie}w(V,"lex");for(var B,H,G,W,K={},q,oe,Q,Z;;){if(H=T[T.length-1],this.defaultActions[H]?G=this.defaultActions[H]:((B===null||typeof B>"u")&&(B=V()),G=E[H]&&E[H][B]),typeof G>"u"||!G.length||!G[0]){var re="";Z=[];for(q in E[H])this.terminals_[q]&&q>P&&Z.push("'"+this.terminals_[q]+"'");I.showPosition?re="Parse error on line "+(R+1)+`: + `)}}}}}))},"drawEdges"),C2r=w(async function(t,e,r,n){const s=r.getConfigField("padding")*.75,a=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=mb(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,x=g;if(h.icon){const b=y.append("g");b.html(`${await m0(h.icon,{height:s,width:s,fallbackPrefix:kE.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=s,x+=a/2-1-2}if(h.label){const b=y.append("g");await Zo(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Ve()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),k2r=w(async function(t,e,r,n){const i=Ve();for(const s of r){const a=e.append("g"),o=t.getConfigField("iconSize");if(s.title){const d=a.append("g");await Zo(d,s.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=a.append("g");if(s.icon)l.html(`${await m0(s.icon,{height:o,width:o,fallbackPrefix:kE.prefix})}`);else if(s.iconText){l.html(`${await m0("blank",{height:o,width:o,fallbackPrefix:kE.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Ln(s.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${s.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);a.attr("id",`${n}-service-${s.id}`).attr("class","architecture-service");const{width:u,height:h}=a.node().getBBox();s.width=u,s.height=h,t.setElementForId(s.id,a)}return 0},"drawServices"),S2r=w(function(t,e,r,n){r.forEach(i=>{const s=e.append("g"),a=t.getConfigField("iconSize");s.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",a).attr("height",a),s.attr("class","architecture-junction");const{width:l,height:u}=s._groups[0][0].getBBox();s.width=l,s.height=u,t.setElementForId(i.id,s)})},"drawJunctions");fZ([{name:kE.prefix,icons:kE}]);Bd.use(c2r);function BUe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}w(BUe,"addServices");function FUe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}w(FUe,"addJunctions");function zUe(t,e){e.nodes().map(r=>{const n=mb(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}w(zUe,"positionNodes");function VUe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}w(VUe,"addGroups");function HUe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:s,lhsGroup:a,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=Xne(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:s,sourceGroup:a,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}w(HUe,"addEdges");function GUe(t,e,r,n=[]){const i=w((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let x=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let T=0;T{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var C;const x=((C=t.getNode(v))==null?void 0:C.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const T=g.get(m)??new Map;g.has(m)||g.set(m,T);for(const S of[b,T]){const k=S.get(x)??[];S.has(x)||S.set(x,k),k.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[a,o]=s.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=w(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(a),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}w(GUe,"getAlignments");function WUe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),s=e.getConfigField("idealEdgeLengthMultiplier"),a=s*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=w(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d.get(m);if(y){const v=u(m);Object.entries(g).forEach(([x,b])=>{const T=l([v[0]+b[0],v[1]+b[1]]),C=d.get(T);if(C&&!p[T]){if(f.push(T),o.has(`${y}|${C}`))return;n.push({[Pye[x]]:C,[Pye[u2r(x)]]:y,gap:s*i})}})}}}}),n}w(WUe,"getRelativeConstraints");function qUe(t,e,r,n,i,{spatialMaps:s,groupAlignments:a}){return new Promise(o=>{const l=wt("body").append("div").attr("id","cy").attr("style","display:none"),u=Bd({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),VUe(r,u),BUe(t,u,i),FUe(e,u,i),HUe(n,u);const h=i.getLayoutHints(),d=GUe(i,s,a,h),f=WUe(s,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),x=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(b){const[T,C]=b.connectedNodes(),{parent:S}=mb(T),{parent:k}=mb(C);return S===k?g:m},edgeElasticity(b){const[T,C]=b.connectedNodes(),{parent:S}=mb(T),{parent:k}=mb(C);return S===k?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});x.one("layoutstop",()=>{var T;function b(C,S,k,E){let A,R;const{x:_,y:P}=C,{x:N,y:L}=S;R=(E-P+(_-k)*(P-L)/(_-N))/Math.sqrt(1+Math.pow((P-L)/(_-N),2)),A=Math.sqrt(Math.pow(E-P,2)+Math.pow(k-_,2)-Math.pow(R,2));const I=Math.sqrt(Math.pow(N-_,2)+Math.pow(L-P,2));A=A/I;let $=(N-_)*(E-P)-(L-P)*(k-_);switch(!0){case $>=0:$=1;break;case $<0:$=-1;break}let O=(N-_)*(k-_)+(L-P)*(E-P);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return R=Math.abs(R)*$,A=A*O,{distances:R,weights:A}}w(b,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((T=C.data)!=null&&T.call(C)){const{x:S,y:k}=C.source().position(),{x:E,y:A}=C.target().position();if(S!==E&&k!==A){const R=C.sourceEndpoint(),_=C.targetEndpoint(),{sourceDir:P}=OUe(C),[N,L]=Fg(P)?[R.x,_.y]:[_.x,R.y],{weights:I,distances:$}=b(R,_,N,L);C.style("segment-distances",$),C.style("segment-weights",I)}}u.endBatch(),zj(v,()=>x.run())});try{zj(v,()=>x.run())}catch(b){throw b instanceof RangeError&&b.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):b}u.ready(b=>{de.info("Ready",b),o(u)})})}w(qUe,"layoutArchitecture");var E2r=w(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const s=i.getServices(),a=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=Xo(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await k2r(i,f,s,e),S2r(i,f,a,e);const g=await qUe(s,a,o,l,i,u);await T2r(d,g,i,e),await C2r(p,g,i,e),zUe(i,g),a3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),A2r={draw:E2r},M2r={parser:$Ue,get db(){return new PUe},renderer:A2r,styles:w2r};const R2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:M2r},Symbol.toStringTag,{value:"Module"}));var UUe="position frame",YUe="frame positioned",Vj="position relation",jUe="relation positioned",_2r=w(function(t){de.debug("options str",t)},"setOptions"),L2r=w(function(){return{}},"getOptions"),I2r=w(function(){XUe(),Ri()},"clear");function XUe(){Kne={}}w(XUe,"reset");var N2r=Sn.eventmodeling,D2r=w(()=>es({...N2r,...br().eventmodeling}),"getConfig"),Kne={};function KUe(){let t=O2r;const{ast:e}=Kne,r=Zne();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const s=nYe(n,e.dataEntities,r);t=ZR(t,{$kind:UUe,index:i,frame:n,textProps:s});let a;cYe(n)?(de.debug("source frame",n.sourceFrames),a=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),a.forEach(o=>{t=ZR(t,{$kind:Vj,index:i,frame:n,sourceFrame:o})})):t=ZR(t,{$kind:Vj,index:i,frame:n})}),t={...t,sortedSwimlanesArray:Qne(t.swimlanes)},t}w(KUe,"getState");function ZUe(t){Kne.ast=t}w(ZUe,"setAst");var Jn={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 Zne(){return Jn}w(Zne,"getDiagramProps");var O2r={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function QUe(t){const e=t.split(".");if(e.length===2)return e[0]}w(QUe,"extractNamespace");function JUe(t){const e=t.split(".");return e.length===2?e[1]:t}w(JUe,"extractName");function eYe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w(eYe,"findSwimlaneByNamespace");function KR(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}w(KR,"findNextAvailableIndex");function tYe(t,e){const r=QUe(t.entityIdentifier),n=eYe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Jn.labelUiAutomation}:r?{index:KR(e,0,100),label:Jn.labelUiAutomationPrefix+r}:{index:0,label:Jn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Jn.labelCommandReadModel}:r?{index:KR(e,100,200),label:Jn.labelCommandReadModelPrefix+r}:{index:100,label:Jn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Jn.labelEvents}:r?{index:KR(e,200,300),label:Jn.labelEventsPrefix+r}:{index:200,label:Jn.labelEvents}}}w(tYe,"calculateSwimlaneProps");function rYe(t){const{themeVariables:e}=br();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}w(rYe,"calculateEntityVisualProps");function nYe(t,e,r){const n=br(),i=Ln(JUe(t.entityIdentifier)??"",n);let s;const a={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${Qk(i,r.textMaxWidth,a)}`;if(t.dataInlineValue&&(s=t.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=Ln(s,n),s=Qk(s,r.textMaxWidth,a),s=s.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(s=g.dataBlockValue,s=s.substring(s.indexOf(`{ +`)+2),s=s.substring(0,s.lastIndexOf("}")-1),s=Ln(s,n),s=Qk(s,r.textMaxWidth,a),s=s.replaceAll(" "," "),s+="
    ")}const u=s!==void 0;u&&(l+=`

    ${s}`);const h={fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:a.fontFamily},d=tD(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return de.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}w(nYe,"calculateTextProps");function iYe(t,e){const r=e,n=rYe(r.frame),i={width:r.textProps.width+2*Jn.boxTextPadding,height:r.textProps.height+2*Jn.boxTextPadding};return[{$kind:YUe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(iYe,"decidePositionFrame");function sYe(t,e,r){return e===void 0?Jn.contentStartX:e.index===t.index&&t.r?t.r+Jn.boxPadding:r===void 0?Jn.contentStartX:r.r-Jn.boxOverlap+Jn.boxPadding}w(sYe,"calculateX");function aYe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(aYe,"calculateMaxRight");function Qne(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(Qne,"sortedSwimlanesArray");function oYe(t,e){const r=e,n=tYe(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*Jn.swimlaneMinHeight+Jn.swimlaneGap,height:Jn.swimlaneMinHeight,maxHeight:Jn.swimlaneMinHeight};const s=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,a=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(Jn.boxMinWidth,Math.min(Jn.boxMaxWidth,r.dimension.width))+2*Jn.boxPadding,height:Math.max(Jn.boxMinHeight,Math.min(Jn.boxMaxHeight,r.dimension.height))+2*Jn.boxPadding},l=sYe(i,a,s),u=l+o.width+Jn.boxPadding,h=aYe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(Jn.swimlaneMinHeight,i.maxHeight)+2*Jn.swimlanePadding;const d={x:l,y:Jn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=Qne(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}w(cYe,"hasSourceFrame");function Hj(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(Hj,"findBoxByFrame");function uYe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}w(uYe,"findBoxByLineIndex");function hYe(t,e){const r=e;if(xGe(r.frame)||lYe(r.index,r.frame))return[];const n=Hj(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=Hj(t.boxes,r.sourceFrame):i=uYe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:jUe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(hYe,"decidePositionRelation");function dYe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}w(dYe,"evolveRelationPositioned");var P2r={[UUe]:iYe,[Vj]:hYe},$2r={[YUe]:oYe,[jUe]:dYe};function fYe(t,e){const r=P2r[e.$kind];if(r==null)return[];const n=r(t,e);return de.debug("decided events",n),n}w(fYe,"decide");function pYe(t,e){const r=e.reduce((n,i)=>{const s=$2r[i.$kind];return s==null?n:s(n,i)},t);return de.debug("evolve events",{state:t,newState:r,events:e}),r}w(pYe,"evolve");function ZR(t,e){const r=fYe(t,e);return pYe(t,r)}w(ZR,"dispatch");var Gj={getConfig:D2r,setOptions:_2r,getOptions:L2r,clear:I2r,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi,setAst:ZUe,getDiagramProps:Zne,getState:KUe},B2r={parse:w(async t=>{const e=await zu("eventmodeling",t);de.debug(e),Gj.setAst(e),Vl(e,Gj)},"parse")},AV=Ve(),F2r=AV==null?void 0:AV.eventmodeling;function gYe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}w(gYe,"renderD3Box");function mYe(t,e){return t>e}w(mYe,"dirUpwards");function yYe(t,e,r,n){return i=>{const s=i.sourceBox.swimlane.y+e.swimlanePadding,a=i.targetBox.swimlane.y+e.swimlanePadding,o=mYe(s,a),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;de.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=s,d=a+i.targetBox.dimension.height):(h=s+i.sourceBox.dimension.height,d=a);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}w(yYe,"renderD3Relation");function vYe(t,e,r,n){return i=>{const s=t.append("g").attr("class","em-swimlane"),a=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";s.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",a).attr("stroke",o),s.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}w(vYe,"renderD3Swimlane");var z2r=w(function(t,e,r,n){if(de.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!F2r)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:s,eventmodeling:a}=Ve(),o=wt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=s.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(vYe(o,u.maxR,l,s)),u.boxes.forEach(gYe(o,l)),u.relations.forEach(yYe(o,l,h,s)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),_K(void 0,o,(a==null?void 0:a.padding)??30,a==null?void 0:a.useMaxWidth)},"draw"),V2r={draw:z2r},H2r=w(t=>"","getStyles"),G2r=H2r,W2r={parser:B2r,db:Gj,renderer:V2r,styles:G2r};const q2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:W2r},Symbol.toStringTag,{value:"Module"}));var Wj=(function(){var t=w(function(v,x,b,T){for(b=b||{},T=v.length;T--;b[v[T]]=x);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],s=[6,7,8],a=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:w(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:w(function(x,b,T,C,S,k,E){var A=k.length-1;switch(S){case 6:case 7:return C;case 15:C.addNode(k[A-1].length,k[A].trim());break;case 16:C.addNode(0,k[A].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(s,[2,3]),{1:[2,2]},t(s,[2,4]),t(s,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:a,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:a,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:w(function(x,b){if(b.recoverable)this.trace(x);else{var T=new Error(x);throw T.hash=b,T}},"parseError"),parse:w(function(x){var b=this,T=[0],C=[],S=[null],k=[],E=this.table,A="",R=0,_=0,P=2,N=1,L=k.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&($.yy[O]=this.yy[O]);I.setInput(x,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var D=I.yylloc;k.push(D);var F=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ie){T.length=T.length-2*ie,S.length=S.length-ie,k.length=k.length-ie}w(z,"popStack");function V(){var ie;return ie=C.pop()||I.lex()||N,typeof ie!="number"&&(ie instanceof Array&&(C=ie,ie=C.pop()),ie=b.symbols_[ie]||ie),ie}w(V,"lex");for(var B,H,G,W,K={},q,oe,Q,Z;;){if(H=T[T.length-1],this.defaultActions[H]?G=this.defaultActions[H]:((B===null||typeof B>"u")&&(B=V()),G=E[H]&&E[H][B]),typeof G>"u"||!G.length||!G[0]){var re="";Z=[];for(q in E[H])this.terminals_[q]&&q>P&&Z.push("'"+this.terminals_[q]+"'");I.showPosition?re="Parse error on line "+(R+1)+`: `+I.showPosition()+` Expecting `+Z.join(", ")+", got '"+(this.terminals_[B]||B)+"'":re="Parse error on line "+(R+1)+": Unexpected "+(B==N?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(re,{text:I.match,token:this.terminals_[B]||B,line:I.yylineno,loc:D,expected:Z})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+B);switch(G[0]){case 1:T.push(B),S.push(I.yytext),k.push(I.yylloc),T.push(G[1]),B=null,_=I.yyleng,A=I.yytext,R=I.yylineno,D=I.yylloc;break;case 2:if(oe=this.productions_[G[1]][1],K.$=S[S.length-oe],K._$={first_line:k[k.length-(oe||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(oe||1)].first_column,last_column:k[k.length-1].last_column},F&&(K._$.range=[k[k.length-(oe||1)].range[0],k[k.length-1].range[1]]),W=this.performAction.apply(K,[A,_,R,$.yy,G[1],S,k].concat(L)),typeof W<"u")return W;oe&&(T=T.slice(0,-1*oe*2),S=S.slice(0,-1*oe),k=k.slice(0,-1*oe)),T.push(this.productions_[G[1]][0]),S.push(K.$),k.push(K._$),Q=E[T[T.length-2]][T[T.length-1]],T.push(Q);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:w(function(b,T){if(this.yy.parser)this.yy.parser.parseError(b,T);else throw new Error(b)},"parseError"),setInput:w(function(x,b){return this.yy=b||this.yy||{},this._input=x,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 x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var b=x.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:w(function(x){var b=x.length,T=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1&&(this.yylineno-=T.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:T?(T.length===C.length?this.yylloc.first_column:0)+C[C.length-T.length].length-T[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more: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(x){this.unput(this.match.slice(x))},"less"),pastInput:w(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var x=this.pastInput(),b=new Array(x.length+1).join("-");return x+this.upcomingInput()+` `+b+"^"},"showPosition"),test_match:w(function(x,b){var T,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=x[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+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],T=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var k in S)this[k]=S[k];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,b,T,C;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),k=0;kb[0].length)){if(b=T,C=k,this.options.backtrack_lexer){if(x=this.test_match(T,S[k]),x!==!1)return x;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(x=this.test_match(b,S[C]),x!==!1?x:!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 b=this.next();return b||this.lex()},"lex"),begin:w(function(b){this.conditionStack.push(b)},"begin"),popState:w(function(){var b=this.conditionStack.length-1;return b>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(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:w(function(b){this.begin(b)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(b,T,C,S){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return w(y,"Parser"),y.prototype=g,g.Parser=y,new y})();zj.parser=zj;var _2r=zj,ET,L2r=(ET=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,Ri()}getRoot(){return this.root}addNode(e,r){const n=Vt.sanitizeText(r,Ve());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],Ji(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const s=this.stack[this.stack.length-1].node,a={text:n,children:[]};s.children.push(a),this.stack.push({level:i,node:a})}getAccTitle(){return ts()}setAccTitle(e){Hi(e)}getAccDescription(){return ns()}setAccDescription(e){rs(e)}getDiagramTitle(){return qi()}setDiagramTitle(e){Ji(e)}},w(ET,"IshikawaDB"),ET),I2r=14,c2=250,N2r=30,D2r=60,O2r=5,fYe=82*Math.PI/180,Nye=Math.cos(fYe),Dye=Math.sin(fYe),Oye=w((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,s=n.height+e*2;Fs(t,s,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${s}`)},"applyPaddedViewBox"),P2r=w((t,e,r,n)=>{var $,O;const s=n.db.getRoot();if(!s)return;const a=Ve(),{look:o,handDrawnSeed:l,themeVariables:u}=a,h=B0(a.fontSize)[0]??I2r,d=o==="handDrawn",f=s.children??[],p=(($=a.ishikawa)==null?void 0:$.diagramPadding)??20,g=((O=a.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=Xo(e),y=m.append("g").attr("class","ishikawa"),v=d?dr.svg(m.node()):void 0,x=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let T=0,C=c2;const S=d?void 0:Ub(y,T,C,T,C,"ishikawa-spine");if($2r(y,T,C,s.text,h,x),!f.length){d&&Ub(y,T,C,T,C,"ishikawa-spine",x),Oye(m,p,g);return}T-=20;const k=f.filter((D,F)=>F%2===0),E=f.filter((D,F)=>F%2===1),A=Pye(k),R=Pye(E),_=A.total+R.total;let P=c2,N=c2;if(_>0){const D=c2*2,F=c2*.3;P=Math.max(F,D*(A.total/_)),N=Math.max(F,D*(R.total/_))}const L=h*2;P=Math.max(P,A.max*L),N=Math.max(N,R.max*L),C=Math.max(P,c2),S&&S.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const I=Math.ceil(f.length/2);for(let D=0;DMath.min(z,V.getBBox().x),1/0)}if(d)Ub(y,T,C,0,C,"ishikawa-spine",x);else{S.attr("x1",T);const D=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",D)}Oye(m,p,g)},"draw"),Pye=w(t=>{const e=w(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),$2r=w((t,e,r,n,i,s)=>{const a=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=UI(o,pYe(n,a),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(s){const p=s.roughSvg.path(f,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),B2r=w((t,e)=>{const r=[],n=[],i=w((s,a,o)=>{const l=e===-1?[...s].reverse():s;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:pYe(u.text,15),parentIndex:a,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),F2r=w((t,e,r,n,i,s,a)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=UI(o,e,r,n+11*i,"ishikawa-label cause","middle",s).node().getBBox();if(a){const h=a.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),kV=w((t,e,r,n,i,s)=>{const a=Math.sqrt(n*n+i*i);if(a===0)return;const o=n/a,l=i/a,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=s.roughSvg.path(g,{roughness:1,seed:s.seed,fill:s.lineColor,fillStyle:"solid",stroke:s.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),z2r=w((t,e,r,n,i,s,a,o)=>{const l=e.children??[],u=s*(l.length?1:.2),h=-Nye*u,d=Dye*u*i,f=r+h,p=n+d;if(Ub(t,r,n,f,p,"ishikawa-branch",o),o&&kV(t,r,n,r-f,n-p,o),F2r(t,e.text,f,p,i,a,o),!l.length)return;const{entries:g,yOrder:m}=B2r(l,i),y=g.length,v=new Array(y);for(const[S,k]of m.entries())v[k]=n+d*((S+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-Nye,T=Dye*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,k]of g.entries()){const E=v[S],A=x.get(k.parentIndex),R=t.append("g").attr("class","ishikawa-sub-group");let _=0,P=0,N=0;if(k.depth%2===0){const L=A.y1-A.y0;_=$ye(A.x0,A.x1,L?(E-A.y0)/L:.5),P=E,N=_-(k.childCount>0?D2r+k.childCount*O2r:N2r),Ub(R,_,E,N,E,"ishikawa-sub-branch",o),o&&kV(R,_,E,1,0,o),UI(R,k.text,N,E,"ishikawa-label align","end",a)}else{const L=A.childrenDrawn++;_=$ye(A.x0,A.x1,(A.childCount-L)/(A.childCount+1)),P=A.y0,N=_+b*((E-P)/T),Ub(R,_,P,N,E,"ishikawa-sub-branch",o),o&&kV(R,_,P,_-N,P-E,o),UI(R,k.text,N,E,C,"end",a)}k.childCount>0&&x.set(S,{x0:_,y0:P,x1:N,y1:E,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),V2r=w(t=>t.split(/|\n/),"splitLines"),pYe=w((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),UI=w((t,e,r,n,i,s,a)=>{const o=V2r(e),l=a*1.05,u=t.append("text").attr("class",i).attr("text-anchor",s).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),$ye=w((t,e,r)=>t+(e-t)*r,"lerp"),Ub=w((t,e,r,n,i,s,a)=>{if(a){const o=a.roughSvg.line(e,r,n,i,{roughness:1.5,seed:a.seed,stroke:a.lineColor,strokeWidth:2});t.append(()=>o).attr("class",s);return}return t.append("line").attr("class",s).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),H2r={draw:P2r},G2r=w(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var b=this.next();return b||this.lex()},"lex"),begin:w(function(b){this.conditionStack.push(b)},"begin"),popState:w(function(){var b=this.conditionStack.length-1;return b>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(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:w(function(b){this.begin(b)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(b,T,C,S){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return w(y,"Parser"),y.prototype=g,g.Parser=y,new y})();Wj.parser=Wj;var U2r=Wj,MT,Y2r=(MT=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,Ri()}getRoot(){return this.root}addNode(e,r){const n=Vt.sanitizeText(r,Ve());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],Ji(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const s=this.stack[this.stack.length-1].node,a={text:n,children:[]};s.children.push(a),this.stack.push({level:i,node:a})}getAccTitle(){return ts()}setAccTitle(e){Hi(e)}getAccDescription(){return ns()}setAccDescription(e){rs(e)}getDiagramTitle(){return qi()}setDiagramTitle(e){Ji(e)}},w(MT,"IshikawaDB"),MT),j2r=14,h2=250,X2r=30,K2r=60,Z2r=5,bYe=82*Math.PI/180,Fye=Math.cos(bYe),zye=Math.sin(bYe),Vye=w((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,s=n.height+e*2;Fs(t,s,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${s}`)},"applyPaddedViewBox"),Q2r=w((t,e,r,n)=>{var $,O;const s=n.db.getRoot();if(!s)return;const a=Ve(),{look:o,handDrawnSeed:l,themeVariables:u}=a,h=H0(a.fontSize)[0]??j2r,d=o==="handDrawn",f=s.children??[],p=(($=a.ishikawa)==null?void 0:$.diagramPadding)??20,g=((O=a.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=Xo(e),y=m.append("g").attr("class","ishikawa"),v=d?dr.svg(m.node()):void 0,x=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let T=0,C=h2;const S=d?void 0:jb(y,T,C,T,C,"ishikawa-spine");if(J2r(y,T,C,s.text,h,x),!f.length){d&&jb(y,T,C,T,C,"ishikawa-spine",x),Vye(m,p,g);return}T-=20;const k=f.filter((D,F)=>F%2===0),E=f.filter((D,F)=>F%2===1),A=Hye(k),R=Hye(E),_=A.total+R.total;let P=h2,N=h2;if(_>0){const D=h2*2,F=h2*.3;P=Math.max(F,D*(A.total/_)),N=Math.max(F,D*(R.total/_))}const L=h*2;P=Math.max(P,A.max*L),N=Math.max(N,R.max*L),C=Math.max(P,h2),S&&S.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const I=Math.ceil(f.length/2);for(let D=0;DMath.min(z,V.getBBox().x),1/0)}if(d)jb(y,T,C,0,C,"ishikawa-spine",x);else{S.attr("x1",T);const D=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",D)}Vye(m,p,g)},"draw"),Hye=w(t=>{const e=w(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),J2r=w((t,e,r,n,i,s)=>{const a=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=XI(o,xYe(n,a),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(s){const p=s.roughSvg.path(f,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),ebr=w((t,e)=>{const r=[],n=[],i=w((s,a,o)=>{const l=e===-1?[...s].reverse():s;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:xYe(u.text,15),parentIndex:a,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),tbr=w((t,e,r,n,i,s,a)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=XI(o,e,r,n+11*i,"ishikawa-label cause","middle",s).node().getBBox();if(a){const h=a.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),MV=w((t,e,r,n,i,s)=>{const a=Math.sqrt(n*n+i*i);if(a===0)return;const o=n/a,l=i/a,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=s.roughSvg.path(g,{roughness:1,seed:s.seed,fill:s.lineColor,fillStyle:"solid",stroke:s.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),rbr=w((t,e,r,n,i,s,a,o)=>{const l=e.children??[],u=s*(l.length?1:.2),h=-Fye*u,d=zye*u*i,f=r+h,p=n+d;if(jb(t,r,n,f,p,"ishikawa-branch",o),o&&MV(t,r,n,r-f,n-p,o),tbr(t,e.text,f,p,i,a,o),!l.length)return;const{entries:g,yOrder:m}=ebr(l,i),y=g.length,v=new Array(y);for(const[S,k]of m.entries())v[k]=n+d*((S+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-Fye,T=zye*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,k]of g.entries()){const E=v[S],A=x.get(k.parentIndex),R=t.append("g").attr("class","ishikawa-sub-group");let _=0,P=0,N=0;if(k.depth%2===0){const L=A.y1-A.y0;_=Gye(A.x0,A.x1,L?(E-A.y0)/L:.5),P=E,N=_-(k.childCount>0?K2r+k.childCount*Z2r:X2r),jb(R,_,E,N,E,"ishikawa-sub-branch",o),o&&MV(R,_,E,1,0,o),XI(R,k.text,N,E,"ishikawa-label align","end",a)}else{const L=A.childrenDrawn++;_=Gye(A.x0,A.x1,(A.childCount-L)/(A.childCount+1)),P=A.y0,N=_+b*((E-P)/T),jb(R,_,P,N,E,"ishikawa-sub-branch",o),o&&MV(R,_,P,_-N,P-E,o),XI(R,k.text,N,E,C,"end",a)}k.childCount>0&&x.set(S,{x0:_,y0:P,x1:N,y1:E,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),nbr=w(t=>t.split(/|\n/),"splitLines"),xYe=w((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),XI=w((t,e,r,n,i,s,a)=>{const o=nbr(e),l=a*1.05,u=t.append("text").attr("class",i).attr("text-anchor",s).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),Gye=w((t,e,r)=>t+(e-t)*r,"lerp"),jb=w((t,e,r,n,i,s,a)=>{if(a){const o=a.roughSvg.line(e,r,n,i,{roughness:1.5,seed:a.seed,stroke:a.lineColor,strokeWidth:2});t.append(()=>o).attr("class",s);return}return t.append("line").attr("class",s).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),ibr={draw:Q2r},sbr=w(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -5516,18 +5523,18 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[B]||B)+"'":re="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),W2r=G2r,q2r={parser:_2r,get db(){return new L2r},renderer:H2r,styles:W2r};const U2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:q2r},Symbol.toStringTag,{value:"Module"})),gYe=1e-10;function OP(t,e){const r=j2r(t),n=r.filter(o=>Y2r(o,t));let i=0,s=0;const a=[];if(n.length>1){const o=yYe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(a.push(f),i+=Vj(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=s=0:(i=o.radius*o.radius*Math.PI,a.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-gYe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return s/=2,e&&(e.area=i+s,e.arcArea=i,e.polygonArea=s,e.arcs=a,e.innerPoints=n,e.intersectionPoints=r),i+s}function Y2r(t,e){return e.every(r=>hc(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return Vj(t,n)+Vj(e,i)}function mYe(t,e){const r=hc(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const s=(n*n-i*i+r*r)/(2*r),a=Math.sqrt(n*n-s*s),o=t.x+s*(e.x-t.x)/r,l=t.y+s*(e.y-t.y)/r,u=-(e.y-t.y)*(a/r),h=-(e.x-t.x)*(a/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function yYe(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function X2r(t,e,r,n){n=n||{};const i=n.maxIterations||100,s=n.tolerance||1e-10,a=t(e),o=t(r);let l=r-e;if(a*o>0)throw"Initial bisect points must have opposite signs";if(a===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)Hj(e))}function Yb(t,e){let r=0;for(let n=0;nC.fx-S.fx,v=e.slice(),x=e.slice(),b=e.slice(),T=e.slice();for(let C=0;C{const A=E.slice();return A.fx=E.fx,A.id=E.id,A});k.sort((E,A)=>E.id-A.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k=g[p-1].fx){let k=!1;if(x.fx>S.fx?(If(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let E=1;Eo+s*i*l||u>=y)m=i;else{if(Math.abs(d)<=-a*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(If(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Yb(n.fxprime,e),u>o+s*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-a*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Z2r(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const s=e.slice();let a,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),Wj(a,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fXne(t,e,n)-r,0,t+e)}function Q2r(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:os.sets.length===2).forEach(s=>{const a=r[s.sets[0]],o=r[s.sets[1]],l=Math.sqrt(e[a].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=qj(l,u,s.size);n[a][o]=n[o][a]=h;let d=0;s.size+1e-10>=Math.min(e[a].size,e[o].size)?d=1:s.size<=1e-10&&(d=-1),i[a][o]=i[o][a]=d}),{distances:n,constraints:i}}function ebr(t,e,r,n){for(let s=0;s0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*s]+=4*m*(a-u),e[2*s+1]+=4*m*(o-h),e[2*l]+=4*m*(u-a),e[2*l+1]+=4*m*(h-o))}}return i}function tbr(t,e={}){let r=nbr(t,e);const n=e.lossFunction||q5;if(t.length>=8){const i=rbr(t,e),s=n(i,t),a=n(r,t);s+1e-8f.map(p=>p/o));const l=(f,p)=>ebr(f,p,s,a);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+xYe>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const s=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[a]));const s=n.weight!=null?n.weight:1;r+=s*(i-n.size)*(i-n.size)}return r}function wYe(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=Xne(o.radius,l.radius,hc(o,l))}else i=OP(n.sets.map(o=>t[o]));const s=n.weight!=null?n.weight:1,a=Math.log((i+1)/(n.size+1));r+=s*a*a}return r}function ibr(t,e,r){if(r==null?t.sort((i,s)=>s.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,s=t[0].y;for(const a of t)a.x-=i,a.y-=s}if(t.length===2&&hc(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(i),a=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=s*l-a*u,o.y=a*l+s*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const s=t[1].y/(1e-10+t[1].x);for(const a of t){var n=(a.x+s*a.y)/(1+s*s);a.x=2*n-a.x,a.y=2*n*s-a.y}}}}function sbr(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,s){const a=e(i),o=e(s);a.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function Uj(t){const e=r=>{const n=t.reduce((s,a)=>Math.max(s,a[r]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((s,a)=>Math.min(s,a[r]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function TYe(t,e,r){e==null&&(e=Math.PI/2);let n=SYe(t).map(u=>Object.assign({},u));const i=sbr(n);for(const u of i){ibr(u,e,r);const h=Uj(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let s=n.bounds;const a=(s.xRange.max-s.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=s.xRange.max-f.xRange.min+a;else{p=s.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(s.xRange.max-s.xRange.min)/2;m<0&&(p+=m)}if(d)g=s.yRange.max-f.yRange.min+a;else{g=s.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(s.yRange.max-s.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-a.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function kYe(t){const e={};for(const r of t)e[r.setid]=r;return e}function SYe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function abr(t={}){let e=!1,r=600,n=350,i=15,s=1e3,a=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],x=0,b=function(k){if(k in y)return y[k];var E=y[k]=v[x];return x+=1,x>=v.length&&(x=0),E},T=bYe,C=q5;function S(k){let E=k.datum();const A=new Set;E.forEach(q=>{q.size==0&&q.sets.length==1&&A.add(q.sets[0])}),E=E.filter(q=>!q.sets.some(oe=>A.has(oe)));let R={},_={};if(E.length>0){let q=T(E,{lossFunction:C,distinct:p});o&&(q=TYe(q,a,f)),R=CYe(q,r,n,i,l),_=AYe(R,E,m)}const P={};E.forEach(q=>{q.label&&(P[q.sets]=q.label)});function N(q){if(q.sets in P)return P[q.sets];if(q.sets.length==1)return""+q.sets[0]}k.selectAll("svg").data([R]).enter().append("svg");const L=k.select("svg");e?L.attr("viewBox",`0 0 ${r} ${n}`):L.attr("width",r).attr("height",n);const I={};let $=!1;L.selectAll(".venn-area path").each(function(q){const oe=this.getAttribute("d");q.sets.length==1&&oe&&!p&&($=!0,I[q.sets[0]]=cbr(oe))});function O(q){return oe=>{const Q=q.sets.map(Z=>{let re=I[Z],ie=R[Z];return re||(re={x:r/2,y:n/2,radius:1}),ie||(ie={x:r/2,y:n/2,radius:1}),{x:re.x*(1-oe)+ie.x*oe,y:re.y*(1-oe)+ie.y*oe,radius:re.radius*(1-oe)+ie.radius*oe}});return Fye(Q,g)}}const D=L.selectAll(".venn-area").data(E,q=>q.sets),F=D.enter().append("g").attr("class",q=>`venn-area venn-${q.sets.length==1?"circle":"intersection"}${q.colour||q.color?" venn-coloured":""}`).attr("data-venn-sets",q=>q.sets.join("_")),z=F.append("path"),V=F.append("text").attr("class","label").text(q=>N(q)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(q=>q.sets.length==1).style("fill",q=>q.colour?q.colour:q.color?q.color:b(q.sets)).style("fill-opacity",".25"),V.style("fill",q=>q.colour||q.color?"#FFF":t.textFill?t.textFill:q.sets.length==1?b(q.sets):"#444"));function B(q){return typeof q.transition=="function"?q.transition("venn").duration(s):q}let H=k;$&&typeof H.transition=="function"?(H=B(k),H.selectAll("path").attrTween("d",O)):H.selectAll("path").attr("d",q=>Fye(q.sets.map(oe=>R[oe])),g);const G=H.selectAll("text").filter(q=>q.sets in _).text(q=>N(q)).attr("x",q=>Math.floor(_[q.sets].x)).attr("y",q=>Math.floor(_[q.sets].y));u&&($?"on"in G?G.on("end",SV(R,N)):G.each("end",SV(R,N)):G.each(SV(R,N)));const W=B(D.exit()).remove();typeof D.transition=="function"&&W.selectAll("path").attrTween("d",O);const K=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),G.style("font-size",d),K.style("font-size","0px")),{circles:R,textCentres:_,nodes:D,enter:F,update:H,exit:W}}return S.wrap=function(k){return arguments.length?(u=k,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(k){return arguments.length?(r=k,S):r},S.height=function(k){return arguments.length?(n=k,S):n},S.padding=function(k){return arguments.length?(i=k,S):i},S.distinct=function(k){return arguments.length?(p=k,S):p},S.colours=function(k){return arguments.length?(b=k,S):b},S.colors=function(k){return arguments.length?(b=k,S):b},S.fontSize=function(k){return arguments.length?(d=k,S):d},S.round=function(k){return arguments.length?(g=k,S):g},S.duration=function(k){return arguments.length?(s=k,S):s},S.layoutFunction=function(k){return arguments.length?(T=k,S):T},S.normalize=function(k){return arguments.length?(o=k,S):o},S.scaleToFit=function(k){return arguments.length?(l=k,S):l},S.styled=function(k){return arguments.length?(h=k,S):h},S.orientation=function(k){return arguments.length?(a=k,S):a},S.orientationOrder=function(k){return arguments.length?(f=k,S):f},S.lossFunction=function(k){return arguments.length?(C=k==="default"?q5:k==="logRatio"?wYe:k,S):C},S}function SV(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,s=e(r)||"",a=s.split(/\s+/).reverse(),l=(s.length+a.length)/3;let u=a.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const T=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return T.textContent=b,p.push(T),n.append(T),T}let m=g(u);for(;u=a.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),x=n.getAttribute("y");p.forEach((b,T)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+T*f}em`)})}}function EV(t,e,r){let n=e[0].radius-hc(e[0],t);for(let i=1;i=s&&(i=n[h],s=d)}const a=vYe(h=>-1*EV({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:a[0],y:a[1]};let l=!0;for(const h of t)if(hc(o,h)>h.radius){l=!1;break}for(const h of e)if(hc(o,h)h.p1))}function obr(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+a+" not represented on screen")}return n}function lbr(t,e,r){const n=[];return n.push(` +`,"getStyles"),abr=sbr,obr={parser:U2r,get db(){return new Y2r},renderer:ibr,styles:abr};const lbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:obr},Symbol.toStringTag,{value:"Module"})),wYe=1e-10;function BP(t,e){const r=ubr(t),n=r.filter(o=>cbr(o,t));let i=0,s=0;const a=[];if(n.length>1){const o=CYe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(a.push(f),i+=qj(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=s=0:(i=o.radius*o.radius*Math.PI,a.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-wYe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return s/=2,e&&(e.area=i+s,e.arcArea=i,e.polygonArea=s,e.arcs=a,e.innerPoints=n,e.intersectionPoints=r),i+s}function cbr(t,e){return e.every(r=>pc(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return qj(t,n)+qj(e,i)}function TYe(t,e){const r=pc(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const s=(n*n-i*i+r*r)/(2*r),a=Math.sqrt(n*n-s*s),o=t.x+s*(e.x-t.x)/r,l=t.y+s*(e.y-t.y)/r,u=-(e.y-t.y)*(a/r),h=-(e.x-t.x)*(a/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function CYe(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function hbr(t,e,r,n){n=n||{};const i=n.maxIterations||100,s=n.tolerance||1e-10,a=t(e),o=t(r);let l=r-e;if(a*o>0)throw"Initial bisect points must have opposite signs";if(a===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)Uj(e))}function Xb(t,e){let r=0;for(let n=0;nC.fx-S.fx,v=e.slice(),x=e.slice(),b=e.slice(),T=e.slice();for(let C=0;C{const A=E.slice();return A.fx=E.fx,A.id=E.id,A});k.sort((E,A)=>E.id-A.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k=g[p-1].fx){let k=!1;if(x.fx>S.fx?(Of(b,1+h,v,-h,S),b.fx=t(b),b.fx=1)break;for(let E=1;Eo+s*i*l||u>=y)m=i;else{if(Math.abs(d)<=-a*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Of(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Xb(n.fxprime,e),u>o+s*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-a*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function fbr(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const s=e.slice();let a,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),jj(a,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fJne(t,e,n)-r,0,t+e)}function pbr(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:os.sets.length===2).forEach(s=>{const a=r[s.sets[0]],o=r[s.sets[1]],l=Math.sqrt(e[a].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=Xj(l,u,s.size);n[a][o]=n[o][a]=h;let d=0;s.size+1e-10>=Math.min(e[a].size,e[o].size)?d=1:s.size<=1e-10&&(d=-1),i[a][o]=i[o][a]=d}),{distances:n,constraints:i}}function mbr(t,e,r,n){for(let s=0;s0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*s]+=4*m*(a-u),e[2*s+1]+=4*m*(o-h),e[2*l]+=4*m*(u-a),e[2*l+1]+=4*m*(h-o))}}return i}function ybr(t,e={}){let r=bbr(t,e);const n=e.lossFunction||j5;if(t.length>=8){const i=vbr(t,e),s=n(i,t),a=n(r,t);s+1e-8f.map(p=>p/o));const l=(f,p)=>mbr(f,p,s,a);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+EYe>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const s=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[a]));const s=n.weight!=null?n.weight:1;r+=s*(i-n.size)*(i-n.size)}return r}function AYe(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=Jne(o.radius,l.radius,pc(o,l))}else i=BP(n.sets.map(o=>t[o]));const s=n.weight!=null?n.weight:1,a=Math.log((i+1)/(n.size+1));r+=s*a*a}return r}function xbr(t,e,r){if(r==null?t.sort((i,s)=>s.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,s=t[0].y;for(const a of t)a.x-=i,a.y-=s}if(t.length===2&&pc(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(i),a=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=s*l-a*u,o.y=a*l+s*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const s=t[1].y/(1e-10+t[1].x);for(const a of t){var n=(a.x+s*a.y)/(1+s*s);a.x=2*n-a.x,a.y=2*n*s-a.y}}}}function wbr(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,s){const a=e(i),o=e(s);a.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function Kj(t){const e=r=>{const n=t.reduce((s,a)=>Math.max(s,a[r]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((s,a)=>Math.min(s,a[r]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function MYe(t,e,r){e==null&&(e=Math.PI/2);let n=LYe(t).map(u=>Object.assign({},u));const i=wbr(n);for(const u of i){xbr(u,e,r);const h=Kj(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let s=n.bounds;const a=(s.xRange.max-s.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=s.xRange.max-f.xRange.min+a;else{p=s.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(s.xRange.max-s.xRange.min)/2;m<0&&(p+=m)}if(d)g=s.yRange.max-f.yRange.min+a;else{g=s.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(s.yRange.max-s.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-a.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function _Ye(t){const e={};for(const r of t)e[r.setid]=r;return e}function LYe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function Tbr(t={}){let e=!1,r=600,n=350,i=15,s=1e3,a=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],x=0,b=function(k){if(k in y)return y[k];var E=y[k]=v[x];return x+=1,x>=v.length&&(x=0),E},T=SYe,C=j5;function S(k){let E=k.datum();const A=new Set;E.forEach(q=>{q.size==0&&q.sets.length==1&&A.add(q.sets[0])}),E=E.filter(q=>!q.sets.some(oe=>A.has(oe)));let R={},_={};if(E.length>0){let q=T(E,{lossFunction:C,distinct:p});o&&(q=MYe(q,a,f)),R=RYe(q,r,n,i,l),_=NYe(R,E,m)}const P={};E.forEach(q=>{q.label&&(P[q.sets]=q.label)});function N(q){if(q.sets in P)return P[q.sets];if(q.sets.length==1)return""+q.sets[0]}k.selectAll("svg").data([R]).enter().append("svg");const L=k.select("svg");e?L.attr("viewBox",`0 0 ${r} ${n}`):L.attr("width",r).attr("height",n);const I={};let $=!1;L.selectAll(".venn-area path").each(function(q){const oe=this.getAttribute("d");q.sets.length==1&&oe&&!p&&($=!0,I[q.sets[0]]=Sbr(oe))});function O(q){return oe=>{const Q=q.sets.map(Z=>{let re=I[Z],ie=R[Z];return re||(re={x:r/2,y:n/2,radius:1}),ie||(ie={x:r/2,y:n/2,radius:1}),{x:re.x*(1-oe)+ie.x*oe,y:re.y*(1-oe)+ie.y*oe,radius:re.radius*(1-oe)+ie.radius*oe}});return qye(Q,g)}}const D=L.selectAll(".venn-area").data(E,q=>q.sets),F=D.enter().append("g").attr("class",q=>`venn-area venn-${q.sets.length==1?"circle":"intersection"}${q.colour||q.color?" venn-coloured":""}`).attr("data-venn-sets",q=>q.sets.join("_")),z=F.append("path"),V=F.append("text").attr("class","label").text(q=>N(q)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(q=>q.sets.length==1).style("fill",q=>q.colour?q.colour:q.color?q.color:b(q.sets)).style("fill-opacity",".25"),V.style("fill",q=>q.colour||q.color?"#FFF":t.textFill?t.textFill:q.sets.length==1?b(q.sets):"#444"));function B(q){return typeof q.transition=="function"?q.transition("venn").duration(s):q}let H=k;$&&typeof H.transition=="function"?(H=B(k),H.selectAll("path").attrTween("d",O)):H.selectAll("path").attr("d",q=>qye(q.sets.map(oe=>R[oe])),g);const G=H.selectAll("text").filter(q=>q.sets in _).text(q=>N(q)).attr("x",q=>Math.floor(_[q.sets].x)).attr("y",q=>Math.floor(_[q.sets].y));u&&($?"on"in G?G.on("end",RV(R,N)):G.each("end",RV(R,N)):G.each(RV(R,N)));const W=B(D.exit()).remove();typeof D.transition=="function"&&W.selectAll("path").attrTween("d",O);const K=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),G.style("font-size",d),K.style("font-size","0px")),{circles:R,textCentres:_,nodes:D,enter:F,update:H,exit:W}}return S.wrap=function(k){return arguments.length?(u=k,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(k){return arguments.length?(r=k,S):r},S.height=function(k){return arguments.length?(n=k,S):n},S.padding=function(k){return arguments.length?(i=k,S):i},S.distinct=function(k){return arguments.length?(p=k,S):p},S.colours=function(k){return arguments.length?(b=k,S):b},S.colors=function(k){return arguments.length?(b=k,S):b},S.fontSize=function(k){return arguments.length?(d=k,S):d},S.round=function(k){return arguments.length?(g=k,S):g},S.duration=function(k){return arguments.length?(s=k,S):s},S.layoutFunction=function(k){return arguments.length?(T=k,S):T},S.normalize=function(k){return arguments.length?(o=k,S):o},S.scaleToFit=function(k){return arguments.length?(l=k,S):l},S.styled=function(k){return arguments.length?(h=k,S):h},S.orientation=function(k){return arguments.length?(a=k,S):a},S.orientationOrder=function(k){return arguments.length?(f=k,S):f},S.lossFunction=function(k){return arguments.length?(C=k==="default"?j5:k==="logRatio"?AYe:k,S):C},S}function RV(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,s=e(r)||"",a=s.split(/\s+/).reverse(),l=(s.length+a.length)/3;let u=a.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const T=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return T.textContent=b,p.push(T),n.append(T),T}let m=g(u);for(;u=a.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),x=n.getAttribute("y");p.forEach((b,T)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+T*f}em`)})}}function _V(t,e,r){let n=e[0].radius-pc(e[0],t);for(let i=1;i=s&&(i=n[h],s=d)}const a=kYe(h=>-1*_V({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:a[0],y:a[1]};let l=!0;for(const h of t)if(pc(o,h)>h.radius){l=!1;break}for(const h of e)if(pc(o,h)h.p1))}function Cbr(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+a+" not represented on screen")}return n}function kbr(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` -a`,r,r,0,1,0,-r*2,0),n.join(" ")}function cbr(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function MYe(t){if(t.length===0)return[];const e={};return OP(t,e),e.arcs}function RYe(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?s=>Math.round(s*r)/r:s=>s;if(t.length==1){const s=t[0].circle;return lbr(n(s.x),n(s.y),n(s.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function Sbr(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function DYe(t){if(t.length===0)return[];const e={};return BP(t,e),e.arcs}function OYe(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?s=>Math.round(s*r)/r:s=>s;if(t.length==1){const s=t[0].circle;return kbr(n(s.x),n(s.y),n(s.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const s of t){const a=n(s.circle.radius);i.push(` -A`,a,a,0,s.large?1:0,s.sweep?1:0,n(s.p1.x),n(s.p1.y))}return i.join(" ")}function Fye(t,e){return RYe(MYe(t),e)}function ubr(t,e={}){const{lossFunction:r,layoutFunction:n=bYe,normalize:i=!0,orientation:s=Math.PI/2,orientationOrder:a,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?q5:r==="logRatio"?wYe:r,distinct:f});i&&(g=TYe(g,s,a));const m=CYe(g,o,l,u,h),y=AYe(m,t,d),v=new Map(Object.keys(m).map(T=>[T,{set:T,x:m[T].x,y:m[T].y,radius:m[T].radius}])),x=t.map(T=>{const C=T.sets.map(E=>v.get(E)),S=MYe(C),k=RYe(S,p);return{circles:C,arcs:S,path:k,area:T,has:new Set(T.sets)}});function b(T){let C="";for(const S of x)S.has.size>T.length&&T.every(k=>S.has.has(k))&&(C+=" "+S.path);return C}return x.map(({circles:T,arcs:C,path:S,area:k})=>({data:k,text:y[k.sets],circles:T,arcs:C,path:S,distinctPath:S+b(k.sets)}))}var Yj=(function(){var t=w(function(x,b,T,C){for(T=T||{},C=x.length;C--;T[x[C]]=b);return T},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],s=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace: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(b,T,C,S,k,E,A){var R=E.length-1;switch(k){case 1:return E[R-1];case 2:case 3:case 4:this.$=[];break;case 5:E[R-1].push(E[R]),this.$=E[R-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[R];break;case 8:S.setDiagramTitle(E[R].substr(6)),this.$=E[R].substr(6);break;case 9:S.addSubsetData([E[R]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([E[R-1]],E[R],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([E[R-2]],void 0,parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([E[R-3]],E[R-2],parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(E[R].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R]),S.addSubsetData(E[R],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(E[R-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R-1]),S.addSubsetData(E[R-1],E[R],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(E[R-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R-2]),S.addSubsetData(E[R-2],void 0,parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(E[R-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R-3]),S.addSubsetData(E[R-3],E[R-2],parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(E[R-1],E[R],void 0);break;case 20:case 21:S.addTextData(E[R-2],E[R-1],E[R]);break;case 23:S.addStyleData(E[R-1],E[R]);break;case 24:case 25:case 26:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,E[R],void 0);break;case 27:case 28:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,E[R-1],E[R]);break;case 29:case 41:this.$=[E[R]];break;case 30:case 42:this.$=[...E[R-2],E[R]];break;case 31:this.$=[E[R-2],E[R]];break;case 33:this.$=E[R].join(" ");break;case 34:this.$=[E[R]];break;case 35:E[R-1].push(E[R]),this.$=E[R-1];break;case 43:case 44:this.$=E[R];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(s,[2,43]),t(s,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:a}),t(s,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:a},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(s,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(b,T){if(T.recoverable)this.trace(b);else{var C=new Error(b);throw C.hash=T,C}},"parseError"),parse:w(function(b){var T=this,C=[0],S=[],k=[null],E=[],A=this.table,R="",_=0,P=0,N=2,L=1,I=E.slice.call(arguments,1),$=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);$.setInput(b,O.yy),O.yy.lexer=$,O.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var F=$.yylloc;E.push(F);var z=$.options&&$.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(me){C.length=C.length-2*me,k.length=k.length-me,E.length=E.length-me}w(V,"popStack");function B(){var me;return me=S.pop()||$.lex()||L,typeof me!="number"&&(me instanceof Array&&(S=me,me=S.pop()),me=T.symbols_[me]||me),me}w(B,"lex");for(var H,G,W,K,q={},oe,Q,Z,re;;){if(G=C[C.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((H===null||typeof H>"u")&&(H=B()),W=A[G]&&A[G][H]),typeof W>"u"||!W.length||!W[0]){var ie="";re=[];for(oe in A[G])this.terminals_[oe]&&oe>N&&re.push("'"+this.terminals_[oe]+"'");$.showPosition?ie="Parse error on line "+(_+1)+`: +A`,a,a,0,s.large?1:0,s.sweep?1:0,n(s.p1.x),n(s.p1.y))}return i.join(" ")}function qye(t,e){return OYe(DYe(t),e)}function Ebr(t,e={}){const{lossFunction:r,layoutFunction:n=SYe,normalize:i=!0,orientation:s=Math.PI/2,orientationOrder:a,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?j5:r==="logRatio"?AYe:r,distinct:f});i&&(g=MYe(g,s,a));const m=RYe(g,o,l,u,h),y=NYe(m,t,d),v=new Map(Object.keys(m).map(T=>[T,{set:T,x:m[T].x,y:m[T].y,radius:m[T].radius}])),x=t.map(T=>{const C=T.sets.map(E=>v.get(E)),S=DYe(C),k=OYe(S,p);return{circles:C,arcs:S,path:k,area:T,has:new Set(T.sets)}});function b(T){let C="";for(const S of x)S.has.size>T.length&&T.every(k=>S.has.has(k))&&(C+=" "+S.path);return C}return x.map(({circles:T,arcs:C,path:S,area:k})=>({data:k,text:y[k.sets],circles:T,arcs:C,path:S,distinctPath:S+b(k.sets)}))}var Zj=(function(){var t=w(function(x,b,T,C){for(T=T||{},C=x.length;C--;T[x[C]]=b);return T},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],s=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace: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(b,T,C,S,k,E,A){var R=E.length-1;switch(k){case 1:return E[R-1];case 2:case 3:case 4:this.$=[];break;case 5:E[R-1].push(E[R]),this.$=E[R-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[R];break;case 8:S.setDiagramTitle(E[R].substr(6)),this.$=E[R].substr(6);break;case 9:S.addSubsetData([E[R]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([E[R-1]],E[R],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([E[R-2]],void 0,parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([E[R-3]],E[R-2],parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(E[R].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R]),S.addSubsetData(E[R],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(E[R-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R-1]),S.addSubsetData(E[R-1],E[R],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(E[R-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R-2]),S.addSubsetData(E[R-2],void 0,parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(E[R-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[R-3]),S.addSubsetData(E[R-3],E[R-2],parseFloat(E[R])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(E[R-1],E[R],void 0);break;case 20:case 21:S.addTextData(E[R-2],E[R-1],E[R]);break;case 23:S.addStyleData(E[R-1],E[R]);break;case 24:case 25:case 26:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,E[R],void 0);break;case 27:case 28:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,E[R-1],E[R]);break;case 29:case 41:this.$=[E[R]];break;case 30:case 42:this.$=[...E[R-2],E[R]];break;case 31:this.$=[E[R-2],E[R]];break;case 33:this.$=E[R].join(" ");break;case 34:this.$=[E[R]];break;case 35:E[R-1].push(E[R]),this.$=E[R-1];break;case 43:case 44:this.$=E[R];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(s,[2,43]),t(s,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:a}),t(s,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:a},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(s,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(b,T){if(T.recoverable)this.trace(b);else{var C=new Error(b);throw C.hash=T,C}},"parseError"),parse:w(function(b){var T=this,C=[0],S=[],k=[null],E=[],A=this.table,R="",_=0,P=0,N=2,L=1,I=E.slice.call(arguments,1),$=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);$.setInput(b,O.yy),O.yy.lexer=$,O.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var F=$.yylloc;E.push(F);var z=$.options&&$.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(me){C.length=C.length-2*me,k.length=k.length-me,E.length=E.length-me}w(V,"popStack");function B(){var me;return me=S.pop()||$.lex()||L,typeof me!="number"&&(me instanceof Array&&(S=me,me=S.pop()),me=T.symbols_[me]||me),me}w(B,"lex");for(var H,G,W,K,q={},oe,Q,Z,re;;){if(G=C[C.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((H===null||typeof H>"u")&&(H=B()),W=A[G]&&A[G][H]),typeof W>"u"||!W.length||!W[0]){var ie="";re=[];for(oe in A[G])this.terminals_[oe]&&oe>N&&re.push("'"+this.terminals_[oe]+"'");$.showPosition?ie="Parse error on line "+(_+1)+`: `+$.showPosition()+` Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error on line "+(_+1)+": Unexpected "+(H==L?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(ie,{text:$.match,token:this.terminals_[H]||H,line:$.yylineno,loc:F,expected:re})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+H);switch(W[0]){case 1:C.push(H),k.push($.yytext),E.push($.yylloc),C.push(W[1]),H=null,P=$.yyleng,R=$.yytext,_=$.yylineno,F=$.yylloc;break;case 2:if(Q=this.productions_[W[1]][1],q.$=k[k.length-Q],q._$={first_line:E[E.length-(Q||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(Q||1)].first_column,last_column:E[E.length-1].last_column},z&&(q._$.range=[E[E.length-(Q||1)].range[0],E[E.length-1].range[1]]),K=this.performAction.apply(q,[R,P,_,O.yy,W[1],k,E].concat(I)),typeof K<"u")return K;Q&&(C=C.slice(0,-1*Q*2),k=k.slice(0,-1*Q),E=E.slice(0,-1*Q)),C.push(this.productions_[W[1]][0]),k.push(q.$),E.push(q._$),Z=A[C[C.length-2]][C[C.length-1]],C.push(Z);break;case 3:return!0}}return!0},"parse")},y=(function(){var x={EOF:1,parseError:w(function(T,C){if(this.yy.parser)this.yy.parser.parseError(T,C);else throw new Error(T)},"parseError"),setInput:w(function(b,T){return this.yy=T||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var T=b.match(/(?:\r\n?|\n).*/g);return T?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:w(function(b){var T=b.length,C=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===S.length?this.yylloc.first_column:0)+S[S.length-C.length].length-C[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-T]),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(b){this.unput(this.match.slice(b))},"less"),pastInput:w(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var b=this.pastInput(),T=new Array(b.length+1).join("-");return b+this.upcomingInput()+` `+T+"^"},"showPosition"),test_match:w(function(b,T){var C,S,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),S=b[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],C=this.performAction.call(this,this.yy,this,T,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var E in k)this[E]=k[E];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,T,C,S;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;ET[0].length)){if(T=C,S=E,this.options.backtrack_lexer){if(b=this.test_match(C,k[E]),b!==!1)return b;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(b=this.test_match(T,k[S]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var T=this.next();return T||this.lex()},"lex"),begin:w(function(T){this.conditionStack.push(T)},"begin"),popState:w(function(){var T=this.conditionStack.length-1;return T>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(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:w(function(T){this.begin(T)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(T,C,S,k){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(T.getIndentMode&&T.getIndentMode())return T.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:T.setIndentMode&&T.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(T.consumeIndentText)T.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return x})();m.lexer=y;function v(){this.yy={}}return w(v,"Parser"),v.prototype=m,m.Parser=v,new v})();Yj.parser=Yj;var hbr=Yj,Kne=[],Zne=[],Qne=[],Jne=new Set,eie,tie=!1,dbr=w((t,e,r)=>{const n=PP(t).sort(),i=r??10/Math.pow(t.length,2);eie=n,n.length===1&&Jne.add(n[0]),Kne.push({sets:n,size:i,label:e?TE(e):void 0})},"addSubsetData"),fbr=w(()=>Kne,"getSubsetData"),TE=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),pbr=w(t=>t&&TE(t),"normalizeStyleValue"),gbr=w((t,e,r)=>{const n=TE(e);Zne.push({sets:PP(t).sort(),id:n,label:r?TE(r):void 0})},"addTextData"),mbr=w((t,e)=>{const r=PP(t).sort(),n={};for(const[i,s]of e)n[i]=pbr(s)??s;Qne.push({targets:r,styles:n})},"addStyleData"),ybr=w(()=>Qne,"getStyleData"),PP=w(t=>t.map(e=>TE(e)),"normalizeIdentifierList"),vbr=w(t=>{const r=PP(t).filter(n=>!Jne.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),bbr=w(()=>Zne,"getTextData"),xbr=w(()=>eie,"getCurrentSets"),wbr=w(()=>tie,"getIndentMode"),Tbr=w(t=>{tie=t},"setIndentMode"),Cbr=Sn.venn;function _Ye(){return es(Cbr,vr().venn)}w(_Ye,"getConfig");var kbr=w(()=>{Ri(),Kne.length=0,Zne.length=0,Qne.length=0,Jne.clear(),eie=void 0,tie=!1},"customClear"),Sbr={getConfig:_Ye,clear:kbr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,addSubsetData:dbr,getSubsetData:fbr,addTextData:gbr,addStyleData:mbr,validateUnionIdentifiers:vbr,getTextData:bbr,getStyleData:ybr,getCurrentSets:xbr,getIndentMode:wbr,setIndentMode:Tbr},Ebr=w(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var T=this.next();return T||this.lex()},"lex"),begin:w(function(T){this.conditionStack.push(T)},"begin"),popState:w(function(){var T=this.conditionStack.length-1;return T>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(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:w(function(T){this.begin(T)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(T,C,S,k){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(T.getIndentMode&&T.getIndentMode())return T.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:T.setIndentMode&&T.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(T.consumeIndentText)T.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return x})();m.lexer=y;function v(){this.yy={}}return w(v,"Parser"),v.prototype=m,m.Parser=v,new v})();Zj.parser=Zj;var Abr=Zj,eie=[],tie=[],rie=[],nie=new Set,iie,sie=!1,Mbr=w((t,e,r)=>{const n=FP(t).sort(),i=r??10/Math.pow(t.length,2);iie=n,n.length===1&&nie.add(n[0]),eie.push({sets:n,size:i,label:e?SE(e):void 0})},"addSubsetData"),Rbr=w(()=>eie,"getSubsetData"),SE=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),_br=w(t=>t&&SE(t),"normalizeStyleValue"),Lbr=w((t,e,r)=>{const n=SE(e);tie.push({sets:FP(t).sort(),id:n,label:r?SE(r):void 0})},"addTextData"),Ibr=w((t,e)=>{const r=FP(t).sort(),n={};for(const[i,s]of e)n[i]=_br(s)??s;rie.push({targets:r,styles:n})},"addStyleData"),Nbr=w(()=>rie,"getStyleData"),FP=w(t=>t.map(e=>SE(e)),"normalizeIdentifierList"),Dbr=w(t=>{const r=FP(t).filter(n=>!nie.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),Obr=w(()=>tie,"getTextData"),Pbr=w(()=>iie,"getCurrentSets"),$br=w(()=>sie,"getIndentMode"),Bbr=w(t=>{sie=t},"setIndentMode"),Fbr=Sn.venn;function PYe(){return es(Fbr,br().venn)}w(PYe,"getConfig");var zbr=w(()=>{Ri(),eie.length=0,tie.length=0,rie.length=0,nie.clear(),iie=void 0,sie=!1},"customClear"),Vbr={getConfig:PYe,clear:zbr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,addSubsetData:Mbr,getSubsetData:Rbr,addTextData:Lbr,addStyleData:Ibr,validateUnionIdentifiers:Dbr,getTextData:Obr,getStyleData:Nbr,getCurrentSets:Pbr,getIndentMode:$br,setIndentMode:Bbr},Hbr=w(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -5549,7 +5556,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),Abr=Ebr;function LYe(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}w(LYe,"buildStyleByKey");var Mbr=w((t,e,r,n)=>{var I,$,O;const i=n.db,s=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:a,look:o,handDrawnSeed:l}=vr(),u=o==="handDrawn",h=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),d=($=i.getDiagramTitle)==null?void 0:$.call(i),f=i.getSubsetData(),p=i.getTextData(),g=LYe(i.getStyleData()),m=NYe(f),y=(s==null?void 0:s.width)??800,v=(s==null?void 0:s.height)??450,b=y/1600,T=d?48*b:0,C=a.primaryTextColor??a.textColor,S=Xo(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",a.vennTitleTextColor||a.titleColor);const k=wt(document.createElement("div")),E=abr().width(y).height(v-T);k.datum(m).call(E);const A=u?dr.svg(k.select("svg").node()):void 0,R=ubr(m,{width:y,height:v-T,padding:(s==null?void 0:s.padding)??15}),_=new Map;for(const D of R){const F=Rp([...D.data.sets].sort());_.set(F,D)}p.length>0&&IYe(s,_,k,p,b,g);const P=Ol(a.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(D,F){var Q;const z=wt(this),B=Rp([...D.sets].sort()),H=g.get(B),G=(H==null?void 0:H.fill)||h[F%h.length]||a.primaryColor;z.classed(`venn-set-${F%8}`,!0);const W=(H==null?void 0:H["fill-opacity"])??.1,K=(H==null?void 0:H.stroke)||G,q=(H==null?void 0:H["stroke-width"])||`${5*b}`;if(u&&A){const Z=_.get(B);if(Z&&Z.circles.length>0){const re=Z.circles[0],ie=A.circle(re.x,re.y,re.radius*2,{roughness:.7,seed:l,fill:Doe(G,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:K,strokeWidth:parseFloat(String(q))});z.select("path").remove(),(Q=z.node())==null||Q.insertBefore(ie,z.select("text").node())}}else z.select("path").style("fill",G).style("fill-opacity",W).style("stroke",K).style("stroke-width",q).style("stroke-opacity",.95);const oe=(H==null?void 0:H.color)||(P?ct(G,30):ut(G,30));z.select("text").style("font-size",`${48*b}px`).style("fill",oe)}),u&&A?k.selectAll(".venn-intersection").each(function(D){var G;const F=wt(this),V=Rp([...D.sets].sort()),B=g.get(V),H=B==null?void 0:B.fill;if(H){const W=F.select("path"),K=W.attr("d");if(K){const q=A.path(K,{roughness:.7,seed:l,fill:Doe(H,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),oe=W.node();(G=oe==null?void 0:oe.parentNode)==null||G.insertBefore(q,oe),W.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*b}px`).style("fill",(B==null?void 0:B.color)??a.vennSetTextColor??C)}):(k.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",D=>{var V;const z=Rp([...D.sets].sort());return((V=g.get(z))==null?void 0:V.color)??a.vennSetTextColor??C}),k.selectAll(".venn-intersection path").style("fill-opacity",D=>{var V;const z=Rp([...D.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",D=>{var V;const z=Rp([...D.sets].sort());return((V=g.get(z))==null?void 0:V.fill)??"transparent"}));const N=S.append("g").attr("transform",`translate(0, ${T})`),L=k.select("svg").node();if(L&&"childNodes"in L)for(const D of[...L.childNodes])(O=N.node())==null||O.appendChild(D);Fs(S,v,y,(s==null?void 0:s.useMaxWidth)??!0)},"draw");function Rp(t){return t.join("|")}w(Rp,"stableSetsKey");function IYe(t,e,r,n,i,s){var h;const a=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Rp(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(I=>I.radius)),v=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);a&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const T=Math.max(80*i,x*2*.95),C=Math.max(60*i,x*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),A=g-T/2,R=m-C/2+E,_=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/_)),N=T/_,L=C/P;for(const[I,$]of f.entries()){const O=I%_,D=Math.floor(I/_),F=A+N*(O+.5),z=R+L*(D+.5);a&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",A+N*O).attr("y",R+L*D).attr("width",N).attr("height",L).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=N*.9,B=L*.9,H=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",B).attr("x",F-V/2).attr("y",z-B/2).attr("overflow","visible"),G=(h=s.get($.id))==null?void 0:h.color,W=H.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text($.label??$.id);G&&W.style("color",G)}}}w(IYe,"renderTextNodes");function NYe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const s=[...i.sets].sort();for(let a=0;a0?[...t,...n]:t}w(NYe,"ensurePairwiseSubsets");var Rbr={draw:Mbr},_br={parser:hbr,db:Sbr,renderer:Rbr,styles:Abr};const Lbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:_br},Symbol.toStringTag,{value:"Module"}));var AT,DYe=(AT=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Hi,this.getAccTitle=ts,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getAccDescription=ns,this.setAccDescription=rs}getNodes(){return this.nodes}getConfig(){const e=Sn,r=vr();return es({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(s=>{KK(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Ri(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(AT,"TreeMapDB"),AT);function OYe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const s=r[r.length-1].node;s.children?s.children.push(i):s.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}w(OYe,"buildHierarchy");var Ibr=w((t,e)=>{Fl(t,e);const r=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&e.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const a=s.item;if(!a)continue;const o=s.indent?parseInt(s.indent):0,l=Nbr(a),u=a.classSelector?e.getStylesForClass(a.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:a.$type,value:a.value,classSelector:a.classSelector,cssCompiledStyles:h};r.push(d)}const n=OYe(r),i=w((s,a)=>{for(const o of s)e.addNode(o,a),o.children&&o.children.length>0&&i(o.children,a+1)},"addNodesRecursively");i(n,0)},"populate"),Nbr=w(t=>t.name?String(t.name):"","getItemName"),PYe={parser:{yy:void 0},parse:w(async t=>{var e;try{const n=await $u("treemap",t);de.debug("Treemap AST:",n);const i=(e=PYe.parser)==null?void 0:e.yy;if(!(i instanceof DYe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ibr(n,i)}catch(r){throw de.error("Error parsing treemap:",r),r}},"parse")},Dbr=10,u2=10,LC=25,Obr=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),a=s.padding??Dbr,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=vr();if(!l)return;const h=o?30:0,d=Xo(e),f=s.nodeWidth?s.nodeWidth*u2:960,p=s.nodeHeight?s.nodeHeight*u2:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Fs(d,m,g,s.useMaxWidth);let y;try{const B=s.valueFormat||",";if(B==="$0,0")y=w(H=>"$"+a1(",")(H),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const H=/\.\d+/.exec(B),G=H?H[0]:"";y=w(W=>"$"+a1(","+G)(W),"valueFormat")}else if(B.startsWith("$")){const H=B.substring(1);y=w(G=>"$"+a1(H||"")(G),"valueFormat")}else y=a1(B)}catch(B){de.error("Error creating format function:",B),y=a1(",")}const v=Q1().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),x=Q1().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=Q1().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const T=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=OK(l).sum(B=>B.value??0).sort((B,H)=>(H.value??0)-(B.value??0)),k=Mbt().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?LC+u2:0).paddingInner(a).paddingLeft(B=>B.children&&B.children.length>0?u2:0).paddingRight(B=>B.children&&B.children.length>0?u2:0).paddingBottom(B=>B.children&&B.children.length>0?u2:0).round(!0)(C),E=k.descendants().filter(B=>B.children&&B.children.length>0),A=T.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",LC).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),A.append("clipPath").attr("id",(B,H)=>`clip-section-${e}-${H}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",LC),A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,H)=>`treemapSection section${H}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>x(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const H=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H.nodeStyles+";"+H.borderStyles.join(";")}),A.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",LC/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,H)=>`url(#clip-section-${e}-${H})`).attr("style",B=>{if(B.depth===0)return"display: none;";const H="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",G=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const H=wt(this),G=B.data.name;H.text(G);const W=B.x1-B.x0,K=6;let q;s.showValues!==!1&&B.value?q=W-10-30-10-K:q=W-K-6;const Q=Math.max(15,q),Z=H.node();if(Z.getComputedTextLength()>Q){let me=G;for(;me.length>0;){if(me=G.substring(0,me.length-1),me.length===0){H.text("..."),Z.getComputedTextLength()>Q&&H.text("");break}if(H.text(me+"..."),Z.getComputedTextLength()<=Q)break}}}),s.showValues!==!1&&A.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",LC/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(B=>B.value?y(B.value):"").attr("font-style","italic").attr("style",B=>{if(B.depth===0)return"display: none;";const H="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",G=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")});const R=k.leaves(),_=R.length>20,P=_?16:38,N=_?14:28,L=_?4:8,I=_?4:6,$=_?2:4,O=_?8:10,D=_?1:2,F=T.selectAll(".treemapLeafGroup").data(R).enter().append("g").attr("class",(B,H)=>`treemapNode treemapLeafGroup leaf${H}${B.data.classSelector?` ${B.data.classSelector}`:""}x`).attr("transform",B=>`translate(${B.x0},${B.y0})`);F.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class","treemapLeaf").attr("fill",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("style",B=>cr({cssCompiledStyles:B.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(B,H)=>`clip-${e}-${H}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-4)).attr("height",B=>Math.max(0,B.y1-B.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",B=>(B.x1-B.x0)/2).attr("y",B=>(B.y1-B.y0)/2).attr("style",B=>{const H=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",G=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,H)=>`url(#clip-${e}-${H})`).text(B=>B.data.name).each(function(B){const H=wt(this),G=B.x1-B.x0,W=B.y1-B.y0,K=H.node(),q=G-2*$,oe=W-2*$;if(qq&&Q>L;)Q--,H.style("font-size",`${Q}px`);let re=Math.max(I,Math.min(N,Math.round(Q*Z))),ie=Q+D+re;for(;ie>oe&&Q>L&&(Q--,re=Math.max(I,Math.min(N,Math.round(Q*Z))),!(req||Q(H.x1-H.x0)/2).attr("y",function(H){return(H.y1-H.y0)/2}).attr("style",H=>{const G=`text-anchor: middle; dominant-baseline: hanging; font-size: ${N}px;fill:`+b(H.data.name)+";",W=cr({cssCompiledStyles:H.data.cssCompiledStyles});return G+W.labelStyles.replace("color:","fill:")}).attr("clip-path",(H,G)=>`url(#clip-${e}-${G})`).text(H=>H.value?y(H.value):"").each(function(H){const G=wt(this),W=this.parentNode;if(!W){G.style("display","none");return}const K=wt(W).select(".treemapLabel");if(K.empty()||K.style("display")==="none"){G.style("display","none");return}const q=parseFloat(K.style("font-size")),Q=Math.max(I,Math.min(N,Math.round(q*.6)));G.style("font-size",`${Q}px`);const re=(H.y1-H.y0)/2+q/2+D;G.attr("y",re);const ie=H.x1-H.x0,_e=H.y1-H.y0-4,$e=ie-2*$;G.node().getComputedTextLength()>$e||re+Q>_e||Q{const e=$0(),r=vr(),n=es(e,r.themeVariables),i=es(Bbr,t),s=i.titleColor??n.titleColor,a=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),Gbr=Hbr;function $Ye(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}w($Ye,"buildStyleByKey");var Wbr=w((t,e,r,n)=>{var I,$,O;const i=n.db,s=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:a,look:o,handDrawnSeed:l}=br(),u=o==="handDrawn",h=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),d=($=i.getDiagramTitle)==null?void 0:$.call(i),f=i.getSubsetData(),p=i.getTextData(),g=$Ye(i.getStyleData()),m=FYe(f),y=(s==null?void 0:s.width)??800,v=(s==null?void 0:s.height)??450,b=y/1600,T=d?48*b:0,C=a.primaryTextColor??a.textColor,S=Xo(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",a.vennTitleTextColor||a.titleColor);const k=wt(document.createElement("div")),E=Tbr().width(y).height(v-T);k.datum(m).call(E);const A=u?dr.svg(k.select("svg").node()):void 0,R=Ebr(m,{width:y,height:v-T,padding:(s==null?void 0:s.padding)??15}),_=new Map;for(const D of R){const F=Np([...D.data.sets].sort());_.set(F,D)}p.length>0&&BYe(s,_,k,p,b,g);const P=$l(a.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(D,F){var Q;const z=wt(this),B=Np([...D.sets].sort()),H=g.get(B),G=(H==null?void 0:H.fill)||h[F%h.length]||a.primaryColor;z.classed(`venn-set-${F%8}`,!0);const W=(H==null?void 0:H["fill-opacity"])??.1,K=(H==null?void 0:H.stroke)||G,q=(H==null?void 0:H["stroke-width"])||`${5*b}`;if(u&&A){const Z=_.get(B);if(Z&&Z.circles.length>0){const re=Z.circles[0],ie=A.circle(re.x,re.y,re.radius*2,{roughness:.7,seed:l,fill:Boe(G,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:K,strokeWidth:parseFloat(String(q))});z.select("path").remove(),(Q=z.node())==null||Q.insertBefore(ie,z.select("text").node())}}else z.select("path").style("fill",G).style("fill-opacity",W).style("stroke",K).style("stroke-width",q).style("stroke-opacity",.95);const oe=(H==null?void 0:H.color)||(P?ct(G,30):ut(G,30));z.select("text").style("font-size",`${48*b}px`).style("fill",oe)}),u&&A?k.selectAll(".venn-intersection").each(function(D){var G;const F=wt(this),V=Np([...D.sets].sort()),B=g.get(V),H=B==null?void 0:B.fill;if(H){const W=F.select("path"),K=W.attr("d");if(K){const q=A.path(K,{roughness:.7,seed:l,fill:Boe(H,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),oe=W.node();(G=oe==null?void 0:oe.parentNode)==null||G.insertBefore(q,oe),W.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*b}px`).style("fill",(B==null?void 0:B.color)??a.vennSetTextColor??C)}):(k.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",D=>{var V;const z=Np([...D.sets].sort());return((V=g.get(z))==null?void 0:V.color)??a.vennSetTextColor??C}),k.selectAll(".venn-intersection path").style("fill-opacity",D=>{var V;const z=Np([...D.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",D=>{var V;const z=Np([...D.sets].sort());return((V=g.get(z))==null?void 0:V.fill)??"transparent"}));const N=S.append("g").attr("transform",`translate(0, ${T})`),L=k.select("svg").node();if(L&&"childNodes"in L)for(const D of[...L.childNodes])(O=N.node())==null||O.appendChild(D);Fs(S,v,y,(s==null?void 0:s.useMaxWidth)??!0)},"draw");function Np(t){return t.join("|")}w(Np,"stableSetsKey");function BYe(t,e,r,n,i,s){var h;const a=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Np(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(I=>I.radius)),v=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);a&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const T=Math.max(80*i,x*2*.95),C=Math.max(60*i,x*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),A=g-T/2,R=m-C/2+E,_=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/_)),N=T/_,L=C/P;for(const[I,$]of f.entries()){const O=I%_,D=Math.floor(I/_),F=A+N*(O+.5),z=R+L*(D+.5);a&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",A+N*O).attr("y",R+L*D).attr("width",N).attr("height",L).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=N*.9,B=L*.9,H=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",B).attr("x",F-V/2).attr("y",z-B/2).attr("overflow","visible"),G=(h=s.get($.id))==null?void 0:h.color,W=H.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text($.label??$.id);G&&W.style("color",G)}}}w(BYe,"renderTextNodes");function FYe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const s=[...i.sets].sort();for(let a=0;a0?[...t,...n]:t}w(FYe,"ensurePairwiseSubsets");var qbr={draw:Wbr},Ubr={parser:Abr,db:Vbr,renderer:qbr,styles:Gbr};const Ybr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ubr},Symbol.toStringTag,{value:"Module"}));var RT,zYe=(RT=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Hi,this.getAccTitle=ts,this.setDiagramTitle=Ji,this.getDiagramTitle=qi,this.getAccDescription=ns,this.setAccDescription=rs}getNodes(){return this.nodes}getConfig(){const e=Sn,r=br();return es({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(s=>{eZ(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Ri(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(RT,"TreeMapDB"),RT);function VYe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const s=r[r.length-1].node;s.children?s.children.push(i):s.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}w(VYe,"buildHierarchy");var jbr=w((t,e)=>{Vl(t,e);const r=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&e.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const a=s.item;if(!a)continue;const o=s.indent?parseInt(s.indent):0,l=Xbr(a),u=a.classSelector?e.getStylesForClass(a.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:a.$type,value:a.value,classSelector:a.classSelector,cssCompiledStyles:h};r.push(d)}const n=VYe(r),i=w((s,a)=>{for(const o of s)e.addNode(o,a),o.children&&o.children.length>0&&i(o.children,a+1)},"addNodesRecursively");i(n,0)},"populate"),Xbr=w(t=>t.name?String(t.name):"","getItemName"),HYe={parser:{yy:void 0},parse:w(async t=>{var e;try{const n=await zu("treemap",t);de.debug("Treemap AST:",n);const i=(e=HYe.parser)==null?void 0:e.yy;if(!(i instanceof zYe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");jbr(n,i)}catch(r){throw de.error("Error parsing treemap:",r),r}},"parse")},Kbr=10,d2=10,DC=25,Zbr=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),a=s.padding??Kbr,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=br();if(!l)return;const h=o?30:0,d=Xo(e),f=s.nodeWidth?s.nodeWidth*d2:960,p=s.nodeHeight?s.nodeHeight*d2:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Fs(d,m,g,s.useMaxWidth);let y;try{const B=s.valueFormat||",";if(B==="$0,0")y=w(H=>"$"+c1(",")(H),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const H=/\.\d+/.exec(B),G=H?H[0]:"";y=w(W=>"$"+c1(","+G)(W),"valueFormat")}else if(B.startsWith("$")){const H=B.substring(1);y=w(G=>"$"+c1(H||"")(G),"valueFormat")}else y=c1(B)}catch(B){de.error("Error creating format function:",B),y=c1(",")}const v=ey().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),x=ey().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=ey().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const T=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=FK(l).sum(B=>B.value??0).sort((B,H)=>(H.value??0)-(B.value??0)),k=Dbt().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?DC+d2:0).paddingInner(a).paddingLeft(B=>B.children&&B.children.length>0?d2:0).paddingRight(B=>B.children&&B.children.length>0?d2:0).paddingBottom(B=>B.children&&B.children.length>0?d2:0).round(!0)(C),E=k.descendants().filter(B=>B.children&&B.children.length>0),A=T.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",DC).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),A.append("clipPath").attr("id",(B,H)=>`clip-section-${e}-${H}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",DC),A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,H)=>`treemapSection section${H}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>x(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const H=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H.nodeStyles+";"+H.borderStyles.join(";")}),A.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",DC/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,H)=>`url(#clip-section-${e}-${H})`).attr("style",B=>{if(B.depth===0)return"display: none;";const H="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",G=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const H=wt(this),G=B.data.name;H.text(G);const W=B.x1-B.x0,K=6;let q;s.showValues!==!1&&B.value?q=W-10-30-10-K:q=W-K-6;const Q=Math.max(15,q),Z=H.node();if(Z.getComputedTextLength()>Q){let me=G;for(;me.length>0;){if(me=G.substring(0,me.length-1),me.length===0){H.text("..."),Z.getComputedTextLength()>Q&&H.text("");break}if(H.text(me+"..."),Z.getComputedTextLength()<=Q)break}}}),s.showValues!==!1&&A.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",DC/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(B=>B.value?y(B.value):"").attr("font-style","italic").attr("style",B=>{if(B.depth===0)return"display: none;";const H="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",G=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")});const R=k.leaves(),_=R.length>20,P=_?16:38,N=_?14:28,L=_?4:8,I=_?4:6,$=_?2:4,O=_?8:10,D=_?1:2,F=T.selectAll(".treemapLeafGroup").data(R).enter().append("g").attr("class",(B,H)=>`treemapNode treemapLeafGroup leaf${H}${B.data.classSelector?` ${B.data.classSelector}`:""}x`).attr("transform",B=>`translate(${B.x0},${B.y0})`);F.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class","treemapLeaf").attr("fill",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("style",B=>cr({cssCompiledStyles:B.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(B,H)=>`clip-${e}-${H}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-4)).attr("height",B=>Math.max(0,B.y1-B.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",B=>(B.x1-B.x0)/2).attr("y",B=>(B.y1-B.y0)/2).attr("style",B=>{const H=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",G=cr({cssCompiledStyles:B.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,H)=>`url(#clip-${e}-${H})`).text(B=>B.data.name).each(function(B){const H=wt(this),G=B.x1-B.x0,W=B.y1-B.y0,K=H.node(),q=G-2*$,oe=W-2*$;if(qq&&Q>L;)Q--,H.style("font-size",`${Q}px`);let re=Math.max(I,Math.min(N,Math.round(Q*Z))),ie=Q+D+re;for(;ie>oe&&Q>L&&(Q--,re=Math.max(I,Math.min(N,Math.round(Q*Z))),!(req||Q(H.x1-H.x0)/2).attr("y",function(H){return(H.y1-H.y0)/2}).attr("style",H=>{const G=`text-anchor: middle; dominant-baseline: hanging; font-size: ${N}px;fill:`+b(H.data.name)+";",W=cr({cssCompiledStyles:H.data.cssCompiledStyles});return G+W.labelStyles.replace("color:","fill:")}).attr("clip-path",(H,G)=>`url(#clip-${e}-${G})`).text(H=>H.value?y(H.value):"").each(function(H){const G=wt(this),W=this.parentNode;if(!W){G.style("display","none");return}const K=wt(W).select(".treemapLabel");if(K.empty()||K.style("display")==="none"){G.style("display","none");return}const q=parseFloat(K.style("font-size")),Q=Math.max(I,Math.min(N,Math.round(q*.6)));G.style("font-size",`${Q}px`);const re=(H.y1-H.y0)/2+q/2+D;G.attr("y",re);const ie=H.x1-H.x0,_e=H.y1-H.y0-4,$e=ie-2*$;G.node().getComputedTextLength()>$e||re+Q>_e||Q{const e=V0(),r=br(),n=es(e,r.themeVariables),i=es(exr,t),s=i.titleColor??n.titleColor,a=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -5572,8 +5579,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error fill: ${s}; font-size: ${i.titleFontSize}; } - `},"getStyles"),zbr=Fbr,Vbr={parser:PYe,get db(){return new DYe},renderer:$br,styles:zbr};const Hbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vbr},Symbol.toStringTag,{value:"Module"}));var YI=w((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),zm=w((t,e,r)=>({x:YI(e,`${r} evolution`),y:YI(t,`${r} visibility`)}),"toCoordinates"),zye=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),Gbr=w(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Wbr=w((t,e)=>{if(Fl(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=zm(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=zm(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,s=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,a=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,s,r.inertia,a)}),t.notes.forEach(r=>{const n=zm(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(s=>{const a=`${r.parent}_${s.name}`,o=s.label?(s.label.negX?-1:1)*s.label.offsetX:void 0,l=s.label?(s.label.negY?-1:1)*s.label.offsetY:void 0,u=YI(s.evolution,`Pipeline component "${s.name}" evolution`);e.addNode(a,s.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,a)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=zye(r.fromPort)??zye(r.toPort);const{flow:s,label:a}=Gbr(r.arrow);!i&&s&&(i=s);const o=r.linkLabel,l=a??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=YI(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=zm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=zm(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=zm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=zm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),$Ye={parser:{yy:void 0},parse:w(async t=>{var n;const e=await $u("wardley",t);de.debug(e);const r=(n=$Ye.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wbr(e,r)},"parse")},MT,qbr=(MT=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},w(MT,"WardleyBuilder"),MT),Jo=new qbr;function BYe(){return Ve()["wardley-beta"]}w(BYe,"getConfig");function FYe(t,e,r,n,i,s,a,o,l){Jo.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:s,labelOffsetY:a,inertia:o,sourceStrategy:l})}w(FYe,"addNode");function zYe(t,e,r=!1,n,i){Jo.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(zYe,"addLink");function VYe(t,e,r){Jo.addTrend({nodeId:t,targetX:e,targetY:r})}w(VYe,"addTrend");function HYe(t,e,r){Jo.addAnnotation({number:t,coordinates:e,text:r})}w(HYe,"addAnnotation");function GYe(t,e,r){Jo.addNote({text:t,x:e,y:r})}w(GYe,"addNote");function WYe(t,e,r){Jo.addAccelerator({name:t,x:e,y:r})}w(WYe,"addAccelerator");function qYe(t,e,r){Jo.addDeaccelerator({name:t,x:e,y:r})}w(qYe,"addDeaccelerator");function UYe(t,e){Jo.setAnnotationsBox(t,e)}w(UYe,"setAnnotationsBox");function YYe(t,e){Jo.setSize(t,e)}w(YYe,"setSize");function jYe(t){Jo.startPipeline(t)}w(jYe,"startPipeline");function XYe(t,e){Jo.addPipelineComponent(t,e)}w(XYe,"addPipelineComponent");function KYe(t){Jo.setAxes(t)}w(KYe,"updateAxes");function ZYe(t){return Jo.getNode(t)}w(ZYe,"getNode");function QYe(t){return Jo.resolveNodeId(t)}w(QYe,"resolveNodeId");function JYe(){return Jo.build()}w(JYe,"getWardleyData");function eje(){Jo.clear(),Ri()}w(eje,"clear");var Ubr={getConfig:BYe,addNode:FYe,addLink:zYe,addTrend:VYe,addAnnotation:HYe,addNote:GYe,addAccelerator:WYe,addDeaccelerator:qYe,setAnnotationsBox:UYe,setSize:YYe,startPipeline:jYe,addPipelineComponent:XYe,updateAxes:KYe,getNode:ZYe,resolveNodeId:QYe,getWardleyData:JYe,clear:eje,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Ybr=["Genesis","Custom Built","Product","Commodity"],jbr=w(()=>{var e,r,n,i,s,a,o,l,u,h,d,f;const{themeVariables:t}=Ve();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((s=t.wardley)==null?void 0:s.componentFill)??"#fff",componentStroke:((a=t.wardley)==null?void 0:a.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Xbr=w(()=>{const t=Ve()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Kbr=w((t,e,r,n)=>{var D,F;de.debug(`Rendering Wardley map -`+t);const i=Xbr(),s=jbr(),a=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((D=l.size)==null?void 0:D.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=Xo(e);f.selectAll("*").remove(),Fs(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",s.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",s.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",s.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",s.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=w(z=>i.padding+z/100*m,"projectX"),x=w(z=>d-i.padding-z/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",s.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",s.axisColor).attr("stroke-width",1);const T=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(T),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:Ybr;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,B=[];if(V&&V.length===S.length){let H=0;V.forEach(G=>{B.push({start:H,end:G}),H=G})}else{const H=1/S.length;S.forEach((G,W)=>{B.push({start:W*H,end:(W+1)*H})})}S.forEach((H,G)=>{const W=B[G],K=i.padding+W.start*m,q=i.padding+W.end*m,oe=(K+q)/2;G>0&&z.append("line").attr("x1",K).attr("x2",K).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),z.append("text").attr("class","wardley-stage-label").attr("x",oe).attr("y",d-i.padding/1.5).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(H)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const B=V/4,H=i.padding+m*B;z.append("line").attr("x1",H).attr("x2",H).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",s.gridColor).attr("stroke-dasharray","2 6"),z.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*B).attr("y2",d-i.padding-y*B).attr("stroke",s.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(z=>{k.set(z.id,{x:v(z.x),y:x(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const H=B.componentIds.map(q=>({id:q,pos:k.get(q),node:l.nodes.find(oe=>oe.id===q)})).filter(q=>q.pos&&q.node).sort((q,oe)=>q.node.x-oe.node.x);for(let q=0;q{const oe=k.get(q);oe&&(G=Math.min(G,oe.x),W=Math.max(W,oe.x),K=oe.y)}),G!==1/0&&W!==-1/0){const oe=i.nodeRadius*4,Q=K-oe/2,Z=k.get(B.nodeId);if(Z){const re=(G+W)/2;Z.x=re,Z.y=Q-a/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",G-15).attr("y",Q).attr("width",W-G+30).attr("height",oe).attr("fill","none").attr("stroke",s.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const E=p.append("g").attr("class","wardley-links"),A=new Map;l.pipelines.forEach(z=>{A.set(z.nodeId,new Set(z.componentIds))});const R=l.links.filter(z=>{if(!k.has(z.source)||!k.has(z.target))return!1;const V=A.get(z.target);return!(V!=null&&V.has(z.source))});E.selectAll("line").data(R).enter().append("line").attr("class",z=>`wardley-link${z.dashed?" wardley-link--dashed":""}`).attr("x1",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.source).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=B.x-V.x,K=B.y-V.y,q=Math.sqrt(W*W+K*K);return V.x+W/q*G}).attr("y1",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.source).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=B.x-V.x,K=B.y-V.y,q=Math.sqrt(W*W+K*K);return V.y+K/q*G}).attr("x2",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.target).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=V.x-B.x,K=V.y-B.y,q=Math.sqrt(W*W+K*K);return B.x+W/q*G}).attr("y2",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.target).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=V.x-B.x,K=V.y-B.y,q=Math.sqrt(W*W+K*K);return B.y+K/q*G}).attr("stroke",s.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",z=>z.dashed?"6 6":null).attr("marker-end",z=>z.flow==="forward"||z.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",z=>z.flow==="backward"||z.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(R.filter(z=>z.label)).enter().append("text").attr("class","wardley-link-label").attr("x",z=>{const V=k.get(z.source),B=k.get(z.target),H=(V.x+B.x)/2,G=B.y-V.y,W=B.x-V.x,K=Math.sqrt(W*W+G*G),q=8,oe=G/K;return H+oe*q}).attr("y",z=>{const V=k.get(z.source),B=k.get(z.target),H=(V.y+B.y)/2,G=B.x-V.x,W=B.y-V.y,K=Math.sqrt(G*G+W*W),q=8,oe=-G/K;return H+oe*q}).attr("fill",s.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const V=k.get(z.source),B=k.get(z.target),H=(V.x+B.x)/2,G=(V.y+B.y)/2,W=B.x-V.x,K=B.y-V.y,q=Math.sqrt(W*W+K*K),oe=8,Q=K/q,Z=-W/q,re=H+Q*oe,ie=G+Z*oe;let me=Math.atan2(K,W)*180/Math.PI;return(me>90||me<-90)&&(me+=180),`rotate(${me} ${re} ${ie})`}).text(z=>z.label);const _=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const V=k.get(z.nodeId);if(!V)return null;const B=v(z.targetX),H=x(z.targetY),G=B-V.x,W=H-V.y,K=Math.sqrt(G*G+W*W),q=i.nodeRadius+2,oe=K>q?B-G/K*q:B,Q=K>q?H-W/K*q:H;return{origin:V,targetX:B,targetY:H,adjustedX2:oe,adjustedY2:Q}}).filter(z=>z!==null);_.selectAll("line").data(P).enter().append("line").attr("class","wardley-trend").attr("x1",z=>z.origin.x).attr("y1",z=>z.origin.y).attr("x2",z=>z.adjustedX2).attr("y2",z=>z.adjustedY2).attr("stroke",s.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const L=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",z=>["wardley-node",z.className?`wardley-node--${z.className}`:""].filter(Boolean).join(" "));L.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=L.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius).attr("fill",s.componentFill).attr("stroke",s.componentStroke).attr("stroke-width",1);const $=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x).attr("y1",z=>k.get(z.id).y-O).attr("x2",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x).attr("y2",z=>k.get(z.id).y-O).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y-O).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),L.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>k.get(z.id).x-a/2).attr("y",z=>k.get(z.id).y-a/2).attr("width",a).attr("height",a).attr("fill",s.componentFill).attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const V=k.get(z.id);let B=z.isPipelineParent?a/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y1",z=>{const V=k.get(z.id),B=z.isPipelineParent?a:i.nodeRadius*2;return V.y-B/2}).attr("x2",z=>{const V=k.get(z.id);let B=z.isPipelineParent?a/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y2",z=>{const V=k.get(z.id),B=z.isPipelineParent?a:i.nodeRadius*2;return V.y+B/2}).attr("stroke",s.componentStroke).attr("stroke-width",6),L.append("text").attr("x",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?V.x+z.labelOffsetX:V.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const H=z.labelOffsetX??B;return V.x+H}).attr("y",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?V.y+z.labelOffsetY:V.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const H=z.labelOffsetY??B;return V.y+H}).attr("class","wardley-node-label").attr("fill",z=>z.className==="evolved"?s.evolutionStroke:z.className==="anchor"?"#000":s.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",z=>z.className==="anchor"?"bold":"normal").attr("text-anchor",z=>z.className==="anchor"?"middle":"start").attr("dominant-baseline",z=>z.className==="anchor"?"middle":"auto").text(z=>z.label),l.annotations.length>0){const z=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const B=V.coordinates.map(H=>({x:v(H.x),y:x(H.y)}));if(B.length>1)for(let H=0;H{const G=z.append("g").attr("class","wardley-annotation");G.append("circle").attr("cx",H.x).attr("cy",H.y).attr("r",10).attr("fill","white").attr("stroke",s.axisColor).attr("stroke-width",1.5),G.append("text").attr("x",H.x).attr("y",H.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),B=x(l.annotationsBox.y);const H=10,G=16,W=11,K=z.append("g").attr("class","wardley-annotations-box"),q=[...l.annotations].filter(Q=>Q.text).sort((Q,Z)=>Q.number-Z.number),oe=[];if(q.forEach((Q,Z)=>{const re=K.append("text").attr("x",V+H).attr("y",B+H+(Z+1)*G).attr("font-size",W).attr("fill",s.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Q.number}. ${Q.text}`);oe.push(re)}),oe.length>0){let Q=0,Z=0;oe.forEach(Fe=>{const ce=Fe.node(),he=ce.getComputedTextLength();Q=Math.max(Q,he);const Te=ce.getBBox();Z=Math.max(Z,Te.height)});const re=Q+H*2+105,ie=q.length*G+H*2+Z/2,me=i.padding,te=h-i.padding-re,_e=i.padding,$e=d-i.padding-ie;V=Math.max(me,Math.min(V,te)),B=Math.max(_e,Math.min(B,$e)),oe.forEach((Fe,ce)=>{Fe.attr("x",V+H).attr("y",B+H+(ce+1)*G)}),K.insert("rect","text").attr("x",V).attr("y",B).attr("width",re).attr("height",ie).attr("fill","white").attr("stroke",s.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const z=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const B=v(V.x),H=x(V.y);z.append("text").attr("x",B).attr("y",H).attr("text-anchor","start").attr("font-size",11).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const B=v(V.x),H=x(V.y),G=60,W=30,K=20,q=` + `},"getStyles"),rxr=txr,nxr={parser:HYe,get db(){return new zYe},renderer:Jbr,styles:rxr};const ixr=Object.freeze(Object.defineProperty({__proto__:null,diagram:nxr},Symbol.toStringTag,{value:"Module"}));var KI=w((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),Gm=w((t,e,r)=>({x:KI(e,`${r} evolution`),y:KI(t,`${r} visibility`)}),"toCoordinates"),Uye=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),sxr=w(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),axr=w((t,e)=>{if(Vl(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=Gm(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=Gm(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,s=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,a=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,s,r.inertia,a)}),t.notes.forEach(r=>{const n=Gm(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(s=>{const a=`${r.parent}_${s.name}`,o=s.label?(s.label.negX?-1:1)*s.label.offsetX:void 0,l=s.label?(s.label.negY?-1:1)*s.label.offsetY:void 0,u=KI(s.evolution,`Pipeline component "${s.name}" evolution`);e.addNode(a,s.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,a)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Uye(r.fromPort)??Uye(r.toPort);const{flow:s,label:a}=sxr(r.arrow);!i&&s&&(i=s);const o=r.linkLabel,l=a??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=KI(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=Gm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=Gm(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=Gm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=Gm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),GYe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("wardley",t);de.debug(e);const r=(n=GYe.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");axr(e,r)},"parse")},_T,oxr=(_T=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},w(_T,"WardleyBuilder"),_T),Jo=new oxr;function WYe(){return Ve()["wardley-beta"]}w(WYe,"getConfig");function qYe(t,e,r,n,i,s,a,o,l){Jo.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:s,labelOffsetY:a,inertia:o,sourceStrategy:l})}w(qYe,"addNode");function UYe(t,e,r=!1,n,i){Jo.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(UYe,"addLink");function YYe(t,e,r){Jo.addTrend({nodeId:t,targetX:e,targetY:r})}w(YYe,"addTrend");function jYe(t,e,r){Jo.addAnnotation({number:t,coordinates:e,text:r})}w(jYe,"addAnnotation");function XYe(t,e,r){Jo.addNote({text:t,x:e,y:r})}w(XYe,"addNote");function KYe(t,e,r){Jo.addAccelerator({name:t,x:e,y:r})}w(KYe,"addAccelerator");function ZYe(t,e,r){Jo.addDeaccelerator({name:t,x:e,y:r})}w(ZYe,"addDeaccelerator");function QYe(t,e){Jo.setAnnotationsBox(t,e)}w(QYe,"setAnnotationsBox");function JYe(t,e){Jo.setSize(t,e)}w(JYe,"setSize");function eje(t){Jo.startPipeline(t)}w(eje,"startPipeline");function tje(t,e){Jo.addPipelineComponent(t,e)}w(tje,"addPipelineComponent");function rje(t){Jo.setAxes(t)}w(rje,"updateAxes");function nje(t){return Jo.getNode(t)}w(nje,"getNode");function ije(t){return Jo.resolveNodeId(t)}w(ije,"resolveNodeId");function sje(){return Jo.build()}w(sje,"getWardleyData");function aje(){Jo.clear(),Ri()}w(aje,"clear");var lxr={getConfig:WYe,addNode:qYe,addLink:UYe,addTrend:YYe,addAnnotation:jYe,addNote:XYe,addAccelerator:KYe,addDeaccelerator:ZYe,setAnnotationsBox:QYe,setSize:JYe,startPipeline:eje,addPipelineComponent:tje,updateAxes:rje,getNode:nje,resolveNodeId:ije,getWardleyData:sje,clear:aje,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},cxr=["Genesis","Custom Built","Product","Commodity"],uxr=w(()=>{var e,r,n,i,s,a,o,l,u,h,d,f;const{themeVariables:t}=Ve();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((s=t.wardley)==null?void 0:s.componentFill)??"#fff",componentStroke:((a=t.wardley)==null?void 0:a.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),hxr=w(()=>{const t=Ve()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),dxr=w((t,e,r,n)=>{var D,F;de.debug(`Rendering Wardley map +`+t);const i=hxr(),s=uxr(),a=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((D=l.size)==null?void 0:D.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=Xo(e);f.selectAll("*").remove(),Fs(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",s.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",s.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",s.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",s.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=w(z=>i.padding+z/100*m,"projectX"),x=w(z=>d-i.padding-z/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",s.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",s.axisColor).attr("stroke-width",1);const T=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(T),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:cxr;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,B=[];if(V&&V.length===S.length){let H=0;V.forEach(G=>{B.push({start:H,end:G}),H=G})}else{const H=1/S.length;S.forEach((G,W)=>{B.push({start:W*H,end:(W+1)*H})})}S.forEach((H,G)=>{const W=B[G],K=i.padding+W.start*m,q=i.padding+W.end*m,oe=(K+q)/2;G>0&&z.append("line").attr("x1",K).attr("x2",K).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),z.append("text").attr("class","wardley-stage-label").attr("x",oe).attr("y",d-i.padding/1.5).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(H)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const B=V/4,H=i.padding+m*B;z.append("line").attr("x1",H).attr("x2",H).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",s.gridColor).attr("stroke-dasharray","2 6"),z.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*B).attr("y2",d-i.padding-y*B).attr("stroke",s.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(z=>{k.set(z.id,{x:v(z.x),y:x(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const H=B.componentIds.map(q=>({id:q,pos:k.get(q),node:l.nodes.find(oe=>oe.id===q)})).filter(q=>q.pos&&q.node).sort((q,oe)=>q.node.x-oe.node.x);for(let q=0;q{const oe=k.get(q);oe&&(G=Math.min(G,oe.x),W=Math.max(W,oe.x),K=oe.y)}),G!==1/0&&W!==-1/0){const oe=i.nodeRadius*4,Q=K-oe/2,Z=k.get(B.nodeId);if(Z){const re=(G+W)/2;Z.x=re,Z.y=Q-a/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",G-15).attr("y",Q).attr("width",W-G+30).attr("height",oe).attr("fill","none").attr("stroke",s.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const E=p.append("g").attr("class","wardley-links"),A=new Map;l.pipelines.forEach(z=>{A.set(z.nodeId,new Set(z.componentIds))});const R=l.links.filter(z=>{if(!k.has(z.source)||!k.has(z.target))return!1;const V=A.get(z.target);return!(V!=null&&V.has(z.source))});E.selectAll("line").data(R).enter().append("line").attr("class",z=>`wardley-link${z.dashed?" wardley-link--dashed":""}`).attr("x1",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.source).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=B.x-V.x,K=B.y-V.y,q=Math.sqrt(W*W+K*K);return V.x+W/q*G}).attr("y1",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.source).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=B.x-V.x,K=B.y-V.y,q=Math.sqrt(W*W+K*K);return V.y+K/q*G}).attr("x2",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.target).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=V.x-B.x,K=V.y-B.y,q=Math.sqrt(W*W+K*K);return B.x+W/q*G}).attr("y2",z=>{const V=k.get(z.source),B=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.target).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=V.x-B.x,K=V.y-B.y,q=Math.sqrt(W*W+K*K);return B.y+K/q*G}).attr("stroke",s.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",z=>z.dashed?"6 6":null).attr("marker-end",z=>z.flow==="forward"||z.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",z=>z.flow==="backward"||z.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(R.filter(z=>z.label)).enter().append("text").attr("class","wardley-link-label").attr("x",z=>{const V=k.get(z.source),B=k.get(z.target),H=(V.x+B.x)/2,G=B.y-V.y,W=B.x-V.x,K=Math.sqrt(W*W+G*G),q=8,oe=G/K;return H+oe*q}).attr("y",z=>{const V=k.get(z.source),B=k.get(z.target),H=(V.y+B.y)/2,G=B.x-V.x,W=B.y-V.y,K=Math.sqrt(G*G+W*W),q=8,oe=-G/K;return H+oe*q}).attr("fill",s.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const V=k.get(z.source),B=k.get(z.target),H=(V.x+B.x)/2,G=(V.y+B.y)/2,W=B.x-V.x,K=B.y-V.y,q=Math.sqrt(W*W+K*K),oe=8,Q=K/q,Z=-W/q,re=H+Q*oe,ie=G+Z*oe;let me=Math.atan2(K,W)*180/Math.PI;return(me>90||me<-90)&&(me+=180),`rotate(${me} ${re} ${ie})`}).text(z=>z.label);const _=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const V=k.get(z.nodeId);if(!V)return null;const B=v(z.targetX),H=x(z.targetY),G=B-V.x,W=H-V.y,K=Math.sqrt(G*G+W*W),q=i.nodeRadius+2,oe=K>q?B-G/K*q:B,Q=K>q?H-W/K*q:H;return{origin:V,targetX:B,targetY:H,adjustedX2:oe,adjustedY2:Q}}).filter(z=>z!==null);_.selectAll("line").data(P).enter().append("line").attr("class","wardley-trend").attr("x1",z=>z.origin.x).attr("y1",z=>z.origin.y).attr("x2",z=>z.adjustedX2).attr("y2",z=>z.adjustedY2).attr("stroke",s.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const L=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",z=>["wardley-node",z.className?`wardley-node--${z.className}`:""].filter(Boolean).join(" "));L.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=L.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius).attr("fill",s.componentFill).attr("stroke",s.componentStroke).attr("stroke-width",1);const $=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x).attr("y1",z=>k.get(z.id).y-O).attr("x2",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x).attr("y2",z=>k.get(z.id).y-O).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y-O).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),L.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>k.get(z.id).x-a/2).attr("y",z=>k.get(z.id).y-a/2).attr("width",a).attr("height",a).attr("fill",s.componentFill).attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const V=k.get(z.id);let B=z.isPipelineParent?a/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y1",z=>{const V=k.get(z.id),B=z.isPipelineParent?a:i.nodeRadius*2;return V.y-B/2}).attr("x2",z=>{const V=k.get(z.id);let B=z.isPipelineParent?a/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y2",z=>{const V=k.get(z.id),B=z.isPipelineParent?a:i.nodeRadius*2;return V.y+B/2}).attr("stroke",s.componentStroke).attr("stroke-width",6),L.append("text").attr("x",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?V.x+z.labelOffsetX:V.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const H=z.labelOffsetX??B;return V.x+H}).attr("y",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?V.y+z.labelOffsetY:V.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const H=z.labelOffsetY??B;return V.y+H}).attr("class","wardley-node-label").attr("fill",z=>z.className==="evolved"?s.evolutionStroke:z.className==="anchor"?"#000":s.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",z=>z.className==="anchor"?"bold":"normal").attr("text-anchor",z=>z.className==="anchor"?"middle":"start").attr("dominant-baseline",z=>z.className==="anchor"?"middle":"auto").text(z=>z.label),l.annotations.length>0){const z=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const B=V.coordinates.map(H=>({x:v(H.x),y:x(H.y)}));if(B.length>1)for(let H=0;H{const G=z.append("g").attr("class","wardley-annotation");G.append("circle").attr("cx",H.x).attr("cy",H.y).attr("r",10).attr("fill","white").attr("stroke",s.axisColor).attr("stroke-width",1.5),G.append("text").attr("x",H.x).attr("y",H.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),B=x(l.annotationsBox.y);const H=10,G=16,W=11,K=z.append("g").attr("class","wardley-annotations-box"),q=[...l.annotations].filter(Q=>Q.text).sort((Q,Z)=>Q.number-Z.number),oe=[];if(q.forEach((Q,Z)=>{const re=K.append("text").attr("x",V+H).attr("y",B+H+(Z+1)*G).attr("font-size",W).attr("fill",s.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Q.number}. ${Q.text}`);oe.push(re)}),oe.length>0){let Q=0,Z=0;oe.forEach(Fe=>{const ce=Fe.node(),he=ce.getComputedTextLength();Q=Math.max(Q,he);const Te=ce.getBBox();Z=Math.max(Z,Te.height)});const re=Q+H*2+105,ie=q.length*G+H*2+Z/2,me=i.padding,te=h-i.padding-re,_e=i.padding,$e=d-i.padding-ie;V=Math.max(me,Math.min(V,te)),B=Math.max(_e,Math.min(B,$e)),oe.forEach((Fe,ce)=>{Fe.attr("x",V+H).attr("y",B+H+(ce+1)*G)}),K.insert("rect","text").attr("x",V).attr("y",B).attr("width",re).attr("height",ie).attr("fill","white").attr("stroke",s.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const z=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const B=v(V.x),H=x(V.y);z.append("text").attr("x",B).attr("y",H).attr("text-anchor","start").attr("font-size",11).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const B=v(V.x),H=x(V.y),G=60,W=30,K=20,q=` M ${B} ${H-W/2} L ${B+G-K} ${H-W/2} L ${B+G-K} ${H-W/2-8} @@ -5591,7 +5598,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error L ${B+K} ${H+W/2} L ${B+G} ${H+W/2} Z - `;z.append("path").attr("d",q).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+G/2).attr("y",H+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),Zbr={draw:Kbr},Qbr=w(({wardley:t}={})=>{const e=$0(),r=vr(),n=es(e,r.themeVariables),i=es(n.wardley,t);return` + `;z.append("path").attr("d",q).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+G/2).attr("y",H+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),fxr={draw:dxr},pxr=w(({wardley:t}={})=>{const e=V0(),r=br(),n=es(e,r.themeVariables),i=es(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -5649,7 +5656,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Jbr={parser:$Ye,db:Ubr,renderer:Zbr,styles:Qbr};const exr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jbr},Symbol.toStringTag,{value:"Module"}));var tje=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),Q7=tje(),txr=w(()=>Q7.domains,"getDomains"),rxr=w(()=>Q7.transitions,"getTransitions"),nxr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));Q7.domains.set(r,{name:r,items:n})}},"setDomains"),ixr=w(t=>{t&&(Q7.transitions=t.filter(e=>e.from===e.to?(de.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"),sxr=w(()=>es({...Sn.cynefin,...vr().cynefin}),"getConfig"),axr=w(()=>{Ri(),Q7=tje()},"clear"),jR={getDomains:txr,getTransitions:rxr,setDomains:nxr,setTransitions:ixr,getConfig:sxr,clear:axr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},oxr=w(t=>{Fl(t,jR),jR.setDomains(t.domains),jR.setTransitions(t.transitions)},"populate"),lxr={parse:w(async t=>{const e=await $u("cynefin",t);de.debug(e),oxr(e)},"parse")};function CE(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}w(CE,"seededRandom");function rje(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),uxr=w(()=>{const t=$0(),e=vr();return es(t,e.themeVariables).cynefin},"getCynefinDomainColors"),AV=3,hxr=w((t,e,r,n)=>{const i=n.db,s=i.getDomains(),a=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=uxr();de.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,x=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},T=Xo(e);Fs(T,x,v,h.useMaxWidth??!0),T.attr("viewBox",`0 0 ${v} ${x}`),l&&T.append("title").text(l),u&&T.append("desc").text(u);const C=T.append("g").attr("transform",`translate(${g}, ${g})`),S=cxr(f,p),k=nje(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),A=["complex","complicated","chaotic","clear"];for(const D of A){const F=S[D];E.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",b[D]).attr("fill-opacity",.4).attr("stroke","none")}const R=C.append("g").attr("class","cynefin-boundaries");R.append("path").attr("class","cynefinBoundary").attr("d",ije(f,p,k,y)).attr("fill","none"),R.append("path").attr("class","cynefinBoundary").attr("d",sje(f,p,k+100,y)).attr("fill","none"),R.append("path").attr("class","cynefinCliff").attr("d",aje(f,p)).attr("fill","none");const _=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",oje(f/2,p/2,_,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const N=C.append("g").attr("class","cynefin-labels");for(const D of A){const F=S[D];N.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(D.charAt(0).toUpperCase()+D.slice(1))}if(N.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const D=C.append("g").attr("class","cynefin-subtitles");for(const F of A){const z=S[F],V=Vye[F];D.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),D.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}D.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Vye.confusion.practice)}const L=C.append("g").attr("class","cynefin-items"),I=26,$=10,O=["complex","complicated","chaotic","clear","confusion"];for(const D of O){const F=s.get(D);if(!F||F.items.length===0)continue;const z=S[D],V=D==="confusion";let B=F.items,H=0;V&&F.items.length>AV&&(H=F.items.length-AV,B=F.items.slice(0,AV));let G;if(V){const W=m?22:14;G=z.cy+W}else G=z.cy+(m?25:15);if([...B].forEach((W,K)=>{const q=G+K*(I+4),oe=L.append("g"),Q=oe.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(W.label);let Z=W.label.length*7;const re=Q.node();if(re&&typeof re.getBBox=="function"){const te=re.getBBox();te.width>0&&(Z=te.width)}const ie=Z+$*2,me=z.cx-ie/2;oe.attr("transform",`translate(${me}, ${q})`),oe.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ie).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[D]).attr("fill-opacity",.95),Q.attr("x",ie/2).attr("y",I/2)}),H>0){const W=G+B.length*(I+4),K=`+${H} more`,q=L.append("g"),oe=q.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(K);let Q=K.length*7;const Z=oe.node();if(Z&&typeof Z.getBBox=="function"){const me=Z.getBBox();me.width>0&&(Q=me.width)}const re=Q+$*2,ie=z.cx-re/2;q.attr("transform",`translate(${ie}, ${W})`),q.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",re).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[D]).attr("fill-opacity",.6),oe.attr("x",re/2).attr("y",I/2)}}if(a.length>0){const D=T.select("defs").empty()?T.append("defs"):T.select("defs"),F=`cynefin-arrow-${e}`;D.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const z=C.append("g").attr("class","cynefin-arrows");a.forEach(V=>{const B=S[V.from],H=S[V.to];if(!B||!H)return;if(V.from===V.to){de.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const G=B.cx,W=B.cy,K=H.cx,q=H.cy,oe=(G+K)/2,Q=(W+q)/2,Z=K-G,re=q-W,ie=Math.sqrt(Z*Z+re*re),me=ie*.15,te=-re/ie,_e=Z/ie,$e=oe+te*me,Fe=Q+_e*me;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${G},${W} Q${$e},${Fe} ${K},${q}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",$e).attr("y",Fe-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),dxr={draw:hxr},fxr=w(()=>{const t=$0(),e=vr();return es(t,e.themeVariables).cynefin},"getCynefinTheme"),pxr=w(()=>{const t=fxr();return` + `},"styles"),gxr={parser:GYe,db:lxr,renderer:fxr,styles:pxr};const mxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:gxr},Symbol.toStringTag,{value:"Module"}));var oje=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),tA=oje(),yxr=w(()=>tA.domains,"getDomains"),vxr=w(()=>tA.transitions,"getTransitions"),bxr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));tA.domains.set(r,{name:r,items:n})}},"setDomains"),xxr=w(t=>{t&&(tA.transitions=t.filter(e=>e.from===e.to?(de.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"),wxr=w(()=>es({...Sn.cynefin,...br().cynefin}),"getConfig"),Txr=w(()=>{Ri(),tA=oje()},"clear"),QR={getDomains:yxr,getTransitions:vxr,setDomains:bxr,setTransitions:xxr,getConfig:wxr,clear:Txr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Cxr=w(t=>{Vl(t,QR),QR.setDomains(t.domains),QR.setTransitions(t.transitions)},"populate"),kxr={parse:w(async t=>{const e=await zu("cynefin",t);de.debug(e),Cxr(e)},"parse")};function EE(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}w(EE,"seededRandom");function lje(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),Exr=w(()=>{const t=V0(),e=br();return es(t,e.themeVariables).cynefin},"getCynefinDomainColors"),LV=3,Axr=w((t,e,r,n)=>{const i=n.db,s=i.getDomains(),a=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=Exr();de.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,x=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},T=Xo(e);Fs(T,x,v,h.useMaxWidth??!0),T.attr("viewBox",`0 0 ${v} ${x}`),l&&T.append("title").text(l),u&&T.append("desc").text(u);const C=T.append("g").attr("transform",`translate(${g}, ${g})`),S=Sxr(f,p),k=cje(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),A=["complex","complicated","chaotic","clear"];for(const D of A){const F=S[D];E.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",b[D]).attr("fill-opacity",.4).attr("stroke","none")}const R=C.append("g").attr("class","cynefin-boundaries");R.append("path").attr("class","cynefinBoundary").attr("d",uje(f,p,k,y)).attr("fill","none"),R.append("path").attr("class","cynefinBoundary").attr("d",hje(f,p,k+100,y)).attr("fill","none"),R.append("path").attr("class","cynefinCliff").attr("d",dje(f,p)).attr("fill","none");const _=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",fje(f/2,p/2,_,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const N=C.append("g").attr("class","cynefin-labels");for(const D of A){const F=S[D];N.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(D.charAt(0).toUpperCase()+D.slice(1))}if(N.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const D=C.append("g").attr("class","cynefin-subtitles");for(const F of A){const z=S[F],V=Yye[F];D.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),D.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}D.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Yye.confusion.practice)}const L=C.append("g").attr("class","cynefin-items"),I=26,$=10,O=["complex","complicated","chaotic","clear","confusion"];for(const D of O){const F=s.get(D);if(!F||F.items.length===0)continue;const z=S[D],V=D==="confusion";let B=F.items,H=0;V&&F.items.length>LV&&(H=F.items.length-LV,B=F.items.slice(0,LV));let G;if(V){const W=m?22:14;G=z.cy+W}else G=z.cy+(m?25:15);if([...B].forEach((W,K)=>{const q=G+K*(I+4),oe=L.append("g"),Q=oe.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(W.label);let Z=W.label.length*7;const re=Q.node();if(re&&typeof re.getBBox=="function"){const te=re.getBBox();te.width>0&&(Z=te.width)}const ie=Z+$*2,me=z.cx-ie/2;oe.attr("transform",`translate(${me}, ${q})`),oe.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ie).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[D]).attr("fill-opacity",.95),Q.attr("x",ie/2).attr("y",I/2)}),H>0){const W=G+B.length*(I+4),K=`+${H} more`,q=L.append("g"),oe=q.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(K);let Q=K.length*7;const Z=oe.node();if(Z&&typeof Z.getBBox=="function"){const me=Z.getBBox();me.width>0&&(Q=me.width)}const re=Q+$*2,ie=z.cx-re/2;q.attr("transform",`translate(${ie}, ${W})`),q.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",re).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[D]).attr("fill-opacity",.6),oe.attr("x",re/2).attr("y",I/2)}}if(a.length>0){const D=T.select("defs").empty()?T.append("defs"):T.select("defs"),F=`cynefin-arrow-${e}`;D.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const z=C.append("g").attr("class","cynefin-arrows");a.forEach(V=>{const B=S[V.from],H=S[V.to];if(!B||!H)return;if(V.from===V.to){de.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const G=B.cx,W=B.cy,K=H.cx,q=H.cy,oe=(G+K)/2,Q=(W+q)/2,Z=K-G,re=q-W,ie=Math.sqrt(Z*Z+re*re),me=ie*.15,te=-re/ie,_e=Z/ie,$e=oe+te*me,Fe=Q+_e*me;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${G},${W} Q${$e},${Fe} ${K},${q}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",$e).attr("y",Fe-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),Mxr={draw:Axr},Rxr=w(()=>{const t=V0(),e=br();return es(t,e.themeVariables).cynefin},"getCynefinTheme"),_xr=w(()=>{const t=Rxr();return` .cynefinDomain { stroke: none; } @@ -5710,8 +5717,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),gxr=pxr,mxr={parser:lxr,db:jR,renderer:dxr,styles:gxr};const yxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:mxr},Symbol.toStringTag,{value:"Module"}));var rie="",nie="",iie="",sie=[],jI=new Map,ng=w(t=>Ln(t,Ve()),"sanitizeText"),W2=w(t=>{switch(t.type){case"terminal":return{...t,value:ng(t.value)};case"nonterminal":return{...t,name:ng(t.name)};case"sequence":return{...t,elements:t.elements.map(W2)};case"choice":return{...t,alternatives:t.alternatives.map(W2)};case"optional":return{...t,element:W2(t.element)};case"repetition":return{...t,element:W2(t.element),separator:t.separator?W2(t.separator):void 0};case"special":return{...t,text:ng(t.text)}}},"sanitizeAstNode"),vxr=w(()=>{rie="",nie="",iie="",sie.length=0,jI.clear(),Ri(),de.debug("[Railroad] Database cleared")},"clear"),lje=w(t=>{rie=ng(t),de.debug("[Railroad] Title set:",t)},"setTitle"),cje=w(()=>rie,"getTitle"),bxr=w(t=>{const e={...t,name:ng(t.name),definition:W2(t.definition),comment:t.comment?ng(t.comment):void 0};de.debug("[Railroad] Adding rule:",e.name),jI.has(e.name)&&de.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),sie.push(e),jI.set(e.name,e)},"addRule"),xxr=w(()=>sie,"getRules"),wxr=w(t=>jI.get(t),"getRule"),Txr=w(t=>{nie=ng(t).replace(/^\s+/g,""),de.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Cxr=w(()=>nie,"getAccTitle"),kxr=w(t=>{iie=ng(t).replace(/\n\s+/g,` -`),de.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),Sxr=w(()=>iie,"getAccDescription"),Exr=lje,Axr=cje,Qi={clear:vxr,setTitle:lje,getTitle:cje,addRule:bxr,getRules:xxr,getRule:wxr,setAccTitle:Txr,getAccTitle:Cxr,setAccDescription:kxr,getAccDescription:Sxr,setDiagramTitle:Exr,getDiagramTitle:Axr},lo={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},Mxr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,Rxr=/^[\w "',.-]+$/,_xr=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"]),uje=w(t=>t?Object.keys(t).every(e=>e==="railroad"||_xr.has(e)):!1,"isRailroadStyleOptions"),Lxr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:uje(t)?t:{}:{},"extractRailroadOverrides"),Ixr=w(t=>{if(!t||uje(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...s}=t;return s},"extractThemeOverrides"),wi=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Mxr.test(r)?r:e},"sanitizeColorValue"),hje=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Rxr.test(r)?r:e},"sanitizeFontFamilyValue"),Vm=w((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),Nxr=w(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),Dxr=w(t=>{const e=hje(t.fontFamily,lo.fontFamily),r=Nxr(t.fontSize)??lo.fontSize;return{...lo,fontFamily:e,fontSize:r,terminalFill:wi(t.secondBkg??t.secondaryColor,lo.terminalFill),terminalStroke:wi(t.secondaryBorderColor??t.lineColor,lo.terminalStroke),terminalTextColor:wi(t.secondaryTextColor??t.textColor,lo.terminalTextColor),nonTerminalFill:wi(t.mainBkg??t.background,lo.nonTerminalFill),nonTerminalStroke:wi(t.primaryBorderColor??t.lineColor,lo.nonTerminalStroke),nonTerminalTextColor:wi(t.primaryTextColor??t.textColor,lo.nonTerminalTextColor),lineColor:wi(t.lineColor,lo.lineColor),markerFill:wi(t.lineColor,lo.markerFill),commentFill:wi(t.labelBackground??t.tertiaryColor,lo.commentFill),commentStroke:wi(t.tertiaryBorderColor??t.lineColor,lo.commentStroke),commentTextColor:wi(t.tertiaryTextColor??t.textColor,lo.commentTextColor),specialFill:wi(t.tertiaryColor??t.secondaryColor,lo.specialFill),specialStroke:wi(t.tertiaryBorderColor??t.secondaryBorderColor,lo.specialStroke),ruleNameColor:wi(t.titleColor??t.textColor,lo.ruleNameColor)}},"buildThemeDefaults"),aie=w(t=>{const e=vr(),r={...$0(),...e.themeVariables??{},...Ixr(t)},n=Dxr(r),i={...e.railroad??{},...Lxr(t)};return{compactMode:i.compactMode??n.compactMode,padding:Vm(i.padding,n.padding),verticalSeparation:Vm(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:Vm(i.horizontalSeparation,n.horizontalSeparation),arcRadius:Vm(i.arcRadius,n.arcRadius),fontSize:Vm(i.fontSize,n.fontSize),fontFamily:hje(i.fontFamily,n.fontFamily),terminalFill:wi(i.terminalFill,n.terminalFill),terminalStroke:wi(i.terminalStroke,n.terminalStroke),terminalTextColor:wi(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:wi(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:wi(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:wi(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:wi(i.lineColor,n.lineColor),strokeWidth:Vm(i.strokeWidth,n.strokeWidth),markerFill:wi(i.markerFill,n.markerFill),commentFill:wi(i.commentFill,n.commentFill),commentStroke:wi(i.commentStroke,n.commentStroke),commentTextColor:wi(i.commentTextColor,n.commentTextColor),specialFill:wi(i.specialFill,n.specialFill),specialStroke:wi(i.specialStroke,n.specialStroke),ruleNameColor:wi(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:Vm(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),$P=w(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:s,nonTerminalFill:a,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=aie(t);return` + `},"styles"),Lxr=_xr,Ixr={parser:kxr,db:QR,renderer:Mxr,styles:Lxr};const Nxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ixr},Symbol.toStringTag,{value:"Module"}));var aie="",oie="",lie="",cie=[],ZI=new Map,ag=w(t=>Ln(t,Ve()),"sanitizeText"),U2=w(t=>{switch(t.type){case"terminal":return{...t,value:ag(t.value)};case"nonterminal":return{...t,name:ag(t.name)};case"sequence":return{...t,elements:t.elements.map(U2)};case"choice":return{...t,alternatives:t.alternatives.map(U2)};case"optional":return{...t,element:U2(t.element)};case"repetition":return{...t,element:U2(t.element),separator:t.separator?U2(t.separator):void 0};case"special":return{...t,text:ag(t.text)}}},"sanitizeAstNode"),Dxr=w(()=>{aie="",oie="",lie="",cie.length=0,ZI.clear(),Ri(),de.debug("[Railroad] Database cleared")},"clear"),pje=w(t=>{aie=ag(t),de.debug("[Railroad] Title set:",t)},"setTitle"),gje=w(()=>aie,"getTitle"),Oxr=w(t=>{const e={...t,name:ag(t.name),definition:U2(t.definition),comment:t.comment?ag(t.comment):void 0};de.debug("[Railroad] Adding rule:",e.name),ZI.has(e.name)&&de.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),cie.push(e),ZI.set(e.name,e)},"addRule"),Pxr=w(()=>cie,"getRules"),$xr=w(t=>ZI.get(t),"getRule"),Bxr=w(t=>{oie=ag(t).replace(/^\s+/g,""),de.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Fxr=w(()=>oie,"getAccTitle"),zxr=w(t=>{lie=ag(t).replace(/\n\s+/g,` +`),de.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),Vxr=w(()=>lie,"getAccDescription"),Hxr=pje,Gxr=gje,Qi={clear:Dxr,setTitle:pje,getTitle:gje,addRule:Oxr,getRules:Pxr,getRule:$xr,setAccTitle:Bxr,getAccTitle:Fxr,setAccDescription:zxr,getAccDescription:Vxr,setDiagramTitle:Hxr,getDiagramTitle:Gxr},lo={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},Wxr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,qxr=/^[\w "',.-]+$/,Uxr=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"]),mje=w(t=>t?Object.keys(t).every(e=>e==="railroad"||Uxr.has(e)):!1,"isRailroadStyleOptions"),Yxr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:mje(t)?t:{}:{},"extractRailroadOverrides"),jxr=w(t=>{if(!t||mje(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...s}=t;return s},"extractThemeOverrides"),wi=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Wxr.test(r)?r:e},"sanitizeColorValue"),yje=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return qxr.test(r)?r:e},"sanitizeFontFamilyValue"),Wm=w((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),Xxr=w(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),Kxr=w(t=>{const e=yje(t.fontFamily,lo.fontFamily),r=Xxr(t.fontSize)??lo.fontSize;return{...lo,fontFamily:e,fontSize:r,terminalFill:wi(t.secondBkg??t.secondaryColor,lo.terminalFill),terminalStroke:wi(t.secondaryBorderColor??t.lineColor,lo.terminalStroke),terminalTextColor:wi(t.secondaryTextColor??t.textColor,lo.terminalTextColor),nonTerminalFill:wi(t.mainBkg??t.background,lo.nonTerminalFill),nonTerminalStroke:wi(t.primaryBorderColor??t.lineColor,lo.nonTerminalStroke),nonTerminalTextColor:wi(t.primaryTextColor??t.textColor,lo.nonTerminalTextColor),lineColor:wi(t.lineColor,lo.lineColor),markerFill:wi(t.lineColor,lo.markerFill),commentFill:wi(t.labelBackground??t.tertiaryColor,lo.commentFill),commentStroke:wi(t.tertiaryBorderColor??t.lineColor,lo.commentStroke),commentTextColor:wi(t.tertiaryTextColor??t.textColor,lo.commentTextColor),specialFill:wi(t.tertiaryColor??t.secondaryColor,lo.specialFill),specialStroke:wi(t.tertiaryBorderColor??t.secondaryBorderColor,lo.specialStroke),ruleNameColor:wi(t.titleColor??t.textColor,lo.ruleNameColor)}},"buildThemeDefaults"),uie=w(t=>{const e=br(),r={...V0(),...e.themeVariables??{},...jxr(t)},n=Kxr(r),i={...e.railroad??{},...Yxr(t)};return{compactMode:i.compactMode??n.compactMode,padding:Wm(i.padding,n.padding),verticalSeparation:Wm(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:Wm(i.horizontalSeparation,n.horizontalSeparation),arcRadius:Wm(i.arcRadius,n.arcRadius),fontSize:Wm(i.fontSize,n.fontSize),fontFamily:yje(i.fontFamily,n.fontFamily),terminalFill:wi(i.terminalFill,n.terminalFill),terminalStroke:wi(i.terminalStroke,n.terminalStroke),terminalTextColor:wi(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:wi(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:wi(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:wi(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:wi(i.lineColor,n.lineColor),strokeWidth:Wm(i.strokeWidth,n.strokeWidth),markerFill:wi(i.markerFill,n.markerFill),commentFill:wi(i.commentFill,n.commentFill),commentStroke:wi(i.commentStroke,n.commentStroke),commentTextColor:wi(i.commentTextColor,n.commentTextColor),specialFill:wi(i.specialFill,n.specialFill),specialStroke:wi(i.specialStroke,n.specialStroke),ruleNameColor:wi(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:Wm(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),zP=w(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:s,nonTerminalFill:a,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=uie(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -5796,9 +5803,9 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),RT,nu=(RT=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,s,a,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${s?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},w(RT,"PathBuilder"),RT),_T,Oxr=(_T=class{constructor(e,r=aie()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s).attr("rx",10).attr("ry",10),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,s=0,a=0;for(const u of n)i+=u.dimensions.width,s=Math.max(s,u.dimensions.up),a=Math.max(a,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,s=0;for(const f of n)i=Math.max(i,f.dimensions.width),s+=f.dimensions.height;s+=(n.length-1)*this.config.verticalSeparation;const a=this.config.arcRadius,o=a*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=s/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=a*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new nu,x=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(a,a,0,!1,x,a,d+(x?a:-a)).lineTo(a,g-(x?a:-a)).arcTo(a,a,0,!1,!x,a*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new nu,T=m+f.dimensions.width,C=l-a*2;g===d?b.moveTo(T,g).lineTo(l,d):b.moveTo(T,g).lineTo(C,g).arcTo(a,a,0,!1,!x,l-a,g+(x?-a:a)).lineTo(l-a,d+(x?a:-a)).arcTo(a,a,0,!1,x,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:s,up:d,down:s-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,s=i*2,a=n.dimensions.width+i*4,o=n.dimensions.height+s,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=s;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new nu().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new nu().moveTo(u+n.dimensions.width,f).lineTo(a,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new nu().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(a-i*2,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,f-i).arcTo(i,i,0,!1,!1,a,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:a,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),s=this.config.arcRadius,a=s*2,o=i.dimensions.width+s*4,l=n===0,u=i.dimensions.height+a+(l?a:0),h=e.append("g").attr("class","railroad-repetition"),d=s*2,f=l?a:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new nu().moveTo(0,g).lineTo(s*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new nu().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+s,y=new nu().moveTo(d+i.dimensions.width,g).arcTo(s,s,0,!1,!0,d+i.dimensions.width+s,g+s).lineTo(d+i.dimensions.width+s,m).arcTo(s,s,0,!1,!0,d+i.dimensions.width,m+s).lineTo(s*2,m+s).arcTo(s,s,0,!1,!0,s,m).lineTo(s,g+s).arcTo(s,s,0,!1,!0,s*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new nu().moveTo(0,g).arcTo(s,s,0,!1,!1,s,g-s).lineTo(s,s).arcTo(s,s,0,!1,!0,s*2,0).lineTo(o-s*2,0).arcTo(s,s,0,!1,!0,o-s,s).lineTo(o-s,g-s).arcTo(s,s,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text("? "+r+" ?"),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",s=this.measureText(i).width+20,a=s+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${a}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",s).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new nu().moveTo(s+this.config.markerRadius,u).lineTo(a,u).build()),n.append("path").attr("class","railroad-line").attr("d",new nu().moveTo(a+l.dimensions.width,u).lineTo(a+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const s=this.renderRule(i,r);r+=s.height+this.config.verticalSeparation,n=Math.max(n,s.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},w(_T,"RailroadRenderer"),_T),Hye=w((t,e,r)=>{Fs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),Pxr=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram -`+t);try{const n=Xo(e);n.attr("class","railroad-diagram");const i=vr().railroad,s=(i==null?void 0:i.useMaxWidth)??!0,a=Qi.getRules();if(de.debug(`[Railroad] Rendering ${a.length} rules`),a.length===0){de.warn("[Railroad] No rules to render"),Hye(n,{height:100,width:200},s);return}const l=new Oxr(n,aie()).renderDiagram(a);Hye(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),BP={draw:Pxr},$xr=nne().Railroad.parser.LangiumParser,q2=w(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(q2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(q2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:q2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:q2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:q2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),Bxr=w(t=>({name:t.name,definition:q2(t.definition)}),"transformRule"),Fxr=w(t=>{Fl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(Bxr(e)))},"populateDb"),zxr={parse:w(t=>{Qi.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=$xr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new j7(e);const r=e.value;de.debug("[Railroad Parser] Parsed rules:",r.rules.length),Fxr(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Qi}},Vxr={parser:zxr,db:Qi,renderer:BP,styles:$P};const Hxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vxr},Symbol.toStringTag,{value:"Module"}));var Gxr=ine().RailroadEbnf.parser.LangiumParser,XR=w(t=>{const e=t.alternatives.map(Wxr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),Wxr=w(t=>{const e=t.elements.map(Uxr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),dje=w(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return XR(t.element);case"EbnfOptional":return{type:"optional",element:XR(t.element)};case"EbnfRepetition":return{type:"repetition",element:XR(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),qxr=w((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},dje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),Uxr=w(t=>t.postfixes.reduce((e,r)=>qxr(e,r),dje(t.base)),"transformTerm"),Yxr=w(t=>({name:t.name,definition:XR(t.definition)}),"transformRule"),jxr=w(t=>{Fl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(Yxr(e)))},"populateDb"),Xxr={parse:w(t=>{Qi.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=Gxr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new j7(e);const r=e.value;de.debug("[EBNF Parser] Parsed rules:",r.rules.length),jxr(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},Kxr={parser:Xxr,db:Qi,renderer:BP,styles:$P};const Zxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kxr},Symbol.toStringTag,{value:"Module"}));var Qxr=sne().RailroadAbnf.parser.LangiumParser,jj=w(t=>{const e=t.alternatives.map(Jxr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),Jxr=w(t=>{const e=t.elements.map(t4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),e4r=w(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,s=n?parseInt(n,10):1/0;return{min:i,max:s}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),t4r=w(t=>{const e=r4r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=e4r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),r4r=w(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return jj(t.element);case"AbnfOptionalGroup":return{type:"optional",element:jj(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),n4r=w(t=>({name:t.name,definition:jj(t.definition)}),"transformRule"),i4r=w(t=>{Fl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(n4r(e)))},"populateDb"),s4r={parse:w(t=>{Qi.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=Qxr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new j7(e);const r=e.value;de.debug("[ABNF Parser] Parsed rules:",r.rules.length),i4r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},a4r={parser:s4r,db:Qi,renderer:BP,styles:$P};const o4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:a4r},Symbol.toStringTag,{value:"Module"}));var l4r=ane().RailroadPeg.parser.LangiumParser,fje=w(t=>{const e=t.alternatives.map(c4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),c4r=w(t=>{const e=t.elements.map(u4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),u4r=w(t=>{const e=h4r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Gye(e)}`:`!${Gye(e)}`}:e},"transformPrefix"),Gye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),h4r=w(t=>{const e=d4r(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),d4r=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return fje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),f4r=w(t=>({name:t.name,definition:fje(t.definition)}),"transformRule"),p4r=w(t=>{Fl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(f4r(e)))},"populateDb"),g4r={parse:w(t=>{Qi.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=l4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new j7(e);const r=e.value;de.debug("[PEG Parser] Parsed rules:",r.rules.length),p4r(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Qi}},m4r={parser:g4r,db:Qi,renderer:BP,styles:$P};const y4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:m4r},Symbol.toStringTag,{value:"Module"}));var v4r=1;function oie(){if(!(typeof globalThis>"u"))return globalThis}w(oie,"getCaptureGlobal");function pje(){var t;return!!((t=oie())!=null&&t.mermaidCaptureSizes)}w(pje,"shouldCaptureSizes");function gje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(gje,"capturedFromLocation");function mje(t,e){const r=oie();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,s=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const a={svgId:s,sizes:t};r.mermaidCapturedSizes.push(a),r.mermaidLastCapturedSizes=a}w(mje,"emitCapturedSizes");function yje(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&mje({metadata:{captureVersion:v4r,capturedAt:new Date().toISOString(),capturedFrom:gje()},nodes:r},t)}w(yje,"captureNodeSizes");const b4r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:yje,shouldCaptureSizes:pje},Symbol.toStringTag,{value:"Module"})),x4r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:LGe,createInfoServices:IGe},Symbol.toStringTag,{value:"Module"})),w4r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:NGe,createPacketServices:DGe},Symbol.toStringTag,{value:"Module"})),T4r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:OGe,createPieServices:PGe},Symbol.toStringTag,{value:"Module"})),C4r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:$Ge,createTreeViewServices:BGe},Symbol.toStringTag,{value:"Module"})),k4r=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:FGe,createArchitectureServices:zGe},Symbol.toStringTag,{value:"Module"})),S4r=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:RGe,createGitGraphServices:_Ge},Symbol.toStringTag,{value:"Module"})),E4r=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:HGe,createEventModelingServices:GGe},Symbol.toStringTag,{value:"Module"})),A4r=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:mGe,createRadarServices:yGe},Symbol.toStringTag,{value:"Module"})),M4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:vGe,createRailroadServices:nne},Symbol.toStringTag,{value:"Module"})),R4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:bGe,createRailroadEbnfServices:ine},Symbol.toStringTag,{value:"Module"})),_4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:xGe,createRailroadAbnfServices:sne},Symbol.toStringTag,{value:"Module"})),L4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:wGe,createRailroadPegServices:ane},Symbol.toStringTag,{value:"Module"})),I4r=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:CGe,createTreemapServices:kGe},Symbol.toStringTag,{value:"Module"})),N4r=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:SGe,createWardleyServices:EGe},Symbol.toStringTag,{value:"Module"})),D4r=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:AGe,createCynefinServices:MGe},Symbol.toStringTag,{value:"Module"})); - +`},"getStyles"),LT,au=(LT=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,s,a,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${s?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},w(LT,"PathBuilder"),LT),IT,Zxr=(IT=class{constructor(e,r=uie()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s).attr("rx",10).attr("ry",10),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,s=0,a=0;for(const u of n)i+=u.dimensions.width,s=Math.max(s,u.dimensions.up),a=Math.max(a,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,s=0;for(const f of n)i=Math.max(i,f.dimensions.width),s+=f.dimensions.height;s+=(n.length-1)*this.config.verticalSeparation;const a=this.config.arcRadius,o=a*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=s/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=a*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new au,x=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(a,a,0,!1,x,a,d+(x?a:-a)).lineTo(a,g-(x?a:-a)).arcTo(a,a,0,!1,!x,a*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new au,T=m+f.dimensions.width,C=l-a*2;g===d?b.moveTo(T,g).lineTo(l,d):b.moveTo(T,g).lineTo(C,g).arcTo(a,a,0,!1,!x,l-a,g+(x?-a:a)).lineTo(l-a,d+(x?a:-a)).arcTo(a,a,0,!1,x,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:s,up:d,down:s-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,s=i*2,a=n.dimensions.width+i*4,o=n.dimensions.height+s,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=s;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new au().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new au().moveTo(u+n.dimensions.width,f).lineTo(a,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new au().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(a-i*2,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,f-i).arcTo(i,i,0,!1,!1,a,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:a,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),s=this.config.arcRadius,a=s*2,o=i.dimensions.width+s*4,l=n===0,u=i.dimensions.height+a+(l?a:0),h=e.append("g").attr("class","railroad-repetition"),d=s*2,f=l?a:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new au().moveTo(0,g).lineTo(s*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new au().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+s,y=new au().moveTo(d+i.dimensions.width,g).arcTo(s,s,0,!1,!0,d+i.dimensions.width+s,g+s).lineTo(d+i.dimensions.width+s,m).arcTo(s,s,0,!1,!0,d+i.dimensions.width,m+s).lineTo(s*2,m+s).arcTo(s,s,0,!1,!0,s,m).lineTo(s,g+s).arcTo(s,s,0,!1,!0,s*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new au().moveTo(0,g).arcTo(s,s,0,!1,!1,s,g-s).lineTo(s,s).arcTo(s,s,0,!1,!0,s*2,0).lineTo(o-s*2,0).arcTo(s,s,0,!1,!0,o-s,s).lineTo(o-s,g-s).arcTo(s,s,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text("? "+r+" ?"),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",s=this.measureText(i).width+20,a=s+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${a}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",s).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new au().moveTo(s+this.config.markerRadius,u).lineTo(a,u).build()),n.append("path").attr("class","railroad-line").attr("d",new au().moveTo(a+l.dimensions.width,u).lineTo(a+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const s=this.renderRule(i,r);r+=s.height+this.config.verticalSeparation,n=Math.max(n,s.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},w(IT,"RailroadRenderer"),IT),jye=w((t,e,r)=>{Fs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),Qxr=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram +`+t);try{const n=Xo(e);n.attr("class","railroad-diagram");const i=br().railroad,s=(i==null?void 0:i.useMaxWidth)??!0,a=Qi.getRules();if(de.debug(`[Railroad] Rendering ${a.length} rules`),a.length===0){de.warn("[Railroad] No rules to render"),jye(n,{height:100,width:200},s);return}const l=new Zxr(n,uie()).renderDiagram(a);jye(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),VP={draw:Qxr},Jxr=one().Railroad.parser.LangiumParser,Y2=w(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Y2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Y2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Y2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Y2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Y2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),e4r=w(t=>({name:t.name,definition:Y2(t.definition)}),"transformRule"),t4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(e4r(e)))},"populateDb"),r4r={parse:w(t=>{Qi.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=Jxr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[Railroad Parser] Parsed rules:",r.rules.length),t4r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Qi}},n4r={parser:r4r,db:Qi,renderer:VP,styles:zP};const i4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:n4r},Symbol.toStringTag,{value:"Module"}));var s4r=lne().RailroadEbnf.parser.LangiumParser,JR=w(t=>{const e=t.alternatives.map(a4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),a4r=w(t=>{const e=t.elements.map(l4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),vje=w(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return JR(t.element);case"EbnfOptional":return{type:"optional",element:JR(t.element)};case"EbnfRepetition":return{type:"repetition",element:JR(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),o4r=w((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},vje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),l4r=w(t=>t.postfixes.reduce((e,r)=>o4r(e,r),vje(t.base)),"transformTerm"),c4r=w(t=>({name:t.name,definition:JR(t.definition)}),"transformRule"),u4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(c4r(e)))},"populateDb"),h4r={parse:w(t=>{Qi.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=s4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[EBNF Parser] Parsed rules:",r.rules.length),u4r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},d4r={parser:h4r,db:Qi,renderer:VP,styles:zP};const f4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:d4r},Symbol.toStringTag,{value:"Module"}));var p4r=cne().RailroadAbnf.parser.LangiumParser,Qj=w(t=>{const e=t.alternatives.map(g4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),g4r=w(t=>{const e=t.elements.map(y4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),m4r=w(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,s=n?parseInt(n,10):1/0;return{min:i,max:s}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),y4r=w(t=>{const e=v4r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=m4r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),v4r=w(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return Qj(t.element);case"AbnfOptionalGroup":return{type:"optional",element:Qj(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),b4r=w(t=>({name:t.name,definition:Qj(t.definition)}),"transformRule"),x4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(b4r(e)))},"populateDb"),w4r={parse:w(t=>{Qi.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=p4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[ABNF Parser] Parsed rules:",r.rules.length),x4r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},T4r={parser:w4r,db:Qi,renderer:VP,styles:zP};const C4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:T4r},Symbol.toStringTag,{value:"Module"}));var k4r=une().RailroadPeg.parser.LangiumParser,bje=w(t=>{const e=t.alternatives.map(S4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),S4r=w(t=>{const e=t.elements.map(E4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),E4r=w(t=>{const e=A4r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Xye(e)}`:`!${Xye(e)}`}:e},"transformPrefix"),Xye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),A4r=w(t=>{const e=M4r(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),M4r=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return bje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),R4r=w(t=>({name:t.name,definition:bje(t.definition)}),"transformRule"),_4r=w(t=>{Vl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(R4r(e)))},"populateDb"),L4r={parse:w(t=>{Qi.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=k4r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[PEG Parser] Parsed rules:",r.rules.length),_4r(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Qi}},I4r={parser:L4r,db:Qi,renderer:VP,styles:zP};const N4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:I4r},Symbol.toStringTag,{value:"Module"}));var D4r=1;function hie(){if(!(typeof globalThis>"u"))return globalThis}w(hie,"getCaptureGlobal");function xje(){var t;return!!((t=hie())!=null&&t.mermaidCaptureSizes)}w(xje,"shouldCaptureSizes");function wje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(wje,"capturedFromLocation");function Tje(t,e){const r=hie();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,s=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const a={svgId:s,sizes:t};r.mermaidCapturedSizes.push(a),r.mermaidLastCapturedSizes=a}w(Tje,"emitCapturedSizes");function Cje(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&Tje({metadata:{captureVersion:D4r,capturedAt:new Date().toISOString(),capturedFrom:wje()},nodes:r},t)}w(Cje,"captureNodeSizes");const O4r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Cje,shouldCaptureSizes:xje},Symbol.toStringTag,{value:"Module"})),P4r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:$Ge,createInfoServices:BGe},Symbol.toStringTag,{value:"Module"})),$4r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:FGe,createPacketServices:zGe},Symbol.toStringTag,{value:"Module"})),B4r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:VGe,createPieServices:HGe},Symbol.toStringTag,{value:"Module"})),F4r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:GGe,createTreeViewServices:WGe},Symbol.toStringTag,{value:"Module"})),z4r=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:qGe,createArchitectureServices:UGe},Symbol.toStringTag,{value:"Module"})),V4r=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:OGe,createGitGraphServices:PGe},Symbol.toStringTag,{value:"Module"})),H4r=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:jGe,createEventModelingServices:XGe},Symbol.toStringTag,{value:"Module"})),G4r=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:TGe,createRadarServices:CGe},Symbol.toStringTag,{value:"Module"})),W4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:kGe,createRailroadServices:one},Symbol.toStringTag,{value:"Module"})),q4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:SGe,createRailroadEbnfServices:lne},Symbol.toStringTag,{value:"Module"})),U4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:EGe,createRailroadAbnfServices:cne},Symbol.toStringTag,{value:"Module"})),Y4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:AGe,createRailroadPegServices:une},Symbol.toStringTag,{value:"Module"})),j4r=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:RGe,createTreemapServices:_Ge},Symbol.toStringTag,{value:"Module"})),X4r=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:LGe,createWardleyServices:IGe},Symbol.toStringTag,{value:"Module"})),K4r=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:NGe,createCynefinServices:DGe},Symbol.toStringTag,{value:"Module"})); +